* [PATCH net-next] veth: use peer attributes to set peer real number of queues
@ 2026-10-16 16:03 Eric Dumazet
2026-10-17 3:41 ` Jason Xing
2026-10-20 19:00 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Eric Dumazet @ 2026-10-16 16:03 UTC (permalink / raw)
To: David S . Miller, Jakub Kicinski, Paolo Abeni
Cc: Simon Horman, netdev, Eric Dumazet, Qiliang Yuan
veth_newlink() creates the peer from its own attributes (tbp), which
come from the nested VETH_INFO_PEER ifinfomsg when present, so the
peer num_tx_queues/num_rx_queues follow the peer IFLA_NUM_TX_QUEUES
and IFLA_NUM_RX_QUEUES.
veth_init_queues(peer, ...) is then called with the attributes of
the first device (tb) instead, so the decision to reduce the peer to
a single real queue is based on the wrong device:
ip link add va type veth peer vb numtxqueues 4
-> vb has 4 tx queues, but only 1 real tx queue.
ip link add va numtxqueues 4 type veth peer vb
-> vb keeps nr_possible_cpus real tx queues.
Pass tbp, which is tb when no peer attributes were given.
Fixes: 9d3684c24a52 ("veth: create by default nr_possible_cpus queues")
Signed-off-by: Eric Dumazet <edumazet@kernel.org>
Cc: Qiliang Yuan <odys.yuan@gmail.com>
---
drivers/net/veth.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/veth.c b/drivers/net/veth.c
index 38f263d4f06b406eaf0a801334272cd438386c14..ba8953fef979aac3868d39c8fb9b19becb47d8e9 100644
--- a/drivers/net/veth.c
+++ b/drivers/net/veth.c
@@ -1924,7 +1924,7 @@ static int veth_newlink(struct net_device *dev,
priv = netdev_priv(peer);
rcu_assign_pointer(priv->peer, dev);
netdev_hold(dev, &priv->peer_tracker, GFP_KERNEL);
- err = veth_init_queues(peer, tb);
+ err = veth_init_queues(peer, tbp);
if (err)
goto err_peer_queues;
--
2.53.0
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH net-next] veth: use peer attributes to set peer real number of queues
2026-10-16 16:03 [PATCH net-next] veth: use peer attributes to set peer real number of queues Eric Dumazet
@ 2026-10-17 3:41 ` Jason Xing
2026-10-20 19:00 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Jason Xing @ 2026-10-17 3:41 UTC (permalink / raw)
To: Eric Dumazet
Cc: David S . Miller, Jakub Kicinski, Paolo Abeni, Simon Horman,
netdev, Qiliang Yuan
On Sat, Oct 17, 2026 at 12:07 AM Eric Dumazet <edumazet@kernel.org> wrote:
>
> veth_newlink() creates the peer from its own attributes (tbp), which
> come from the nested VETH_INFO_PEER ifinfomsg when present, so the
> peer num_tx_queues/num_rx_queues follow the peer IFLA_NUM_TX_QUEUES
> and IFLA_NUM_RX_QUEUES.
>
> veth_init_queues(peer, ...) is then called with the attributes of
> the first device (tb) instead, so the decision to reduce the peer to
> a single real queue is based on the wrong device:
>
> ip link add va type veth peer vb numtxqueues 4
> -> vb has 4 tx queues, but only 1 real tx queue.
>
> ip link add va numtxqueues 4 type veth peer vb
> -> vb keeps nr_possible_cpus real tx queues.
>
> Pass tbp, which is tb when no peer attributes were given.
>
> Fixes: 9d3684c24a52 ("veth: create by default nr_possible_cpus queues")
> Signed-off-by: Eric Dumazet <edumazet@kernel.org>
> Cc: Qiliang Yuan <odys.yuan@gmail.com>
Tested-by: Jason Xing <kerneljasonxing@gmail.com>
Reviewed-by: Jason Xing <kerneljasonxing@gmail.com>
Thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH net-next] veth: use peer attributes to set peer real number of queues
2026-10-16 16:03 [PATCH net-next] veth: use peer attributes to set peer real number of queues Eric Dumazet
2026-10-17 3:41 ` Jason Xing
@ 2026-10-20 19:00 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-10-20 19:00 UTC (permalink / raw)
To: Eric Dumazet; +Cc: davem, kuba, pabeni, horms, netdev, odys.yuan
Hello:
This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Fri, 16 Oct 2026 18:03:51 +0200 you wrote:
> veth_newlink() creates the peer from its own attributes (tbp), which
> come from the nested VETH_INFO_PEER ifinfomsg when present, so the
> peer num_tx_queues/num_rx_queues follow the peer IFLA_NUM_TX_QUEUES
> and IFLA_NUM_RX_QUEUES.
>
> veth_init_queues(peer, ...) is then called with the attributes of
> the first device (tb) instead, so the decision to reduce the peer to
> a single real queue is based on the wrong device:
>
> [...]
Here is the summary with links:
- [net-next] veth: use peer attributes to set peer real number of queues
https://git.kernel.org/netdev/net-next/c/267bc3f113d8
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:[~2026-10-20 19:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-16 16:03 [PATCH net-next] veth: use peer attributes to set peer real number of queues Eric Dumazet
2026-10-17 3:41 ` Jason Xing
2026-10-20 19:00 ` 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