From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexander Duyck Subject: [iwl next-queue PATCH 06/10] macvlan: Add function to test for destination filtering support Date: Tue, 03 Apr 2018 17:16:25 -0400 Message-ID: <20180403211624.7880.72399.stgit@ahduyck-green-test.jf.intel.com> References: <20180403211519.7880.70243.stgit@ahduyck-green-test.jf.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org To: intel-wired-lan@lists.osuosl.org, jeffrey.t.kirsher@intel.com Return-path: Received: from mga09.intel.com ([134.134.136.24]:59802 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753398AbeDCVXB (ORCPT ); Tue, 3 Apr 2018 17:23:01 -0400 In-Reply-To: <20180403211519.7880.70243.stgit@ahduyck-green-test.jf.intel.com> Sender: netdev-owner@vger.kernel.org List-ID: 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 --- include/linux/if_macvlan.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/linux/if_macvlan.h b/include/linux/if_macvlan.h index 80089d6..0221390 100644 --- a/include/linux/if_macvlan.h +++ b/include/linux/if_macvlan.h @@ -88,4 +88,13 @@ static inline void *macvlan_accel_priv(struct net_device *dev) 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 */