diff options
author | Scott Feldman <sfeldma@gmail.com> | 2015-05-10 12:48:00 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-05-12 18:43:55 -0400 |
commit | 5c34e0221423aeabc0b085adc5fccda3f91e2c49 (patch) | |
tree | 41f6a10a4404930804b6602266a701a1dbfe420e /net/switchdev/switchdev.c | |
parent | 41c498b9359e360f08723b7605ec0c40926ec415 (diff) |
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: Scott Feldman <sfeldma@gmail.com>
Acked-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/switchdev/switchdev.c')
-rw-r--r-- | net/switchdev/switchdev.c | 24 |
1 files changed, 12 insertions, 12 deletions
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, | |||
512 | EXPORT_SYMBOL_GPL(switchdev_port_bridge_setlink); | 512 | EXPORT_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 | */ |
524 | int switchdev_port_bridge_dellink(struct net_device *dev, | 524 | int 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 | } |
537 | EXPORT_SYMBOL_GPL(switchdev_port_bridge_dellink); | 537 | EXPORT_SYMBOL_GPL(switchdev_port_bridge_dellink); |
538 | 538 | ||