Blob Blame History Raw
From: Alexander Duyck <alexander.h.duyck@intel.com>
Date: Tue, 3 Apr 2018 17:16:25 -0400
Subject: macvlan: Add function to test for destination filtering support
Patch-mainline: v4.18-rc1
Git-commit: 6cb1937d4eff6936089139169377fda208a2701a
References: bsc#1113994 FATE#326315 FATE#326317

This patch adds a function indicating if a given macvlan can fully supports
destination filtering, especially as it relates to unicast traffic. For
those macvlan interfaces that do not support destination filtering such
passthru or source mode filtering we should not be enabling offload
support.

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 |    9 +++++++++
 1 file changed, 9 insertions(+)

--- a/include/linux/if_macvlan.h
+++ b/include/linux/if_macvlan.h
@@ -91,4 +91,13 @@ static inline void *macvlan_accel_priv(s
 
 	return macvlan->accel_priv;
 }
+
+static inline bool macvlan_supports_dest_filter(struct net_device *dev)
+{
+	struct macvlan_dev *macvlan = netdev_priv(dev);
+
+	return macvlan->mode == MACVLAN_MODE_PRIVATE ||
+	       macvlan->mode == MACVLAN_MODE_VEPA ||
+	       macvlan->mode == MACVLAN_MODE_BRIDGE;
+}
 #endif /* _LINUX_IF_MACVLAN_H */