Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue

Tony Nguyen says:

====================
Intel Wired LAN Driver Updates 2022-04-05

Maciej Fijalkowski says:

We were solving issues around AF_XDP busy poll's not-so-usual scenarios,
such as very big busy poll budgets applied to very small HW rings. This
set carries the things that were found during that work that apply to
net tree.

One thing that was fixed for all in-tree ZC drivers was missing on ice
side all the time - it's about syncing RCU before destroying XDP
resources. Next one fixes the bit that is checked in ice_xsk_wakeup and
third one avoids false setting of DD bits on Tx descriptors.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>

+9 -5
+1 -1
drivers/net/ethernet/intel/ice/ice.h
··· 671 671 672 672 static inline bool ice_is_xdp_ena_vsi(struct ice_vsi *vsi) 673 673 { 674 - return !!vsi->xdp_prog; 674 + return !!READ_ONCE(vsi->xdp_prog); 675 675 } 676 676 677 677 static inline void ice_set_ring_xdp(struct ice_tx_ring *ring)
+4 -2
drivers/net/ethernet/intel/ice/ice_main.c
··· 2562 2562 spin_lock_init(&xdp_ring->tx_lock); 2563 2563 for (j = 0; j < xdp_ring->count; j++) { 2564 2564 tx_desc = ICE_TX_DESC(xdp_ring, j); 2565 - tx_desc->cmd_type_offset_bsz = cpu_to_le64(ICE_TX_DESC_DTYPE_DESC_DONE); 2565 + tx_desc->cmd_type_offset_bsz = 0; 2566 2566 } 2567 2567 } 2568 2568 ··· 2758 2758 2759 2759 ice_for_each_xdp_txq(vsi, i) 2760 2760 if (vsi->xdp_rings[i]) { 2761 - if (vsi->xdp_rings[i]->desc) 2761 + if (vsi->xdp_rings[i]->desc) { 2762 + synchronize_rcu(); 2762 2763 ice_free_tx_ring(vsi->xdp_rings[i]); 2764 + } 2763 2765 kfree_rcu(vsi->xdp_rings[i], rcu); 2764 2766 vsi->xdp_rings[i] = NULL; 2765 2767 }
+4 -2
drivers/net/ethernet/intel/ice/ice_xsk.c
··· 41 41 static void ice_qp_clean_rings(struct ice_vsi *vsi, u16 q_idx) 42 42 { 43 43 ice_clean_tx_ring(vsi->tx_rings[q_idx]); 44 - if (ice_is_xdp_ena_vsi(vsi)) 44 + if (ice_is_xdp_ena_vsi(vsi)) { 45 + synchronize_rcu(); 45 46 ice_clean_tx_ring(vsi->xdp_rings[q_idx]); 47 + } 46 48 ice_clean_rx_ring(vsi->rx_rings[q_idx]); 47 49 } 48 50 ··· 920 918 struct ice_vsi *vsi = np->vsi; 921 919 struct ice_tx_ring *ring; 922 920 923 - if (test_bit(ICE_DOWN, vsi->state)) 921 + if (test_bit(ICE_VSI_DOWN, vsi->state)) 924 922 return -ENETDOWN; 925 923 926 924 if (!ice_is_xdp_ena_vsi(vsi))