From patchwork Tue Nov 27 22:21:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 10701541 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6C36813AD for ; Tue, 27 Nov 2018 22:21:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5B7592C637 for ; Tue, 27 Nov 2018 22:21:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 489552CA87; Tue, 27 Nov 2018 22:21:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 36B872C637 for ; Tue, 27 Nov 2018 22:21:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726616AbeK1JUo (ORCPT ); Wed, 28 Nov 2018 04:20:44 -0500 Received: from mail-wm1-f50.google.com ([209.85.128.50]:40402 "EHLO mail-wm1-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726277AbeK1JUo (ORCPT ); Wed, 28 Nov 2018 04:20:44 -0500 Received: by mail-wm1-f50.google.com with SMTP id q26so579749wmf.5 for ; Tue, 27 Nov 2018 14:21:22 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Jz047jd1G1APhZk1CFNl8ayfyXQlJk8RZxMrv6x9NT0=; b=o4sBS7uUeEVi17tOhSNicT1csUFwZz9Qxc29+RxIRrJGiC7EbWbIX+1L/zJF88a6nc hSzlN2TT89allOH3VUtHlrz67zh/LQ87kWqMcU+xdcA4CD8N/pJXkJy3kEMuKMt+rxfZ HRasjFC4yzFqA0/fADWz22K4r+xTTmTT1o9hs66lIlo14hkrTKUmcJZ3TFzb3mY3IZZY fwj9AjcFerTHkkqFmKmz/Pk5Jvu1jf+td0dykKwSJFGqWXoMoG/r8Hu4ugfeD6oJi2cJ K4C1P874HxGMNAKz5eMwauc+obYh21asTkGxSld8AroKI3ECzjiP4dDEdo6YQyvUPqV1 vrRQ== X-Gm-Message-State: AA+aEWYaqlq366kfRKsAc11QZ1Cn4jaUFH/adIICOWrnA8gnTSZlKSjf 3trYI8JOli+iyXFSgECdHURzGxa+3eI= X-Google-Smtp-Source: AFSGD/XkLyFc469Z0Ha5QAkC83iRJ3HCbb+wGyK63JLggDKlrXQJH7yQvkoa1FScuC2zKBRQtrn0CQ== X-Received: by 2002:a1c:57c4:: with SMTP id l187mr615183wmb.6.1543357281979; Tue, 27 Nov 2018 14:21:21 -0800 (PST) Received: from localhost.lan ([151.21.135.68]) by smtp.gmail.com with ESMTPSA id 142sm866245wmw.27.2018.11.27.14.21.21 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Nov 2018 14:21:21 -0800 (PST) From: Lorenzo Bianconi To: linux-wireless@vger.kernel.org Cc: nbd@nbd.name Subject: [RFC 0/5] add XDP support to mt76x2e/mt76x0e drivers Date: Tue, 27 Nov 2018 23:21:07 +0100 Message-Id: X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This series is intended as a playground to start experimenting/developing with XDP/eBPF over WiFi and collect ideas/concerns about it. Introduce XDP support to mt76x2e/mt76x0e drivers. Currently supported actions are: - XDP_PASS - XDP_ABORTED - XDP_DROP Introduce ndo_bpf mac80211 callback in order to to load a bpf program into low level driver XDP rx hook. This series has been tested through a simple bpf program (available here: https://github.com/LorenzoBianconi/bpf-workspace/tree/master/mt76_xdp_stats) used to count frame types received by the device. Possible eBPF use cases could be: - implement new statistics through bpf maps - implement fast packet filtering (e.g in monitor mode) - ... Lorenzo Bianconi (5): mac80211: introduce ieee80211_xdp handler mac80211: introduce ieee80211_vif_to_netdev routine mt76: split mt76_dma_rx_reset in init_rx_reset and complete_rx_reset mt76: make mt76x02_vif_init return int mt76: add XDP support drivers/net/wireless/mediatek/mt76/dma.c | 58 +++++++++++- drivers/net/wireless/mediatek/mt76/mac80211.c | 18 ++++ drivers/net/wireless/mediatek/mt76/mt76.h | 12 ++- .../net/wireless/mediatek/mt76/mt76x0/pci.c | 3 + drivers/net/wireless/mediatek/mt76/mt76x02.h | 7 +- .../net/wireless/mediatek/mt76/mt76x02_mac.h | 1 + .../net/wireless/mediatek/mt76/mt76x02_mmio.c | 90 +++++++++++++++++++ .../net/wireless/mediatek/mt76/mt76x02_util.c | 17 +++- .../wireless/mediatek/mt76/mt76x2/pci_init.c | 2 + .../wireless/mediatek/mt76/mt76x2/pci_main.c | 1 + .../wireless/mediatek/mt76/mt76x2/usb_main.c | 3 +- include/net/mac80211.h | 4 + net/mac80211/driver-ops.h | 11 +++ net/mac80211/iface.c | 14 +++ net/mac80211/util.c | 12 +++ 15 files changed, 241 insertions(+), 12 deletions(-)