diff options
| author | David S. Miller <davem@davemloft.net> | 2014-01-17 21:52:58 -0500 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2014-01-17 21:52:58 -0500 |
| commit | ff1a9d35a665a1507a9a31dbbf0f1eb2c08b1ef7 (patch) | |
| tree | 7d547bb8ba12b9417a8f0055a08f1026d6392cf2 /include | |
| parent | fd27e0d44a893b45832df3cb8e021bd1d773a73f (diff) | |
| parent | 1d3ee88ae0d605629bf369ab0b868dae8ca62a48 (diff) | |
Merge branch 'bonding_slave_sysfs'
Scott Feldman says:
====================
bonding: add slave netlink and sysfs support
v2:
- Address review comment from Ding (and Veacesiav): handle kobj cleanup
if sysfs_create_file() fails when adding slave attribute nodes.
v1:
The following series adds bonding slave netlink and sysfs interfaces.
Slave interfaces get a new IFLA_SLAVE set of netlink attributes, along
with RTM_NEWLINK notification when slave's active status changes. The
sysfs interface adds read-only nodes for slave attributes under a /slave
dir, simliar to how bond interfaces get a /bonding dir for bonding
attributes.
====================
Reviewed-by: Ding Tianhong <dingtianhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/netdevice.h | 5 | ||||
| -rw-r--r-- | include/uapi/linux/if_link.h | 13 |
2 files changed, 18 insertions, 0 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index e985231fe04b..83ce2aee65e6 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
| @@ -921,6 +921,9 @@ struct netdev_phys_port_id { | |||
| 921 | * int (*ndo_del_slave)(struct net_device *dev, struct net_device *slave_dev); | 921 | * int (*ndo_del_slave)(struct net_device *dev, struct net_device *slave_dev); |
| 922 | * Called to release previously enslaved netdev. | 922 | * Called to release previously enslaved netdev. |
| 923 | * | 923 | * |
| 924 | * int (*ndo_get_slave)(struct net_device *slave_dev, struct sk_buff *skb); | ||
| 925 | * Called to fill netlink skb with slave info. | ||
| 926 | * | ||
| 924 | * Feature/offload setting functions. | 927 | * Feature/offload setting functions. |
| 925 | * netdev_features_t (*ndo_fix_features)(struct net_device *dev, | 928 | * netdev_features_t (*ndo_fix_features)(struct net_device *dev, |
| 926 | * netdev_features_t features); | 929 | * netdev_features_t features); |
| @@ -1093,6 +1096,8 @@ struct net_device_ops { | |||
| 1093 | struct net_device *slave_dev); | 1096 | struct net_device *slave_dev); |
| 1094 | int (*ndo_del_slave)(struct net_device *dev, | 1097 | int (*ndo_del_slave)(struct net_device *dev, |
| 1095 | struct net_device *slave_dev); | 1098 | struct net_device *slave_dev); |
| 1099 | int (*ndo_get_slave)(struct net_device *slave_dev, | ||
| 1100 | struct sk_buff *skb); | ||
| 1096 | netdev_features_t (*ndo_fix_features)(struct net_device *dev, | 1101 | netdev_features_t (*ndo_fix_features)(struct net_device *dev, |
| 1097 | netdev_features_t features); | 1102 | netdev_features_t features); |
| 1098 | int (*ndo_set_features)(struct net_device *dev, | 1103 | int (*ndo_set_features)(struct net_device *dev, |
diff --git a/include/uapi/linux/if_link.h b/include/uapi/linux/if_link.h index 3e6bd3c7445d..ba2f3bf5fdf5 100644 --- a/include/uapi/linux/if_link.h +++ b/include/uapi/linux/if_link.h | |||
| @@ -144,6 +144,7 @@ enum { | |||
| 144 | IFLA_NUM_RX_QUEUES, | 144 | IFLA_NUM_RX_QUEUES, |
| 145 | IFLA_CARRIER, | 145 | IFLA_CARRIER, |
| 146 | IFLA_PHYS_PORT_ID, | 146 | IFLA_PHYS_PORT_ID, |
| 147 | IFLA_SLAVE, | ||
| 147 | __IFLA_MAX | 148 | __IFLA_MAX |
| 148 | }; | 149 | }; |
| 149 | 150 | ||
| @@ -368,6 +369,18 @@ enum { | |||
| 368 | 369 | ||
| 369 | #define IFLA_BOND_AD_INFO_MAX (__IFLA_BOND_AD_INFO_MAX - 1) | 370 | #define IFLA_BOND_AD_INFO_MAX (__IFLA_BOND_AD_INFO_MAX - 1) |
| 370 | 371 | ||
| 372 | enum { | ||
| 373 | IFLA_SLAVE_STATE, | ||
| 374 | IFLA_SLAVE_MII_STATUS, | ||
| 375 | IFLA_SLAVE_LINK_FAILURE_COUNT, | ||
| 376 | IFLA_SLAVE_PERM_HWADDR, | ||
| 377 | IFLA_SLAVE_QUEUE_ID, | ||
| 378 | IFLA_SLAVE_AD_AGGREGATOR_ID, | ||
| 379 | __IFLA_SLAVE_MAX, | ||
| 380 | }; | ||
| 381 | |||
| 382 | #define IFLA_SLAVE_MAX (__IFLA_SLAVE_MAX - 1) | ||
| 383 | |||
| 371 | /* SR-IOV virtual function management section */ | 384 | /* SR-IOV virtual function management section */ |
| 372 | 385 | ||
| 373 | enum { | 386 | enum { |
