summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/net/switchdev.h6
-rw-r--r--net/switchdev/switchdev.c24
2 files changed, 18 insertions, 12 deletions
diff --git a/include/net/switchdev.h b/include/net/switchdev.h
index ce5ceb2dc677..8ffadca9e760 100644
--- a/include/net/switchdev.h
+++ b/include/net/switchdev.h
@@ -164,6 +164,12 @@ static inline int switchdev_port_obj_del(struct net_device *dev,
return -EOPNOTSUPP;
}
+static inline int switchdev_port_bridge_dellink(struct net_device *dev,
+ struct nlmsghdr *nlh, u16 flags)
+{
+ return -EOPNOTSUPP;
+}
+
static inline int register_switchdev_notifier(struct notifier_block *nb)
{
return 0;
diff --git a/net/switchdev/switchdev.c b/net/switchdev/switchdev.c
index dcdec9de9137..8ce678e397b4 100644
--- a/net/switchdev/switchdev.c
+++ b/net/switchdev/switchdev.c
@@ -512,27 +512,27 @@ int switchdev_port_bridge_setlink(struct net_device *dev,
EXPORT_SYMBOL_GPL(switchdev_port_bridge_setlink);
/**
- * switchdev_port_bridge_dellink - Notify switch device port of bridge
- * port attribute delete
+ * switchdev_port_bridge_dellink - Set bridge port attributes
*
* @dev: port device
- * @nlh: netlink msg with bridge port attributes
- * @flags: bridge setlink flags
+ * @nlh: netlink header
+ * @flags: netlink flags
*
- * Notify switch device port of bridge port attribute delete
+ * Called for SELF on rtnl_bridge_dellink to set bridge port
+ * attributes.
*/
int switchdev_port_bridge_dellink(struct net_device *dev,
struct nlmsghdr *nlh, u16 flags)
{
- const struct net_device_ops *ops = dev->netdev_ops;
-
- if (!(dev->features & NETIF_F_HW_SWITCH_OFFLOAD))
- return 0;
+ struct nlattr *afspec;
- if (!ops->ndo_bridge_dellink)
- return -EOPNOTSUPP;
+ afspec = nlmsg_find_attr(nlh, sizeof(struct ifinfomsg),
+ IFLA_AF_SPEC);
+ if (afspec)
+ return switchdev_port_br_afspec(dev, afspec,
+ switchdev_port_obj_del);
- return ops->ndo_bridge_dellink(dev, nlh, flags);
+ return 0;
}
EXPORT_SYMBOL_GPL(switchdev_port_bridge_dellink);