diff options
author | Nikolay Aleksandrov <razor@blackwall.org> | 2015-06-14 16:36:34 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-06-15 16:40:24 -0700 |
commit | 254cb6dbfd8894743fbf814ec856ccd0874af691 (patch) | |
tree | 0cff7ca1cb547d3ce513d99b4aec11a3a9896ce4 /drivers/net/bonding/bond_sysfs_slave.c | |
parent | 4d367963ac0db8212545bad4ee9a44794fc1d667 (diff) | |
download | op-kernel-dev-254cb6dbfd8894743fbf814ec856ccd0874af691.zip op-kernel-dev-254cb6dbfd8894743fbf814ec856ccd0874af691.tar.gz |
bonding: export slave's actor_oper_port_state via sysfs and netlink
Export the actor_oper_port_state of each port via sysfs and netlink.
In 802.3ad mode it is valuable for the user to be able to check the
actor_oper state, it is already exported via bond's proc entry.
Signed-off-by: Nikolay Aleksandrov <razor@blackwall.org>
Signed-off-by: Andy Gospodarek <gospo@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bonding/bond_sysfs_slave.c')
-rw-r--r-- | drivers/net/bonding/bond_sysfs_slave.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/net/bonding/bond_sysfs_slave.c b/drivers/net/bonding/bond_sysfs_slave.c index 23618a8..f6c197c 100644 --- a/drivers/net/bonding/bond_sysfs_slave.c +++ b/drivers/net/bonding/bond_sysfs_slave.c @@ -80,6 +80,21 @@ static ssize_t ad_aggregator_id_show(struct slave *slave, char *buf) } static SLAVE_ATTR_RO(ad_aggregator_id); +static ssize_t ad_actor_oper_port_state_show(struct slave *slave, char *buf) +{ + const struct port *ad_port; + + if (BOND_MODE(slave->bond) == BOND_MODE_8023AD) { + ad_port = &SLAVE_AD_INFO(slave)->port; + if (ad_port->aggregator) + return sprintf(buf, "%u\n", + ad_port->actor_oper_port_state); + } + + return sprintf(buf, "N/A\n"); +} +static SLAVE_ATTR_RO(ad_actor_oper_port_state); + static const struct slave_attribute *slave_attrs[] = { &slave_attr_state, &slave_attr_mii_status, @@ -87,6 +102,7 @@ static const struct slave_attribute *slave_attrs[] = { &slave_attr_perm_hwaddr, &slave_attr_queue_id, &slave_attr_ad_aggregator_id, + &slave_attr_ad_actor_oper_port_state, NULL }; |