* [PATCH] mt7601u: use ieee80211_rx_list to pass frames to the network stack as a batch
@ 2021-01-13 23:26 Lorenzo Bianconi
2021-01-13 23:29 ` Jakub Kicinski
2021-01-25 14:41 ` Kalle Valo
0 siblings, 2 replies; 3+ messages in thread
From: Lorenzo Bianconi @ 2021-01-13 23:26 UTC (permalink / raw)
To: linux-wireless; +Cc: lorenzo.bianconi, kuba
Similar to mt76 driver, rely on ieee80211_rx_list in order to
improve icache footprint
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
---
drivers/net/wireless/mediatek/mt7601u/dma.c | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
diff --git a/drivers/net/wireless/mediatek/mt7601u/dma.c b/drivers/net/wireless/mediatek/mt7601u/dma.c
index 5f99054f535b..e0f96c64aab3 100644
--- a/drivers/net/wireless/mediatek/mt7601u/dma.c
+++ b/drivers/net/wireless/mediatek/mt7601u/dma.c
@@ -74,7 +74,8 @@ mt7601u_rx_skb_from_seg(struct mt7601u_dev *dev, struct mt7601u_rxwi *rxwi,
}
static void mt7601u_rx_process_seg(struct mt7601u_dev *dev, u8 *data,
- u32 seg_len, struct page *p)
+ u32 seg_len, struct page *p,
+ struct list_head *list)
{
struct sk_buff *skb;
struct mt7601u_rxwi *rxwi;
@@ -104,9 +105,13 @@ static void mt7601u_rx_process_seg(struct mt7601u_dev *dev, u8 *data,
if (!skb)
return;
- spin_lock(&dev->mac_lock);
- ieee80211_rx(dev->hw, skb);
- spin_unlock(&dev->mac_lock);
+ local_bh_disable();
+ rcu_read_lock();
+
+ ieee80211_rx_list(dev->hw, NULL, skb, list);
+
+ rcu_read_unlock();
+ local_bh_enable();
}
static u16 mt7601u_rx_next_seg_len(u8 *data, u32 data_len)
@@ -130,6 +135,7 @@ mt7601u_rx_process_entry(struct mt7601u_dev *dev, struct mt7601u_dma_buf_rx *e)
u32 seg_len, data_len = e->urb->actual_length;
u8 *data = page_address(e->p);
struct page *new_p = NULL;
+ LIST_HEAD(list);
int cnt = 0;
if (!test_bit(MT7601U_STATE_INITIALIZED, &dev->state))
@@ -140,7 +146,8 @@ mt7601u_rx_process_entry(struct mt7601u_dev *dev, struct mt7601u_dma_buf_rx *e)
new_p = dev_alloc_pages(MT_RX_ORDER);
while ((seg_len = mt7601u_rx_next_seg_len(data, data_len))) {
- mt7601u_rx_process_seg(dev, data, seg_len, new_p ? e->p : NULL);
+ mt7601u_rx_process_seg(dev, data, seg_len,
+ new_p ? e->p : NULL, &list);
data_len -= seg_len;
data += seg_len;
@@ -150,6 +157,8 @@ mt7601u_rx_process_entry(struct mt7601u_dev *dev, struct mt7601u_dma_buf_rx *e)
if (cnt > 1)
trace_mt_rx_dma_aggr(dev, cnt, !!new_p);
+ netif_receive_skb_list(&list);
+
if (new_p) {
/* we have one extra ref from the allocator */
__free_pages(e->p, MT_RX_ORDER);
--
2.29.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] mt7601u: use ieee80211_rx_list to pass frames to the network stack as a batch
2021-01-13 23:26 [PATCH] mt7601u: use ieee80211_rx_list to pass frames to the network stack as a batch Lorenzo Bianconi
@ 2021-01-13 23:29 ` Jakub Kicinski
2021-01-25 14:41 ` Kalle Valo
1 sibling, 0 replies; 3+ messages in thread
From: Jakub Kicinski @ 2021-01-13 23:29 UTC (permalink / raw)
To: Lorenzo Bianconi; +Cc: linux-wireless, lorenzo.bianconi
On Thu, 14 Jan 2021 00:26:26 +0100 Lorenzo Bianconi wrote:
> Similar to mt76 driver, rely on ieee80211_rx_list in order to
> improve icache footprint
>
> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Acked-by: Jakub Kicinski <kuba@kernel.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] mt7601u: use ieee80211_rx_list to pass frames to the network stack as a batch
2021-01-13 23:26 [PATCH] mt7601u: use ieee80211_rx_list to pass frames to the network stack as a batch Lorenzo Bianconi
2021-01-13 23:29 ` Jakub Kicinski
@ 2021-01-25 14:41 ` Kalle Valo
1 sibling, 0 replies; 3+ messages in thread
From: Kalle Valo @ 2021-01-25 14:41 UTC (permalink / raw)
To: Lorenzo Bianconi; +Cc: linux-wireless, lorenzo.bianconi, kuba
Lorenzo Bianconi <lorenzo@kernel.org> wrote:
> Similar to mt76 driver, rely on ieee80211_rx_list in order to
> improve icache footprint
>
> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
> Acked-by: Jakub Kicinski <kuba@kernel.org>
Patch applied to wireless-drivers-next.git, thanks.
2a9269b1cdc3 mt7601u: use ieee80211_rx_list to pass frames to the network stack as a batch
--
https://patchwork.kernel.org/project/linux-wireless/patch/5c72fa2dda45c1ae3f285af80c02f3db23341d85.1610580222.git.lorenzo@kernel.org/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-01-26 5:55 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-01-13 23:26 [PATCH] mt7601u: use ieee80211_rx_list to pass frames to the network stack as a batch Lorenzo Bianconi
2021-01-13 23:29 ` Jakub Kicinski
2021-01-25 14:41 ` Kalle Valo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).