Blob Blame History Raw
From: Alexander Duyck <alexander.h.duyck@intel.com>
Date: Tue, 3 Apr 2018 17:16:30 -0400
Subject: macvlan: Provide function for interfaces to release HW offload
Patch-mainline: v4.18-rc1
Git-commit: 53cd4d8e4dfb231fa5ba125b6c0666b82a0504fa
References: bsc#1113994 FATE#326315 FATE#326317

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>
Acked-by: Thomas Bogendoerfer <tbogendoerfer@suse.de>
---
 include/linux/if_macvlan.h |    8 ++++++++
 1 file changed, 8 insertions(+)

--- a/include/linux/if_macvlan.h
+++ b/include/linux/if_macvlan.h
@@ -100,4 +100,12 @@ static inline bool macvlan_supports_dest
 	       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 */