Thread (3 messages) 3 messages, 2 authors, 3d ago

[PATCH net] veth: decide peer queue count from the peer's own attributes

flat view
WARM3d

From: lirongqing <hidden>
Date: 2026-10-14 01:36:38
Also in: lkml
Subsystem: networking drivers, the rest · Maintainers: Andrew Lunn, "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds

From: Li RongQing <redacted>

veth_newlink() creates the peer netdev from tbp, which points at the
nested VETH_INFO_PEER attributes when they are supplied (peer_tb) and
only aliases the primary device's tb otherwise. However the queue
reduction is gated on the primary device's attributes:

	err = veth_init_queues(peer, tb);

veth_init_queues() checks !tb[IFLA_NUM_{TX,RX}_QUEUES], so for the peer
it inspects the wrong attribute set whenever nested peer attributes are
used:

 - If the user requests IFLA_NUM_TX/RX_QUEUES only for the peer, tb
   carries no such attribute and veth_init_queues() still shrinks the
   peer's real_num_{tx,rx}_queues back to 1, silently dropping the
   user's explicit multi-queue request for the peer.

 - If the user requests the counts only for the primary device, the
   peer keeps nr_possible_cpus real queues instead of the legacy
   default of 1.

Pass tbp so the peer's queue count is decided from the peer's own
attributes. When no nested peer attributes are given tbp aliases tb, so
the common case is unchanged.

Fixes: 9d3684c24a52 ("veth: create by default nr_possible_cpus queues")
Signed-off-by: Li RongQing <redacted>
---
 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 643b97d..07b738d 100644
--- a/drivers/net/veth.c
+++ b/drivers/net/veth.c
@@ -1919,7 +1919,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.9.4
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help