aboutsummaryrefslogtreecommitdiffstats
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,
164 return -EOPNOTSUPP; 164 return -EOPNOTSUPP;
165} 165}
166 166
167static inline int switchdev_port_bridge_dellink(struct net_device *dev,
168 struct nlmsghdr *nlh, u16 flags)
169{
170 return -EOPNOTSUPP;
171}
172
167static inline int register_switchdev_notifier(struct notifier_block *nb) 173static inline int register_switchdev_notifier(struct notifier_block *nb)
168{ 174{
169 return 0; 175 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,
512EXPORT_SYMBOL_GPL(switchdev_port_bridge_setlink); 512EXPORT_SYMBOL_GPL(switchdev_port_bridge_setlink);
513 513
514/** 514/**
515 * switchdev_port_bridge_dellink - Notify switch device port of bridge 515 * switchdev_port_bridge_dellink - Set bridge port attributes
516 * port attribute delete
517 * 516 *
518 * @dev: port device 517 * @dev: port device
519 * @nlh: netlink msg with bridge port attributes 518 * @nlh: netlink header
520 * @flags: bridge setlink flags 519 * @flags: netlink flags
521 * 520 *
522 * Notify switch device port of bridge port attribute delete 521 * Called for SELF on rtnl_bridge_dellink to set bridge port
522 * attributes.
523 */ 523 */
524int switchdev_port_bridge_dellink(struct net_device *dev, 524int switchdev_port_bridge_dellink(struct net_device *dev,
525 struct nlmsghdr *nlh, u16 flags) 525 struct nlmsghdr *nlh, u16 flags)
526{ 526{
527 const struct net_device_ops *ops = dev->netdev_ops; 527 struct nlattr *afspec;
528
529 if (!(dev->features & NETIF_F_HW_SWITCH_OFFLOAD))
530 return 0;
531 528
532 if (!ops->ndo_bridge_dellink) 529 afspec = nlmsg_find_attr(nlh, sizeof(struct ifinfomsg),
533 return -EOPNOTSUPP; 530 IFLA_AF_SPEC);
531 if (afspec)
532 return switchdev_port_br_afspec(dev, afspec,
533 switchdev_port_obj_del);
534 534
535 return ops->ndo_bridge_dellink(dev, nlh, flags); 535 return 0;
536} 536}
537EXPORT_SYMBOL_GPL(switchdev_port_bridge_dellink); 537EXPORT_SYMBOL_GPL(switchdev_port_bridge_dellink);
538 538