Skip to content

Commit b167191

Browse files
solbjorndavem330
authored andcommitted
net: wireless: intel: iwlwifi: fix GRO_NORMAL packet stalling
Commit 6570bc7 ("net: core: use listified Rx for GRO_NORMAL in napi_gro_receive()") has applied batched GRO_NORMAL packets processing to all napi_gro_receive() users, including mac80211-based drivers. However, this change has led to a regression in iwlwifi driver [1][2] as it is required for NAPI users to call napi_complete_done() or napi_complete() and the end of every polling iteration, whilst iwlwifi doesn't use NAPI scheduling at all and just calls napi_gro_flush(). In that particular case, packets which have not been already flushed from napi->rx_list stall in it until at least next Rx cycle. Fix this by adding a manual flushing of the list to iwlwifi driver right before napi_gro_flush() call to mimic napi_complete() logics. I prefer to open-code gro_normal_list() rather than exporting it for 2 reasons: * to prevent from using it and napi_gro_flush() in any new drivers, as it is the *really* bad way to use NAPI that should be avoided; * to keep gro_normal_list() static and don't lose any CC optimizations. I also don't add the "Fixes:" tag as the mentioned commit was only a trigger that only exposed an improper usage of NAPI in this particular driver. [1] https://lore.kernel.org/netdev/PSXP216MB04388962C411CD0B17A86F47804A0@PSXP216MB0438.KORP216.PROD.OUTLOOK.COM [2] https://bugzilla.kernel.org/show_bug.cgi?id=205647 Signed-off-by: Alexander Lobakin <[email protected]> Acked-by: Luca Coelho <[email protected]> Reported-by: Nicholas Johnson <[email protected]> Tested-by: Nicholas Johnson <[email protected]> Reviewed-by: Edward Cree <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent a02e399 commit b167191

File tree

1 file changed

+11
-2
lines changed
  • drivers/net/wireless/intel/iwlwifi/pcie

1 file changed

+11
-2
lines changed

drivers/net/wireless/intel/iwlwifi/pcie/rx.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1421,6 +1421,7 @@ static struct iwl_rx_mem_buffer *iwl_pcie_get_rxb(struct iwl_trans *trans,
14211421
static void iwl_pcie_rx_handle(struct iwl_trans *trans, int queue)
14221422
{
14231423
struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
1424+
struct napi_struct *napi;
14241425
struct iwl_rxq *rxq;
14251426
u32 r, i, count = 0;
14261427
bool emergency = false;
@@ -1526,8 +1527,16 @@ static void iwl_pcie_rx_handle(struct iwl_trans *trans, int queue)
15261527
if (unlikely(emergency && count))
15271528
iwl_pcie_rxq_alloc_rbs(trans, GFP_ATOMIC, rxq);
15281529

1529-
if (rxq->napi.poll)
1530-
napi_gro_flush(&rxq->napi, false);
1530+
napi = &rxq->napi;
1531+
if (napi->poll) {
1532+
if (napi->rx_count) {
1533+
netif_receive_skb_list(&napi->rx_list);
1534+
INIT_LIST_HEAD(&napi->rx_list);
1535+
napi->rx_count = 0;
1536+
}
1537+
1538+
napi_gro_flush(napi, false);
1539+
}
15311540

15321541
iwl_pcie_rxq_restock(trans, rxq);
15331542
}

0 commit comments

Comments
 (0)