]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
macvlan: Provide function for interfaces to release HW offload
authorAlexander Duyck <alexander.h.duyck@intel.com>
Tue, 3 Apr 2018 21:16:30 +0000 (17:16 -0400)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Wed, 25 Apr 2018 15:26:19 +0000 (08:26 -0700)
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 <alexander.h.duyck@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
include/linux/if_macvlan.h

index 0221390668a01c49d7386480cdf495aef5f4730e..2e55e4cdbd8aaf2fb6f1e9220ba2a8f3d6285de5 100644 (file)
@@ -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 */