* [patch net-next] bonding: add slave netlink policy and put slave-related ops together
@ 2014-09-05 9:36 Jiri Pirko
2014-09-05 10:21 ` Nikolay Aleksandrov
2014-09-06 4:44 ` David Miller
0 siblings, 2 replies; 3+ messages in thread
From: Jiri Pirko @ 2014-09-05 9:36 UTC (permalink / raw)
To: netdev; +Cc: davem, j.vosburgh, nikolay, vfalico, andy
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
---
drivers/net/bonding/bond_netlink.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/net/bonding/bond_netlink.c b/drivers/net/bonding/bond_netlink.c
index 1570dea..e1489d9 100644
--- a/drivers/net/bonding/bond_netlink.c
+++ b/drivers/net/bonding/bond_netlink.c
@@ -96,6 +96,10 @@ static const struct nla_policy bond_policy[IFLA_BOND_MAX + 1] = {
[IFLA_BOND_AD_INFO] = { .type = NLA_NESTED },
};
+static const struct nla_policy bond_slave_policy[IFLA_BOND_SLAVE_MAX + 1] = {
+ [IFLA_BOND_SLAVE_QUEUE_ID] = { .type = NLA_U16 },
+};
+
static int bond_validate(struct nlattr *tb[], struct nlattr *data[])
{
if (tb[IFLA_ADDRESS]) {
@@ -580,17 +584,18 @@ struct rtnl_link_ops bond_link_ops __read_mostly = {
.priv_size = sizeof(struct bonding),
.setup = bond_setup,
.maxtype = IFLA_BOND_MAX,
- .slave_maxtype = IFLA_BOND_SLAVE_MAX,
.policy = bond_policy,
.validate = bond_validate,
.newlink = bond_newlink,
.changelink = bond_changelink,
- .slave_changelink = bond_slave_changelink,
.get_size = bond_get_size,
.fill_info = bond_fill_info,
.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 */
+ .slave_maxtype = IFLA_BOND_SLAVE_MAX,
+ .slave_policy = bond_slave_policy,
+ .slave_changelink = bond_slave_changelink,
.get_slave_size = bond_get_slave_size,
.fill_slave_info = bond_fill_slave_info,
};
--
1.9.3
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [patch net-next] bonding: add slave netlink policy and put slave-related ops together
2014-09-05 9:36 [patch net-next] bonding: add slave netlink policy and put slave-related ops together Jiri Pirko
@ 2014-09-05 10:21 ` Nikolay Aleksandrov
2014-09-06 4:44 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: Nikolay Aleksandrov @ 2014-09-05 10:21 UTC (permalink / raw)
To: Jiri Pirko, netdev; +Cc: davem, j.vosburgh, vfalico, andy
On 05/09/14 11:36, Jiri Pirko wrote:
> Signed-off-by: Jiri Pirko <jiri@resnulli.us>
> ---
> drivers/net/bonding/bond_netlink.c | 9 +++++++--
> 1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/bonding/bond_netlink.c b/drivers/net/bonding/bond_netlink.c
> index 1570dea..e1489d9 100644
> --- a/drivers/net/bonding/bond_netlink.c
> +++ b/drivers/net/bonding/bond_netlink.c
> @@ -96,6 +96,10 @@ static const struct nla_policy bond_policy[IFLA_BOND_MAX + 1] = {
> [IFLA_BOND_AD_INFO] = { .type = NLA_NESTED },
> };
>
> +static const struct nla_policy bond_slave_policy[IFLA_BOND_SLAVE_MAX + 1] = {
> + [IFLA_BOND_SLAVE_QUEUE_ID] = { .type = NLA_U16 },
> +};
> +
> static int bond_validate(struct nlattr *tb[], struct nlattr *data[])
> {
> if (tb[IFLA_ADDRESS]) {
> @@ -580,17 +584,18 @@ struct rtnl_link_ops bond_link_ops __read_mostly = {
> .priv_size = sizeof(struct bonding),
> .setup = bond_setup,
> .maxtype = IFLA_BOND_MAX,
> - .slave_maxtype = IFLA_BOND_SLAVE_MAX,
> .policy = bond_policy,
> .validate = bond_validate,
> .newlink = bond_newlink,
> .changelink = bond_changelink,
> - .slave_changelink = bond_slave_changelink,
> .get_size = bond_get_size,
> .fill_info = bond_fill_info,
> .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 */
> + .slave_maxtype = IFLA_BOND_SLAVE_MAX,
> + .slave_policy = bond_slave_policy,
> + .slave_changelink = bond_slave_changelink,
> .get_slave_size = bond_get_slave_size,
> .fill_slave_info = bond_fill_slave_info,
> };
>
Right, the validation policy, I knew I forgot something :-)
Acked-by: Nikolay Aleksandrov <nikolay@redhat.com>
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [patch net-next] bonding: add slave netlink policy and put slave-related ops together
2014-09-05 9:36 [patch net-next] bonding: add slave netlink policy and put slave-related ops together Jiri Pirko
2014-09-05 10:21 ` Nikolay Aleksandrov
@ 2014-09-06 4:44 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2014-09-06 4:44 UTC (permalink / raw)
To: jiri; +Cc: netdev, j.vosburgh, nikolay, vfalico, andy
From: Jiri Pirko <jiri@resnulli.us>
Date: Fri, 5 Sep 2014 11:36:34 +0200
> Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Applied, thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-09-06 4:44 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-05 9:36 [patch net-next] bonding: add slave netlink policy and put slave-related ops together Jiri Pirko
2014-09-05 10:21 ` Nikolay Aleksandrov
2014-09-06 4:44 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).