[patch net-next-2.6 0/2] bonding: create same number of queues on all creations

STALE5547d

4 messages, 2 authors, 2011-08-11 · open the first message on its own page

[patch net-next-2.6 0/2] bonding: create same number of queues on all creations

From: Jiri Pirko <hidden>
Date: 2011-08-10 16:10:13

When bonding device is created via /sys/class/net/bonding_masters,
correct number of queues is created. But if bonding device is created via rtnl,
default single queue is created. This little patchset makes it behaves the same.

Jiri Pirko (2):
  bonding: implement get_tx_queues rtnk_link_op
  rtnetlink: remove initialization of dev->real_num_tx_queues

 drivers/net/bonding/bond_main.c |    9 +++++++++
 net/core/rtnetlink.c            |    1 -
 2 files changed, 9 insertions(+), 1 deletions(-)

-- 
1.7.6

[patch net-next-2.6 1/2] bonding: implement get_tx_queues rtnk_link_op

From: Jiri Pirko <hidden>
Date: 2011-08-10 16:09:59

If vonding device is created via rtnl, it is created with default number
of rx/tx queues. This patch implements callback in bonding so the
correct value (previously specified by bonding module param) is used.

Signed-off-by: Jiri Pirko <redacted>
---
 drivers/net/bonding/bond_main.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 38a83ac..854aa8d 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -4828,11 +4828,20 @@ static int bond_validate(struct nlattr *tb[], struct nlattr *data[])
 	return 0;
 }
 
+static int bond_get_tx_queues(struct net *net, struct nlattr *tb[],
+			      unsigned int *num_queues,
+			      unsigned int *real_num_queues)
+{
+	*num_queues = tx_queues;
+	return 0;
+}
+
 static struct rtnl_link_ops bond_link_ops __read_mostly = {
 	.kind		= "bond",
 	.priv_size	= sizeof(struct bonding),
 	.setup		= bond_setup,
 	.validate	= bond_validate,
+	.get_tx_queues	= bond_get_tx_queues,
 };
 
 /* Create a new bond based on the specified name and bonding parameters.
-- 
1.7.6

[patch net-next-2.6 2/2] rtnetlink: remove initialization of dev->real_num_tx_queues

From: Jiri Pirko <hidden>
Date: 2011-08-10 16:10:17

dev->real_num_tx_queues is correctly set already in alloc_netdev_mqs.

Signed-off-by: Jiri Pirko <redacted>
---
 net/core/rtnetlink.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index 99d9e95..39f8dd6 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -1604,7 +1604,6 @@ struct net_device *rtnl_create_link(struct net *src_net, struct net *net,
 	dev_net_set(dev, net);
 	dev->rtnl_link_ops = ops;
 	dev->rtnl_link_state = RTNL_LINK_INITIALIZING;
-	dev->real_num_tx_queues = real_num_queues;
 
 	if (tb[IFLA_MTU])
 		dev->mtu = nla_get_u32(tb[IFLA_MTU]);
-- 
1.7.6

Re: [patch net-next-2.6 0/2] bonding: create same number of queues on all creations

From: David Miller <davem@davemloft.net>
Date: 2011-08-11 14:46:09

From: Jiri Pirko <redacted>
Date: Wed, 10 Aug 2011 18:09:43 +0200
When bonding device is created via /sys/class/net/bonding_masters,
correct number of queues is created. But if bonding device is created via rtnl,
default single queue is created. This little patchset makes it behaves the same.

Jiri Pirko (2):
  bonding: implement get_tx_queues rtnk_link_op
  rtnetlink: remove initialization of dev->real_num_tx_queues
Both applied, thanks Jiri.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help