Skip to content

Commit 114f398

Browse files
walking-machinekuba-moo
authored andcommitted
ice: Fix ice_xdp_xmit() when XDP TX queue number is not sufficient
The original patch added the static branch to handle the situation, when assigning an XDP TX queue to every CPU is not possible, so they have to be shared. However, in the XDP transmit handler ice_xdp_xmit(), an error was returned in such cases even before static condition was checked, thus making queue sharing still impossible. Fixes: 22bf877 ("ice: introduce XDP_TX fallback path") Signed-off-by: Larysa Zaremba <[email protected]> Reviewed-by: Alexander Lobakin <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent f64780e commit 114f398

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,7 @@ ice_xdp_xmit(struct net_device *dev, int n, struct xdp_frame **frames,
610610
if (test_bit(ICE_VSI_DOWN, vsi->state))
611611
return -ENETDOWN;
612612

613-
if (!ice_is_xdp_ena_vsi(vsi) || queue_index >= vsi->num_xdp_txq)
613+
if (!ice_is_xdp_ena_vsi(vsi))
614614
return -ENXIO;
615615

616616
if (unlikely(flags & ~XDP_XMIT_FLAGS_MASK))
@@ -621,6 +621,9 @@ ice_xdp_xmit(struct net_device *dev, int n, struct xdp_frame **frames,
621621
xdp_ring = vsi->xdp_rings[queue_index];
622622
spin_lock(&xdp_ring->tx_lock);
623623
} else {
624+
/* Generally, should not happen */
625+
if (unlikely(queue_index >= vsi->num_xdp_txq))
626+
return -ENXIO;
624627
xdp_ring = vsi->xdp_rings[queue_index];
625628
}
626629

0 commit comments

Comments
 (0)