diff options
author | Alexander Duyck <[email protected]> | 2018-04-03 17:16:30 -0400 |
---|---|---|
committer | Jeff Kirsher <[email protected]> | 2018-04-25 08:26:19 -0700 |
commit | 53cd4d8e4dfb231fa5ba125b6c0666b82a0504fa (patch) | |
tree | 1e519620f99f0315fc09f9b179f7609e4f28e2e2 | |
parent | 6cb1937d4eff6936089139169377fda208a2701a (diff) |
macvlan: Provide function for interfaces to release HW offload
This patch provides a basic function to allow a lower device to disable
macvlan offload if it was previously enabled on a given macvlan. The idea
here is to allow for recovery from failure should the lowerdev run out of
resources.
Signed-off-by: Alexander Duyck <[email protected]>
Tested-by: Andrew Bowers <[email protected]>
Signed-off-by: Jeff Kirsher <[email protected]>
-rw-r--r-- | include/linux/if_macvlan.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/if_macvlan.h b/include/linux/if_macvlan.h index 0221390668a0..2e55e4cdbd8a 100644 --- a/include/linux/if_macvlan.h +++ b/include/linux/if_macvlan.h @@ -97,4 +97,12 @@ static inline bool macvlan_supports_dest_filter(struct net_device *dev) macvlan->mode == MACVLAN_MODE_VEPA || macvlan->mode == MACVLAN_MODE_BRIDGE; } + +static inline int macvlan_release_l2fw_offload(struct net_device *dev) +{ + struct macvlan_dev *macvlan = netdev_priv(dev); + + macvlan->accel_priv = NULL; + return dev_uc_add(macvlan->lowerdev, dev->dev_addr); +} #endif /* _LINUX_IF_MACVLAN_H */ |