Commit 5c34e022 authored by Scott Feldman's avatar Scott Feldman Committed by David S. Miller

switchdev: add new switchdev_port_bridge_dellink

Same change as setlink.  Provide the wrapper op for SELF ndo_bridge_dellink
and call into the switchdev driver to delete afspec VLANs.
Signed-off-by: default avatarScott Feldman <sfeldma@gmail.com>
Acked-by: default avatarJiri Pirko <jiri@resnulli.us>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 41c498b9
...@@ -164,6 +164,12 @@ static inline int switchdev_port_obj_del(struct net_device *dev, ...@@ -164,6 +164,12 @@ static inline int switchdev_port_obj_del(struct net_device *dev,
return -EOPNOTSUPP; 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) static inline int register_switchdev_notifier(struct notifier_block *nb)
{ {
return 0; return 0;
......
...@@ -512,27 +512,27 @@ int switchdev_port_bridge_setlink(struct net_device *dev, ...@@ -512,27 +512,27 @@ int switchdev_port_bridge_setlink(struct net_device *dev,
EXPORT_SYMBOL_GPL(switchdev_port_bridge_setlink); EXPORT_SYMBOL_GPL(switchdev_port_bridge_setlink);
/** /**
* switchdev_port_bridge_dellink - Notify switch device port of bridge * switchdev_port_bridge_dellink - Set bridge port attributes
* port attribute delete
* *
* @dev: port device * @dev: port device
* @nlh: netlink msg with bridge port attributes * @nlh: netlink header
* @flags: bridge setlink flags * @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, int switchdev_port_bridge_dellink(struct net_device *dev,
struct nlmsghdr *nlh, u16 flags) struct nlmsghdr *nlh, u16 flags)
{ {
const struct net_device_ops *ops = dev->netdev_ops; struct nlattr *afspec;
if (!(dev->features & NETIF_F_HW_SWITCH_OFFLOAD))
return 0;
if (!ops->ndo_bridge_dellink) afspec = nlmsg_find_attr(nlh, sizeof(struct ifinfomsg),
return -EOPNOTSUPP; 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); EXPORT_SYMBOL_GPL(switchdev_port_bridge_dellink);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment