netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] ice: Fix ice_xdp_xmit() when XDP TX queue number is not sufficient
@ 2022-09-19 13:43 Larysa Zaremba
  2022-09-22  1:30 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Larysa Zaremba @ 2022-09-19 13:43 UTC (permalink / raw)
  To: intel-wired-lan
  Cc: Jesse Brandeburg, Tony Nguyen, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Alexei Starovoitov, Daniel Borkmann,
	Maciej Fijalkowski, netdev, linux-kernel, bpf, Larysa Zaremba,
	Alexander Lobakin

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: 22bf877e528f ("ice: introduce XDP_TX fallback path")
Signed-off-by: Larysa Zaremba <larysa.zaremba@intel.com>
Reviewed-by: Alexander Lobakin <alexandr.lobakin@intel.com>
---
 drivers/net/ethernet/intel/ice/ice_txrx.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/ice/ice_txrx.c b/drivers/net/ethernet/intel/ice/ice_txrx.c
index 42b42f4b21ef..a5a0c9706b5a 100644
--- a/drivers/net/ethernet/intel/ice/ice_txrx.c
+++ b/drivers/net/ethernet/intel/ice/ice_txrx.c
@@ -610,7 +610,7 @@ ice_xdp_xmit(struct net_device *dev, int n, struct xdp_frame **frames,
 	if (test_bit(ICE_VSI_DOWN, vsi->state))
 		return -ENETDOWN;
 
-	if (!ice_is_xdp_ena_vsi(vsi) || queue_index >= vsi->num_xdp_txq)
+	if (!ice_is_xdp_ena_vsi(vsi))
 		return -ENXIO;
 
 	if (unlikely(flags & ~XDP_XMIT_FLAGS_MASK))
@@ -621,6 +621,9 @@ ice_xdp_xmit(struct net_device *dev, int n, struct xdp_frame **frames,
 		xdp_ring = vsi->xdp_rings[queue_index];
 		spin_lock(&xdp_ring->tx_lock);
 	} else {
+		/* Generally, should not happen */
+		if (unlikely(queue_index >= vsi->num_xdp_txq))
+			return -ENXIO;
 		xdp_ring = vsi->xdp_rings[queue_index];
 	}
 
-- 
2.35.3


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net] ice: Fix ice_xdp_xmit() when XDP TX queue number is not sufficient
  2022-09-19 13:43 [PATCH net] ice: Fix ice_xdp_xmit() when XDP TX queue number is not sufficient Larysa Zaremba
@ 2022-09-22  1:30 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-09-22  1:30 UTC (permalink / raw)
  To: Larysa Zaremba
  Cc: intel-wired-lan, jesse.brandeburg, anthony.l.nguyen, davem,
	edumazet, kuba, pabeni, ast, daniel, maciej.fijalkowski, netdev,
	linux-kernel, bpf, alexandr.lobakin

Hello:

This patch was applied to netdev/net.git (master)
by Jakub Kicinski <kuba@kernel.org>:

On Mon, 19 Sep 2022 15:43:46 +0200 you wrote:
> 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.
> 
> [...]

Here is the summary with links:
  - [net] ice: Fix ice_xdp_xmit() when XDP TX queue number is not sufficient
    https://git.kernel.org/netdev/net/c/114f398d48c5

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-09-22  1:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-19 13:43 [PATCH net] ice: Fix ice_xdp_xmit() when XDP TX queue number is not sufficient Larysa Zaremba
2022-09-22  1:30 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).