From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
To: Jiri Pirko <jiri@resnulli.us>, netdev@vger.kernel.org
Cc: davem@davemloft.net, fubar@us.ibm.com, vfalico@redhat.com,
andy@greyhouse.net, sfeldma@cumulusnetworks.com,
stephen@networkplumber.org, vyasevic@redhat.com,
john.r.fastabend@intel.com
Subject: Re: [patch net-next 2/5] rtnetlink: put "BOND" into nl attribute names which are related to bonding
Date: Wed, 22 Jan 2014 16:57:15 +0100 [thread overview]
Message-ID: <52DFEA5B.2030707@6wind.com> (raw)
In-Reply-To: <1390377957-31466-3-git-send-email-jiri@resnulli.us>
Le 22/01/2014 09:05, Jiri Pirko a écrit :
> Signed-off-by: Jiri Pirko <jiri@resnulli.us>
You didn't tell it in the commit log, but you've also fix the API
to add the UNSPEC attribute (IFLA_BOND_SLAVE_UNSPEC), nice!
Acked-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
> ---
> drivers/net/bonding/bond_netlink.c | 12 ++++++------
> include/uapi/linux/if_link.h | 19 ++++++++++---------
> net/core/rtnetlink.c | 16 ++++++++--------
> 3 files changed, 24 insertions(+), 23 deletions(-)
>
> diff --git a/drivers/net/bonding/bond_netlink.c b/drivers/net/bonding/bond_netlink.c
> index 21c6488..dd786a3 100644
> --- a/drivers/net/bonding/bond_netlink.c
> +++ b/drivers/net/bonding/bond_netlink.c
> @@ -27,27 +27,27 @@ int bond_get_slave(struct net_device *slave_dev, struct sk_buff *skb)
> struct slave *slave = bond_slave_get_rtnl(slave_dev);
> const struct aggregator *agg;
>
> - if (nla_put_u8(skb, IFLA_SLAVE_STATE, bond_slave_state(slave)))
> + if (nla_put_u8(skb, IFLA_BOND_SLAVE_STATE, bond_slave_state(slave)))
> goto nla_put_failure;
>
> - if (nla_put_u8(skb, IFLA_SLAVE_MII_STATUS, slave->link))
> + if (nla_put_u8(skb, IFLA_BOND_SLAVE_MII_STATUS, slave->link))
> goto nla_put_failure;
>
> - if (nla_put_u32(skb, IFLA_SLAVE_LINK_FAILURE_COUNT,
> + if (nla_put_u32(skb, IFLA_BOND_SLAVE_LINK_FAILURE_COUNT,
> slave->link_failure_count))
> goto nla_put_failure;
>
> - if (nla_put(skb, IFLA_SLAVE_PERM_HWADDR,
> + if (nla_put(skb, IFLA_BOND_SLAVE_PERM_HWADDR,
> slave_dev->addr_len, slave->perm_hwaddr))
> goto nla_put_failure;
>
> - if (nla_put_u16(skb, IFLA_SLAVE_QUEUE_ID, slave->queue_id))
> + if (nla_put_u16(skb, IFLA_BOND_SLAVE_QUEUE_ID, slave->queue_id))
> goto nla_put_failure;
>
> if (slave->bond->params.mode == BOND_MODE_8023AD) {
> agg = SLAVE_AD_INFO(slave).port.aggregator;
> if (agg)
> - if (nla_put_u16(skb, IFLA_SLAVE_AD_AGGREGATOR_ID,
> + if (nla_put_u16(skb, IFLA_BOND_SLAVE_AD_AGGREGATOR_ID,
> agg->aggregator_identifier))
> goto nla_put_failure;
> }
> diff --git a/include/uapi/linux/if_link.h b/include/uapi/linux/if_link.h
> index ba2f3bf..1f30b85 100644
> --- a/include/uapi/linux/if_link.h
> +++ b/include/uapi/linux/if_link.h
> @@ -144,7 +144,7 @@ enum {
> IFLA_NUM_RX_QUEUES,
> IFLA_CARRIER,
> IFLA_PHYS_PORT_ID,
> - IFLA_SLAVE,
> + IFLA_BOND_SLAVE,
> __IFLA_MAX
> };
>
> @@ -370,16 +370,17 @@ enum {
> #define IFLA_BOND_AD_INFO_MAX (__IFLA_BOND_AD_INFO_MAX - 1)
>
> enum {
> - IFLA_SLAVE_STATE,
> - IFLA_SLAVE_MII_STATUS,
> - IFLA_SLAVE_LINK_FAILURE_COUNT,
> - IFLA_SLAVE_PERM_HWADDR,
> - IFLA_SLAVE_QUEUE_ID,
> - IFLA_SLAVE_AD_AGGREGATOR_ID,
> - __IFLA_SLAVE_MAX,
> + IFLA_BOND_SLAVE_UNSPEC,
> + IFLA_BOND_SLAVE_STATE,
> + IFLA_BOND_SLAVE_MII_STATUS,
> + IFLA_BOND_SLAVE_LINK_FAILURE_COUNT,
> + IFLA_BOND_SLAVE_PERM_HWADDR,
> + IFLA_BOND_SLAVE_QUEUE_ID,
> + IFLA_BOND_SLAVE_AD_AGGREGATOR_ID,
> + __IFLA_BOND_SLAVE_MAX,
> };
>
> -#define IFLA_SLAVE_MAX (__IFLA_SLAVE_MAX - 1)
> +#define IFLA_BOND_SLAVE_MAX (__IFLA_BOND_SLAVE_MAX - 1)
>
> /* SR-IOV virtual function management section */
>
> diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
> index 4f85de7..cace149 100644
> --- a/net/core/rtnetlink.c
> +++ b/net/core/rtnetlink.c
> @@ -725,13 +725,13 @@ static size_t rtnl_bond_slave_size(const struct net_device *dev)
> {
> struct net_device *bond;
> size_t slave_size =
> - nla_total_size(sizeof(struct nlattr)) + /* IFLA_SLAVE */
> - nla_total_size(1) + /* IFLA_SLAVE_STATE */
> - nla_total_size(1) + /* IFLA_SLAVE_MII_STATUS */
> - nla_total_size(4) + /* IFLA_SLAVE_LINK_FAILURE_COUNT */
> - nla_total_size(MAX_ADDR_LEN) + /* IFLA_SLAVE_PERM_HWADDR */
> - nla_total_size(2) + /* IFLA_SLAVE_QUEUE_ID */
> - nla_total_size(2) + /* IFLA_SLAVE_AD_AGGREGATOR_ID */
> + nla_total_size(sizeof(struct nlattr)) + /* IFLA_BOND_SLAVE */
> + nla_total_size(1) + /* IFLA_BOND_SLAVE_STATE */
> + nla_total_size(1) + /* IFLA_BOND_SLAVE_MII_STATUS */
> + nla_total_size(4) + /* IFLA_BOND_SLAVE_LINK_FAILURE_COUNT */
> + nla_total_size(MAX_ADDR_LEN) + /* IFLA_BOND_SLAVE_PERM_HWADDR */
> + nla_total_size(2) + /* IFLA_BOND_SLAVE_QUEUE_ID */
> + nla_total_size(2) + /* IFLA_BOND_SLAVE_AD_AGGREGATOR_ID */
> 0;
>
> if (netif_is_bond_slave((struct net_device *)dev)) {
> @@ -883,7 +883,7 @@ static size_t rtnl_bond_slave_fill(struct sk_buff *skb, struct net_device *dev)
> if (!bond || !bond->netdev_ops->ndo_get_slave)
> return 0;
>
> - nest = nla_nest_start(skb, IFLA_SLAVE);
> + nest = nla_nest_start(skb, IFLA_BOND_SLAVE);
> if (!nest)
> return -EMSGSIZE;
>
>
next prev parent reply other threads:[~2014-01-22 15:57 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-22 8:05 [patch net-next 0/5] fix bonding slave info API (sysfs and netlink) Jiri Pirko
2014-01-22 8:05 ` [patch net-next 1/5] bonding: change name of sysfs dir for bonding slaves Jiri Pirko
2014-01-22 8:05 ` [patch net-next 2/5] rtnetlink: put "BOND" into nl attribute names which are related to bonding Jiri Pirko
2014-01-22 15:57 ` Nicolas Dichtel [this message]
2014-01-22 8:05 ` [patch net-next 3/5] rtnetlink: provide api for getting and setting slave info Jiri Pirko
2014-01-22 8:05 ` [patch net-next 4/5] bonding: convert netlink to use slave data info api Jiri Pirko
2014-01-22 8:05 ` [patch net-next 5/5] rtnetlink: remove ndo_get_slave Jiri Pirko
2014-01-22 10:43 ` [patch net-next 6/6] rtnetlink: remove IFLA_SLAVES definition Jiri Pirko
2014-01-23 20:47 ` David Miller
2014-01-23 21:33 ` Jiri Pirko
2014-01-23 22:43 ` David Miller
2014-01-22 23:06 ` [patch net-next 0/5] fix bonding slave info API (sysfs and netlink) Scott Feldman
2014-01-23 5:58 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=52DFEA5B.2030707@6wind.com \
--to=nicolas.dichtel@6wind.com \
--cc=andy@greyhouse.net \
--cc=davem@davemloft.net \
--cc=fubar@us.ibm.com \
--cc=jiri@resnulli.us \
--cc=john.r.fastabend@intel.com \
--cc=netdev@vger.kernel.org \
--cc=sfeldma@cumulusnetworks.com \
--cc=stephen@networkplumber.org \
--cc=vfalico@redhat.com \
--cc=vyasevic@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.