Commit efacb309 authored by stephen hemminger's avatar stephen hemminger Committed by David S. Miller

rtnetlink & bonding: change args got get_tx_queues

Change get_tx_queues, drop unsused arg/return value real_tx_queues,
and use return by value (with error) rather than call by reference.

Probably bonding should just change to LLTX and the whole get_tx_queues
API could disappear!
Signed-off-by: default avatarStephen Hemminger <shemminger@vyatta.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 302846e3
...@@ -4820,12 +4820,9 @@ static int bond_validate(struct nlattr *tb[], struct nlattr *data[]) ...@@ -4820,12 +4820,9 @@ static int bond_validate(struct nlattr *tb[], struct nlattr *data[])
return 0; return 0;
} }
static int bond_get_tx_queues(struct net *net, struct nlattr *tb[], static int bond_get_tx_queues(struct net *net, const struct nlattr *tb[])
unsigned int *num_queues,
unsigned int *real_num_queues)
{ {
*num_queues = tx_queues; return tx_queues;
return 0;
} }
static struct rtnl_link_ops bond_link_ops __read_mostly = { static struct rtnl_link_ops bond_link_ops __read_mostly = {
......
...@@ -75,9 +75,8 @@ struct rtnl_link_ops { ...@@ -75,9 +75,8 @@ struct rtnl_link_ops {
size_t (*get_xstats_size)(const struct net_device *dev); size_t (*get_xstats_size)(const struct net_device *dev);
int (*fill_xstats)(struct sk_buff *skb, int (*fill_xstats)(struct sk_buff *skb,
const struct net_device *dev); const struct net_device *dev);
int (*get_tx_queues)(struct net *net, struct nlattr *tb[], int (*get_tx_queues)(struct net *net,
unsigned int *tx_queues, const struct nlattr *tb[]);
unsigned int *real_tx_queues);
}; };
extern int __rtnl_link_register(struct rtnl_link_ops *ops); extern int __rtnl_link_register(struct rtnl_link_ops *ops);
......
...@@ -1640,14 +1640,14 @@ struct net_device *rtnl_create_link(struct net *src_net, struct net *net, ...@@ -1640,14 +1640,14 @@ struct net_device *rtnl_create_link(struct net *src_net, struct net *net,
int err; int err;
struct net_device *dev; struct net_device *dev;
unsigned int num_queues = 1; unsigned int num_queues = 1;
unsigned int real_num_queues = 1;
if (ops->get_tx_queues) { if (ops->get_tx_queues) {
err = ops->get_tx_queues(src_net, tb, &num_queues, err = ops->get_tx_queues(src_net, tb);
&real_num_queues); if (err < 0)
if (err)
goto err; goto err;
num_queues = err;
} }
err = -ENOMEM; err = -ENOMEM;
dev = alloc_netdev_mq(ops->priv_size, ifname, ops->setup, num_queues); dev = alloc_netdev_mq(ops->priv_size, ifname, ops->setup, num_queues);
if (!dev) if (!dev)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment