bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH bpf] veth: store queue_mapping independently of XDP prog presence
@ 2021-03-03 15:29 Maciej Fijalkowski
  2021-03-05 14:50 ` Toshiaki Makita
  2021-03-05 23:10 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Maciej Fijalkowski @ 2021-03-03 15:29 UTC (permalink / raw)
  To: makita.toshiaki, daniel, ast, bpf, netdev
  Cc: bjorn.topel, magnus.karlsson, Maciej Fijalkowski

Currently, veth_xmit() would call the skb_record_rx_queue() only when
there is XDP program loaded on peer interface in native mode.

If peer has XDP prog in generic mode, then netif_receive_generic_xdp()
has a call to netif_get_rxqueue(skb), so for multi-queue veth it will
not be possible to grab a correct rxq.

To fix that, store queue_mapping independently of XDP prog presence on
peer interface.

Fixes: 638264dc9022 ("veth: Support per queue XDP ring")
Signed-off-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
---
 drivers/net/veth.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/veth.c b/drivers/net/veth.c
index aa1a66ad2ce5..34e49c75db42 100644
--- a/drivers/net/veth.c
+++ b/drivers/net/veth.c
@@ -302,8 +302,7 @@ static netdev_tx_t veth_xmit(struct sk_buff *skb, struct net_device *dev)
 	if (rxq < rcv->real_num_rx_queues) {
 		rq = &rcv_priv->rq[rxq];
 		rcv_xdp = rcu_access_pointer(rq->xdp_prog);
-		if (rcv_xdp)
-			skb_record_rx_queue(skb, rxq);
+		skb_record_rx_queue(skb, rxq);
 	}
 
 	skb_tx_timestamp(skb);
-- 
2.20.1


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

* Re: [PATCH bpf] veth: store queue_mapping independently of XDP prog presence
  2021-03-03 15:29 [PATCH bpf] veth: store queue_mapping independently of XDP prog presence Maciej Fijalkowski
@ 2021-03-05 14:50 ` Toshiaki Makita
  2021-03-05 23:10 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Toshiaki Makita @ 2021-03-05 14:50 UTC (permalink / raw)
  To: Maciej Fijalkowski, makita.toshiaki, daniel, ast, bpf, netdev
  Cc: bjorn.topel, magnus.karlsson

On 2021/03/04 0:29, Maciej Fijalkowski wrote:
> Currently, veth_xmit() would call the skb_record_rx_queue() only when
> there is XDP program loaded on peer interface in native mode.
> 
> If peer has XDP prog in generic mode, then netif_receive_generic_xdp()
> has a call to netif_get_rxqueue(skb), so for multi-queue veth it will
> not be possible to grab a correct rxq.
> 
> To fix that, store queue_mapping independently of XDP prog presence on
> peer interface.
> 
> Fixes: 638264dc9022 ("veth: Support per queue XDP ring")
> Signed-off-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>

I did like this in order to keep the default behavior for non-xdp case,
but generic XDP should behave the same as native XDP, so

Acked-by: Toshiaki Makita <toshiaki.makita1@gmail.com>

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

* Re: [PATCH bpf] veth: store queue_mapping independently of XDP prog presence
  2021-03-03 15:29 [PATCH bpf] veth: store queue_mapping independently of XDP prog presence Maciej Fijalkowski
  2021-03-05 14:50 ` Toshiaki Makita
@ 2021-03-05 23:10 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-03-05 23:10 UTC (permalink / raw)
  To: Maciej Fijalkowski
  Cc: makita.toshiaki, daniel, ast, bpf, netdev, bjorn.topel, magnus.karlsson

Hello:

This patch was applied to bpf/bpf.git (refs/heads/master):

On Wed,  3 Mar 2021 16:29:03 +0100 you wrote:
> Currently, veth_xmit() would call the skb_record_rx_queue() only when
> there is XDP program loaded on peer interface in native mode.
> 
> If peer has XDP prog in generic mode, then netif_receive_generic_xdp()
> has a call to netif_get_rxqueue(skb), so for multi-queue veth it will
> not be possible to grab a correct rxq.
> 
> [...]

Here is the summary with links:
  - [bpf] veth: store queue_mapping independently of XDP prog presence
    https://git.kernel.org/bpf/bpf/c/edbea9220251

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] 3+ messages in thread

end of thread, other threads:[~2021-03-05 23:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-03 15:29 [PATCH bpf] veth: store queue_mapping independently of XDP prog presence Maciej Fijalkowski
2021-03-05 14:50 ` Toshiaki Makita
2021-03-05 23:10 ` 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).