veth: use peer attributes to set peer real number of queues
Subsystems (2)
Eric Dumazet
maintainerPATCH 1/1 veth: use peer attributes to set peer real number of queues
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.
--- drivers/net/veth.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/veth.c +1 -1
@@ -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;
Signature · 1 line
2.53.0
Quoted 13 lines · Eric Dumazet
veth_newlink()creates the peer from its own attributes (tbp), which come from the nestedVETH_INFO_PEERifinfomsg when present, so the peer num_tx_queues/num_rx_queues follow the peerIFLA_NUM_TX_QUEUESandIFLA_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.
Quoted 8 lines
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 <[email protected]>Cc Qiliang Yuan <[email protected]>
Thanks.
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Quoted 10 lines · 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 nestedVETH_INFO_PEERifinfomsg when present, so the peer num_tx_queues/num_rx_queues follow the peerIFLA_NUM_TX_QUEUESandIFLA_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!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html