From patchwork Tue Apr 3 21:16:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Duyck, Alexander H" X-Patchwork-Id: 894800 X-Patchwork-Delegate: jeffrey.t.kirsher@intel.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=osuosl.org (client-ip=140.211.166.136; helo=silver.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=intel.com Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40G2BK1Myyz9s0y for ; Wed, 4 Apr 2018 07:23:05 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 9D8A430AFB; Tue, 3 Apr 2018 21:23:03 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7iahuL3xHFag; Tue, 3 Apr 2018 21:23:03 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 128832E78D; Tue, 3 Apr 2018 21:23:03 +0000 (UTC) X-Original-To: intel-wired-lan@lists.osuosl.org Delivered-To: intel-wired-lan@lists.osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 87D5C1C039A for ; Tue, 3 Apr 2018 21:23:01 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 84FF8895CD for ; Tue, 3 Apr 2018 21:23:01 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id m4zeJHjMtiDx for ; Tue, 3 Apr 2018 21:23:01 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by whitealder.osuosl.org (Postfix) with ESMTPS id EFC31891BE for ; Tue, 3 Apr 2018 21:23:00 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Apr 2018 14:23:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,402,1517904000"; d="scan'208";a="39137792" Received: from ahduyck-green-test.jf.intel.com ([10.166.244.179]) by FMSMGA003.fm.intel.com with ESMTP; 03 Apr 2018 14:23:00 -0700 From: Alexander Duyck To: intel-wired-lan@lists.osuosl.org, jeffrey.t.kirsher@intel.com Date: Tue, 03 Apr 2018 17:16:25 -0400 Message-ID: <20180403211624.7880.72399.stgit@ahduyck-green-test.jf.intel.com> In-Reply-To: <20180403211519.7880.70243.stgit@ahduyck-green-test.jf.intel.com> References: <20180403211519.7880.70243.stgit@ahduyck-green-test.jf.intel.com> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Subject: [Intel-wired-lan] [iwl next-queue PATCH 06/10] macvlan: Add function to test for destination filtering support X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.24 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: netdev@vger.kernel.org Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" 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 Tested-by: Andrew Bowers --- 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 */