Re: [PATCH v2 net-next] net: core: use listified Rx for GRO_NORMAL in napi_gro_receive()

From: Alexander Lobakin
Date: Mon Nov 25 2019 - 08:40:10 EST


Edward Cree wrote 25.11.2019 16:21:
On 25/11/2019 12:02, Alexander Lobakin wrote:
I'm not very familiar with iwlwifi, but as a work around manual
napi_gro_flush() you can also manually flush napi->rx_list to
prevent packets from stalling:

diff -Naur a/drivers/net/wireless/intel/iwlwifi/pcie/rx.c b/drivers/net/wireless/intel/iwlwifi/pcie/rx.c
--- a/drivers/net/wireless/intel/iwlwifi/pcie/rx.cÂÂÂ 2019-11-25 14:55:03.610355230 +0300
+++ b/drivers/net/wireless/intel/iwlwifi/pcie/rx.cÂÂÂ 2019-11-25 14:57:29.399556868 +0300
@@ -1526,8 +1526,16 @@
ÂÂÂÂ if (unlikely(emergency && count))
ÂÂÂÂÂÂÂÂ iwl_pcie_rxq_alloc_rbs(trans, GFP_ATOMIC, rxq);

-ÂÂÂ if (rxq->napi.poll)
+ÂÂÂ if (rxq->napi.poll) {
+ÂÂÂÂÂÂÂ if (rxq->napi.rx_count) {
+ÂÂÂÂÂÂÂÂÂÂÂ netif_receive_skb_list(&rxq->napi.rx_list);
+
+ÂÂÂÂÂÂÂÂÂÂÂ INIT_LIST_HEAD(&rxq->napi.rx_list);
+ÂÂÂÂÂÂÂÂÂÂÂ rxq->napi.rx_count = 0;
+ÂÂÂÂÂÂÂ }
+
ÂÂÂÂÂÂÂÂ napi_gro_flush(&rxq->napi, false);
+ÂÂÂ }

ÂÂÂÂ iwl_pcie_rxq_restock(trans, rxq);
Â}
... or we could export gro_normal_list(), instead of open-coding it
Âin the driver?

I thought about this too, but don't like it. This patch is proposed as
a *very* temporary solution until iwlwifi will get more straightforward
logic. I wish we could make napi_gro_flush() static in the future and
keep gro_normal_list() private to:

- prevent them from using in any new drivers;
- give more opportunity to CC to optimize the core code.


-Ed

Regards,
á á á á á á