Loading drivers/net/bonding/bond_main.c +8 −6 Original line number Diff line number Diff line Loading @@ -4845,7 +4845,7 @@ static int bond_validate(struct nlattr *tb[], struct nlattr *data[]) return 0; } static int bond_get_tx_queues(struct net *net, struct nlattr *tb[]) static unsigned int bond_get_num_tx_queues(void) { return tx_queues; } Loading @@ -4855,7 +4855,9 @@ static struct rtnl_link_ops bond_link_ops __read_mostly = { .priv_size = sizeof(struct bonding), .setup = bond_setup, .validate = bond_validate, .get_tx_queues = bond_get_tx_queues, .get_num_tx_queues = bond_get_num_tx_queues, .get_num_rx_queues = bond_get_num_tx_queues, /* Use the same number as for TX queues */ }; /* Create a new bond based on the specified name and bonding parameters. Loading include/net/rtnetlink.h +6 −4 Original line number Diff line number Diff line Loading @@ -44,8 +44,10 @@ static inline int rtnl_msg_family(const struct nlmsghdr *nlh) * @get_xstats_size: Function to calculate required room for dumping device * specific statistics * @fill_xstats: Function to dump device specific statistics * @get_tx_queues: Function to determine number of transmit queues to create when * creating a new device. * @get_num_tx_queues: Function to determine number of transmit queues * to create when creating a new device. * @get_num_rx_queues: Function to determine number of receive queues * to create when creating a new device. */ struct rtnl_link_ops { struct list_head list; Loading Loading @@ -77,8 +79,8 @@ struct rtnl_link_ops { size_t (*get_xstats_size)(const struct net_device *dev); int (*fill_xstats)(struct sk_buff *skb, const struct net_device *dev); int (*get_tx_queues)(struct net *net, struct nlattr *tb[]); unsigned int (*get_num_tx_queues)(void); unsigned int (*get_num_rx_queues)(void); }; extern int __rtnl_link_register(struct rtnl_link_ops *ops); Loading net/core/rtnetlink.c +8 −8 Original line number Diff line number Diff line Loading @@ -1624,17 +1624,17 @@ struct net_device *rtnl_create_link(struct net *src_net, struct net *net, { int err; struct net_device *dev; unsigned int num_queues = 1; unsigned int num_tx_queues = 1; unsigned int num_rx_queues = 1; if (ops->get_tx_queues) { err = ops->get_tx_queues(src_net, tb); if (err < 0) goto err; num_queues = err; } if (ops->get_num_tx_queues) num_tx_queues = ops->get_num_tx_queues(); if (ops->get_num_rx_queues) num_rx_queues = ops->get_num_rx_queues(); err = -ENOMEM; dev = alloc_netdev_mq(ops->priv_size, ifname, ops->setup, num_queues); dev = alloc_netdev_mqs(ops->priv_size, ifname, ops->setup, num_tx_queues, num_rx_queues); if (!dev) goto err; Loading Loading
drivers/net/bonding/bond_main.c +8 −6 Original line number Diff line number Diff line Loading @@ -4845,7 +4845,7 @@ static int bond_validate(struct nlattr *tb[], struct nlattr *data[]) return 0; } static int bond_get_tx_queues(struct net *net, struct nlattr *tb[]) static unsigned int bond_get_num_tx_queues(void) { return tx_queues; } Loading @@ -4855,7 +4855,9 @@ static struct rtnl_link_ops bond_link_ops __read_mostly = { .priv_size = sizeof(struct bonding), .setup = bond_setup, .validate = bond_validate, .get_tx_queues = bond_get_tx_queues, .get_num_tx_queues = bond_get_num_tx_queues, .get_num_rx_queues = bond_get_num_tx_queues, /* Use the same number as for TX queues */ }; /* Create a new bond based on the specified name and bonding parameters. Loading
include/net/rtnetlink.h +6 −4 Original line number Diff line number Diff line Loading @@ -44,8 +44,10 @@ static inline int rtnl_msg_family(const struct nlmsghdr *nlh) * @get_xstats_size: Function to calculate required room for dumping device * specific statistics * @fill_xstats: Function to dump device specific statistics * @get_tx_queues: Function to determine number of transmit queues to create when * creating a new device. * @get_num_tx_queues: Function to determine number of transmit queues * to create when creating a new device. * @get_num_rx_queues: Function to determine number of receive queues * to create when creating a new device. */ struct rtnl_link_ops { struct list_head list; Loading Loading @@ -77,8 +79,8 @@ struct rtnl_link_ops { size_t (*get_xstats_size)(const struct net_device *dev); int (*fill_xstats)(struct sk_buff *skb, const struct net_device *dev); int (*get_tx_queues)(struct net *net, struct nlattr *tb[]); unsigned int (*get_num_tx_queues)(void); unsigned int (*get_num_rx_queues)(void); }; extern int __rtnl_link_register(struct rtnl_link_ops *ops); Loading
net/core/rtnetlink.c +8 −8 Original line number Diff line number Diff line Loading @@ -1624,17 +1624,17 @@ struct net_device *rtnl_create_link(struct net *src_net, struct net *net, { int err; struct net_device *dev; unsigned int num_queues = 1; unsigned int num_tx_queues = 1; unsigned int num_rx_queues = 1; if (ops->get_tx_queues) { err = ops->get_tx_queues(src_net, tb); if (err < 0) goto err; num_queues = err; } if (ops->get_num_tx_queues) num_tx_queues = ops->get_num_tx_queues(); if (ops->get_num_rx_queues) num_rx_queues = ops->get_num_rx_queues(); err = -ENOMEM; dev = alloc_netdev_mq(ops->priv_size, ifname, ops->setup, num_queues); dev = alloc_netdev_mqs(ops->priv_size, ifname, ops->setup, num_tx_queues, num_rx_queues); if (!dev) goto err; Loading