summaryrefslogtreecommitdiffstats
path: root/include/net/switchdev.h
diff options
context:
space:
mode:
authorScott Feldman <sfeldma@gmail.com>2015-05-10 09:47:51 -0700
committerDavid S. Miller <davem@davemloft.net>2015-05-12 18:43:53 -0400
commit3563606258cf3b8f02eabddb1cb45a94c44d9611 (patch)
treee8c03f3d9274f5dac86490342f9f46016e660113 /include/net/switchdev.h
parentc4f20321d9680760a291991d77bc5b6d0eb2ed78 (diff)
downloadop-kernel-dev-3563606258cf3b8f02eabddb1cb45a94c44d9611.zip
op-kernel-dev-3563606258cf3b8f02eabddb1cb45a94c44d9611.tar.gz
switchdev: convert STP update to switchdev attr set
STP update is just a settable port attribute, so convert switchdev_port_stp_update to an attr set. For DSA, the prepare phase is skipped and STP updates are only done in the commit phase. This is because currently the DSA drivers don't need to allocate any memory for STP updates and the STP update will not fail to HW (unless something horrible goes wrong on the MDIO bus, in which case the prepare phase wouldn't have been able to predict anyway). Signed-off-by: Scott Feldman <sfeldma@gmail.com> Acked-by: Jiri Pirko <jiri@resnulli.us> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/switchdev.h')
-rw-r--r--include/net/switchdev.h13
1 files changed, 2 insertions, 11 deletions
diff --git a/include/net/switchdev.h b/include/net/switchdev.h
index 93316e7..aec5e49 100644
--- a/include/net/switchdev.h
+++ b/include/net/switchdev.h
@@ -26,6 +26,7 @@ enum switchdev_trans {
enum switchdev_attr_id {
SWITCHDEV_ATTR_UNDEFINED,
SWITCHDEV_ATTR_PORT_PARENT_ID,
+ SWITCHDEV_ATTR_PORT_STP_STATE,
};
struct switchdev_attr {
@@ -34,6 +35,7 @@ struct switchdev_attr {
u32 flags;
union {
struct netdev_phys_item_id ppid; /* PORT_PARENT_ID */
+ u8 stp_state; /* PORT_STP_STATE */
};
};
@@ -46,9 +48,6 @@ struct fib_info;
*
* @switchdev_port_attr_set: Set a port attribute (see switchdev_attr).
*
- * @switchdev_port_stp_update: Called to notify switch device port of bridge
- * port STP state change.
- *
* @switchdev_fib_ipv4_add: Called to add/modify IPv4 route to switch device.
*
* @switchdev_fib_ipv4_del: Called to delete IPv4 route from switch device.
@@ -58,7 +57,6 @@ struct switchdev_ops {
struct switchdev_attr *attr);
int (*switchdev_port_attr_set)(struct net_device *dev,
struct switchdev_attr *attr);
- int (*switchdev_port_stp_update)(struct net_device *dev, u8 state);
int (*switchdev_fib_ipv4_add)(struct net_device *dev, __be32 dst,
int dst_len, struct fib_info *fi,
u8 tos, u8 type, u32 nlflags,
@@ -95,7 +93,6 @@ int switchdev_port_attr_get(struct net_device *dev,
struct switchdev_attr *attr);
int switchdev_port_attr_set(struct net_device *dev,
struct switchdev_attr *attr);
-int switchdev_port_stp_update(struct net_device *dev, u8 state);
int register_switchdev_notifier(struct notifier_block *nb);
int unregister_switchdev_notifier(struct notifier_block *nb);
int call_switchdev_notifiers(unsigned long val, struct net_device *dev,
@@ -128,12 +125,6 @@ static inline int switchdev_port_attr_set(struct net_device *dev,
return -EOPNOTSUPP;
}
-static inline int switchdev_port_stp_update(struct net_device *dev,
- u8 state)
-{
- return -EOPNOTSUPP;
-}
-
static inline int register_switchdev_notifier(struct notifier_block *nb)
{
return 0;
OpenPOWER on IntegriCloud