From patchwork Tue Jul 31 08:09:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 10550385 X-Patchwork-Delegate: kvalo@adurom.com 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 88488139A for ; Tue, 31 Jul 2018 08:09:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7B4A12A20E for ; Tue, 31 Jul 2018 08:09:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 700B22A38B; Tue, 31 Jul 2018 08:09:34 +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 0E3742A20E for ; Tue, 31 Jul 2018 08:09:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730406AbeGaJsk (ORCPT ); Tue, 31 Jul 2018 05:48:40 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:46678 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729643AbeGaJsk (ORCPT ); Tue, 31 Jul 2018 05:48:40 -0400 Received: by mail-wr1-f67.google.com with SMTP id h14-v6so15606706wrw.13 for ; Tue, 31 Jul 2018 01:09:31 -0700 (PDT) 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:in-reply-to :references; bh=Zi4pOPC71L6AzeQwtF4A5pBcfhc1IgM70cRoCL9712o=; b=SCqH/1pSCUE0B9HKVCr14zmRflV3olm8XRjSlMB6Q/mewaJNqT+V+rwTUtK2YbXveG WvZrfjv+TUZaq6eOP1+iZCaRIVc9/ggdTaEv6EDaUSZrIoduN0sNPjsxVKi4EuA9Uiex iEFxQ5oiEKAXqVKdbqJ9MvmvRvO4jBhCMbQiK9BjQ4mSYeY/gy0c0jpVww0JCUPUSgIY g/6ByZlc1X5z6vtS9Cq4BGwaMlP0ABt2l5JzJqLWeTMbH0PZ2rWP4AtYCDnNLNW3D1H9 VOLnRE55K9luFM86MKeS2FZuT0epYw5y1hQl2RU7bbYOZR3ohJAVy28O/yI1tjCo9STT ptEQ== X-Gm-Message-State: AOUpUlHeERUi4kyRvTHLzwNZEfM/j4VXlS1I/BCdSh7ezOzhrR3wDqg0 3uMRDbrsJv+gtNDPmOOHWMpAYA== X-Google-Smtp-Source: AAOMgpdcDa9CBvFag43cJnpdneWO6rt/p52Pp8cJhnmvj6ww1zhySS9FeAwQEQFfglqeXrstr7wC6g== X-Received: by 2002:a5d:4a07:: with SMTP id m7-v6mr21344188wrq.8.1533024571087; Tue, 31 Jul 2018 01:09:31 -0700 (PDT) Received: from localhost.localdomain.com (nat-pool-mxp-t.redhat.com. [149.6.153.186]) by smtp.gmail.com with ESMTPSA id o4-v6sm1501051wmo.20.2018.07.31.01.09.30 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 31 Jul 2018 01:09:30 -0700 (PDT) From: Lorenzo Bianconi To: nbd@nbd.name Cc: linux-wireless@vger.kernel.org, sgruszka@redhat.com Subject: [PATCH v2 07/19] mt76x2: add napi struct to mt76_rx_poll_complete/mt76_rx_complete signatures Date: Tue, 31 Jul 2018 10:09:08 +0200 Message-Id: <0c0924eb76aeef8014b9fc08d92fc27db6a65738.1533023328.git.lorenzo.bianconi@redhat.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: 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 in order to reuse mt76_rx_complete routine supporting mt76x2u based devices add napi struct to mt76_rx_poll_complete and mt76_rx_complete routine signatures and do not fetch it according to the rx queue index Signed-off-by: Lorenzo Bianconi --- drivers/net/wireless/mediatek/mt76/agg-rx.c | 2 +- drivers/net/wireless/mediatek/mt76/dma.c | 2 +- drivers/net/wireless/mediatek/mt76/mac80211.c | 12 +++++------- drivers/net/wireless/mediatek/mt76/mt76.h | 5 +++-- 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/agg-rx.c b/drivers/net/wireless/mediatek/mt76/agg-rx.c index 1e8cdce919d9..73c8b2805c97 100644 --- a/drivers/net/wireless/mediatek/mt76/agg-rx.c +++ b/drivers/net/wireless/mediatek/mt76/agg-rx.c @@ -113,7 +113,7 @@ mt76_rx_aggr_reorder_work(struct work_struct *work) if (nframes) ieee80211_queue_delayed_work(tid->dev->hw, &tid->reorder_work, REORDER_TIMEOUT); - mt76_rx_complete(dev, &frames, -1); + mt76_rx_complete(dev, &frames, NULL); rcu_read_unlock(); local_bh_enable(); diff --git a/drivers/net/wireless/mediatek/mt76/dma.c b/drivers/net/wireless/mediatek/mt76/dma.c index 3dbedcedc2c4..872b1c53e246 100644 --- a/drivers/net/wireless/mediatek/mt76/dma.c +++ b/drivers/net/wireless/mediatek/mt76/dma.c @@ -400,7 +400,7 @@ mt76_dma_rx_poll(struct napi_struct *napi, int budget) do { cur = mt76_dma_rx_process(dev, &dev->q_rx[qid], budget - done); - mt76_rx_poll_complete(dev, qid); + mt76_rx_poll_complete(dev, qid, napi); done += cur; } while (cur && done < budget); diff --git a/drivers/net/wireless/mediatek/mt76/mac80211.c b/drivers/net/wireless/mediatek/mt76/mac80211.c index 6a0b6f4403a8..029d54bce9e8 100644 --- a/drivers/net/wireless/mediatek/mt76/mac80211.c +++ b/drivers/net/wireless/mediatek/mt76/mac80211.c @@ -583,15 +583,11 @@ mt76_check_ps(struct mt76_dev *dev, struct sk_buff *skb) } void mt76_rx_complete(struct mt76_dev *dev, struct sk_buff_head *frames, - int queue) + struct napi_struct *napi) { - struct napi_struct *napi = NULL; struct ieee80211_sta *sta; struct sk_buff *skb; - if (queue >= 0) - napi = &dev->napi[queue]; - spin_lock(&dev->rx_lock); while ((skb = __skb_dequeue(frames)) != NULL) { if (mt76_check_ccmp_pn(skb)) { @@ -605,7 +601,8 @@ void mt76_rx_complete(struct mt76_dev *dev, struct sk_buff_head *frames, spin_unlock(&dev->rx_lock); } -void mt76_rx_poll_complete(struct mt76_dev *dev, enum mt76_rxq_id q) +void mt76_rx_poll_complete(struct mt76_dev *dev, enum mt76_rxq_id q, + struct napi_struct *napi) { struct sk_buff_head frames; struct sk_buff *skb; @@ -617,5 +614,6 @@ void mt76_rx_poll_complete(struct mt76_dev *dev, enum mt76_rxq_id q) mt76_rx_aggr_reorder(skb, &frames); } - mt76_rx_complete(dev, &frames, q); + mt76_rx_complete(dev, &frames, napi); } +EXPORT_SYMBOL_GPL(mt76_rx_poll_complete); diff --git a/drivers/net/wireless/mediatek/mt76/mt76.h b/drivers/net/wireless/mediatek/mt76/mt76.h index 96e9798bb8a0..eb0fd602b9cb 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76.h +++ b/drivers/net/wireless/mediatek/mt76/mt76.h @@ -456,8 +456,9 @@ void mt76_wcid_key_setup(struct mt76_dev *dev, struct mt76_wcid *wcid, void mt76_tx_free(struct mt76_dev *dev); void mt76_put_txwi(struct mt76_dev *dev, struct mt76_txwi_cache *t); void mt76_rx_complete(struct mt76_dev *dev, struct sk_buff_head *frames, - int queue); -void mt76_rx_poll_complete(struct mt76_dev *dev, enum mt76_rxq_id q); + struct napi_struct *napi); +void mt76_rx_poll_complete(struct mt76_dev *dev, enum mt76_rxq_id q, + struct napi_struct *napi); void mt76_rx_aggr_reorder(struct sk_buff *skb, struct sk_buff_head *frames); #endif