Skip to content

Commit 74edbe9

Browse files
committed
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>
2 parents 8d90991 + e19778e commit 74edbe9

3 files changed

Lines changed: 9 additions & 5 deletions

File tree

drivers/net/ethernet/intel/ice/ice.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,7 @@ static inline struct ice_pf *ice_netdev_to_pf(struct net_device *netdev)
671671

672672
static inline bool ice_is_xdp_ena_vsi(struct ice_vsi *vsi)
673673
{
674-
return !!vsi->xdp_prog;
674+
return !!READ_ONCE(vsi->xdp_prog);
675675
}
676676

677677
static inline void ice_set_ring_xdp(struct ice_tx_ring *ring)

drivers/net/ethernet/intel/ice/ice_main.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2562,7 +2562,7 @@ static int ice_xdp_alloc_setup_rings(struct ice_vsi *vsi)
25622562
spin_lock_init(&xdp_ring->tx_lock);
25632563
for (j = 0; j < xdp_ring->count; j++) {
25642564
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;
25662566
}
25672567
}
25682568

@@ -2758,8 +2758,10 @@ int ice_destroy_xdp_rings(struct ice_vsi *vsi)
27582758

27592759
ice_for_each_xdp_txq(vsi, i)
27602760
if (vsi->xdp_rings[i]) {
2761-
if (vsi->xdp_rings[i]->desc)
2761+
if (vsi->xdp_rings[i]->desc) {
2762+
synchronize_rcu();
27622763
ice_free_tx_ring(vsi->xdp_rings[i]);
2764+
}
27632765
kfree_rcu(vsi->xdp_rings[i], rcu);
27642766
vsi->xdp_rings[i] = NULL;
27652767
}

drivers/net/ethernet/intel/ice/ice_xsk.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,10 @@ static void ice_qp_reset_stats(struct ice_vsi *vsi, u16 q_idx)
4141
static void ice_qp_clean_rings(struct ice_vsi *vsi, u16 q_idx)
4242
{
4343
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();
4546
ice_clean_tx_ring(vsi->xdp_rings[q_idx]);
47+
}
4648
ice_clean_rx_ring(vsi->rx_rings[q_idx]);
4749
}
4850

@@ -918,7 +920,7 @@ ice_xsk_wakeup(struct net_device *netdev, u32 queue_id,
918920
struct ice_vsi *vsi = np->vsi;
919921
struct ice_tx_ring *ring;
920922

921-
if (test_bit(ICE_DOWN, vsi->state))
923+
if (test_bit(ICE_VSI_DOWN, vsi->state))
922924
return -ENETDOWN;
923925

924926
if (!ice_is_xdp_ena_vsi(vsi))

0 commit comments

Comments
 (0)