From patchwork Fri Jun 10 16:48:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiaqing Zhao X-Patchwork-Id: 1642068 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=HbGGokao; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org (client-ip=112.213.38.117; helo=lists.ozlabs.org; envelope-from=openbmc-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org; receiver=) Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LKRp636mxz9s1l for ; Sat, 11 Jun 2022 02:52:14 +1000 (AEST) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4LKRp62260z3bqd for ; Sat, 11 Jun 2022 02:52:14 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=HbGGokao; dkim-atps=neutral X-Original-To: openbmc@lists.ozlabs.org Delivered-To: openbmc@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=linux.intel.com (client-ip=134.134.136.100; helo=mga07.intel.com; envelope-from=jiaqing.zhao@linux.intel.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=HbGGokao; dkim-atps=neutral Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4LKRln5x5Zz3bnT for ; Sat, 11 Jun 2022 02:50:13 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1654879814; x=1686415814; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=nS9jBzEdJm76RP0LAjTlMRfAbVC9/X57Mw2W3mH7Yrc=; b=HbGGokaomyWxHhqQBkyFgZqiaNVpbuzmLivb27TKuqMrzOhi0yVll7QF JswrVelz3bg7vKtEXhJQtHUDjDarTVmgQzbSNPBhBAF9CFRuUY8Awv6WX IIwV+/cKxIfzNAdnZulGkSgFw8jaIyVrbErR3UefKKFaM+5+BxkaITg77 vMdigtx9evVoMdgulh6bxViQ2EsOd/hB18ufMPKVaqasvcDvW4DBKtskL Et/hogwNfsKNH3BW+y5FR46nhc8G8PxF0csutrGlBAS4Vn5GtQkoRbdNs it7F0ztpSX0zBFS6FY4vqBqTPmVcpcNHj8iEzMxzyPeJYXhMM5yttQSx+ w==; X-IronPort-AV: E=McAfee;i="6400,9594,10374"; a="341739936" X-IronPort-AV: E=Sophos;i="5.91,290,1647327600"; d="scan'208";a="341739936" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jun 2022 09:49:57 -0700 X-IronPort-AV: E=Sophos;i="5.91,290,1647327600"; d="scan'208";a="760587716" Received: from unknown (HELO jiaqingz-server.sh.intel.com) ([10.239.48.171]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jun 2022 09:49:54 -0700 From: Jiaqing Zhao To: Samuel Mendoza-Jonas , "David S . Miller" , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, openbmc@lists.ozlabs.org Subject: [PATCH 3/6] net/ncsi: Enable VLAN filtering when callback is registered Date: Sat, 11 Jun 2022 00:48:05 +0800 Message-Id: <20220610164808.2323340-4-jiaqing.zhao@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220610164808.2323340-1-jiaqing.zhao@linux.intel.com> References: <20220610164808.2323340-1-jiaqing.zhao@linux.intel.com> MIME-Version: 1.0 X-BeenThere: openbmc@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development list for OpenBMC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jiaqing Zhao Errors-To: openbmc-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "openbmc" Sets NETIF_F_HW_VLAN_CTAG_FILTER flag to enable hardware VLAN filtering of NCSI when the ndo_vlan_rx_{add,kill}_vid callbacks are registered to the NCSI handlers. Previously it was done in the mac driver, this patch puts it to the NCSI drvier to make it more general. Signed-off-by: Jiaqing Zhao --- net/ncsi/ncsi-manage.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/net/ncsi/ncsi-manage.c b/net/ncsi/ncsi-manage.c index a8f7a2ff52a0..3fb95f29e3e2 100644 --- a/net/ncsi/ncsi-manage.c +++ b/net/ncsi/ncsi-manage.c @@ -1807,6 +1807,11 @@ struct ncsi_dev *ncsi_register_dev(struct net_device *dev, ndp->mlx_multi_host = true; } + /* Enable hardware VLAN filtering */ + if (dev->netdev_ops->ndo_vlan_rx_add_vid == ncsi_vlan_rx_add_vid && + dev->netdev_ops->ndo_vlan_rx_kill_vid == ncsi_vlan_rx_kill_vid) + dev->hw_features |= NETIF_F_HW_VLAN_CTAG_FILTER; + return nd; } EXPORT_SYMBOL_GPL(ncsi_register_dev);