From nobody Mon Apr 27 16:11:16 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CA77BC433EF for ; Fri, 10 Jun 2022 16:47:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349798AbiFJQrz (ORCPT ); Fri, 10 Jun 2022 12:47:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37156 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245336AbiFJQrs (ORCPT ); Fri, 10 Jun 2022 12:47:48 -0400 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3EB25AE27F; Fri, 10 Jun 2022 09:47:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1654879667; x=1686415667; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=SoQbox9LXcyX3/Opr6a2M/n8V2iom3/0Vp+el7IRj5A=; b=BoAvxnnXjQI9aKwZHrgQm0mT6i95+DGgjhG9VD0Uhkrmmh861CiLdS0Y rlDdD3qKMNeNp3S1Eo3RDBLtaD1HpAOdq3oBL/WZj+sPxTP4w1njDpyV1 ObyjM+uRwISl9Dd9mbIWOFoEaN4z8mE5UuKKOnfPg3ScAL+Xz9LCeCUFw h+wol9Z1fUad3woIyiR+cXIp0MDml5qGrn/3fonNdLlCFmZ+fFdiIbmc8 tAcxbmHWR2IEylYGvfMm3ngT3lDpQUSdjVzDH2byNV/4pB4enhiVaZbPc GnWEM6AziZWFHvY9Ts0zHf3MW/BSuNYfOsBF2fzTfzRzt0VOM8r3j2Brj w==; X-IronPort-AV: E=McAfee;i="6400,9594,10374"; a="275209606" X-IronPort-AV: E=Sophos;i="5.91,290,1647327600"; d="scan'208";a="275209606" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jun 2022 09:47:46 -0700 X-IronPort-AV: E=Sophos;i="5.91,290,1647327600"; d="scan'208";a="638211027" Received: from unknown (HELO jiaqingz-server.sh.intel.com) ([10.239.48.171]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jun 2022 09:47:44 -0700 From: Jiaqing Zhao To: Samuel Mendoza-Jonas , "David S . Miller" , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jiaqing Zhao Subject: [PATCH 1/6] net/ncsi: Fix value of NCSI_CAP_VLAN_ANY Date: Sat, 11 Jun 2022 00:45:50 +0800 Message-Id: <20220610164555.2322930-2-jiaqing.zhao@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220610164555.2322930-1-jiaqing.zhao@linux.intel.com> References: <20220610164555.2322930-1-jiaqing.zhao@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" According to the NCSI specification (DSP0222) [1], the value of allow Any VLAN + non-VLAN mode in Enable VLAN command should be 0x03. [1] https://www.dmtf.org/sites/default/files/standards/documents/DSP0222_1.= 0.0.pdf Signed-off-by: Jiaqing Zhao --- net/ncsi/internal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ncsi/internal.h b/net/ncsi/internal.h index 03757e76bb6b..bc4a00e41695 100644 --- a/net/ncsi/internal.h +++ b/net/ncsi/internal.h @@ -47,7 +47,7 @@ enum { NCSI_CAP_AEN_MASK =3D 0x07, NCSI_CAP_VLAN_ONLY =3D 0x01, /* Filter VLAN packet only */ NCSI_CAP_VLAN_NO =3D 0x02, /* Filter VLAN and non-VLAN */ - NCSI_CAP_VLAN_ANY =3D 0x04, /* Filter Any-and-non-VLAN */ + NCSI_CAP_VLAN_ANY =3D 0x03, /* Filter Any-and-non-VLAN */ NCSI_CAP_VLAN_MASK =3D 0x07 }; =20 --=20 2.34.1 From nobody Mon Apr 27 16:11:16 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 99568C433EF for ; Fri, 10 Jun 2022 16:48:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349808AbiFJQsA (ORCPT ); Fri, 10 Jun 2022 12:48:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37244 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349710AbiFJQrs (ORCPT ); Fri, 10 Jun 2022 12:47:48 -0400 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1508EAEE31; Fri, 10 Jun 2022 09:47:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1654879668; x=1686415668; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=n2DHPKG6LELctv9GPHh5MdlgXeZF+xfpjUKtxgbPNOI=; b=kU2AOKfUv/2XiZ7EOY5GA5cGSO3mtQ/tbKrl1EsdZ2guwZzyP2H3PMxO kowQ3/z4C9ddhTi94cYOUi/t4yHyZtLuTW1/T6vMe6I5hH3cJCL+7p4gN hVc8KS97m/CCBtb63zTek2M39iEsvsoMCFjZ7/dpkFTCywtIMixYYNcTx 443+CeeUTI/UJ9mSYRUZrtsJJR8sBGBXdxnfBm85ndLvTy81PiRKEVzce 7AHQwqxK1/Qsu+8JKVArfRoUX5dyQ38pxdoum2Xlf5eE+GO5FAKqmzJiI e3GquxJ/1MTfcqp2WAuTwj7KN1rhBmADl5F0BNQb3kVtO9WckxL/ezhUC w==; X-IronPort-AV: E=McAfee;i="6400,9594,10374"; a="275209613" X-IronPort-AV: E=Sophos;i="5.91,290,1647327600"; d="scan'208";a="275209613" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jun 2022 09:47:47 -0700 X-IronPort-AV: E=Sophos;i="5.91,290,1647327600"; d="scan'208";a="638211031" Received: from unknown (HELO jiaqingz-server.sh.intel.com) ([10.239.48.171]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jun 2022 09:47:46 -0700 From: Jiaqing Zhao To: Samuel Mendoza-Jonas , "David S . Miller" , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jiaqing Zhao Subject: [PATCH 2/6] net/ncsi: Rename NCSI_CAP_VLAN_NO to NCSI_CAP_VLAN_FILTERED Date: Sat, 11 Jun 2022 00:45:51 +0800 Message-Id: <20220610164555.2322930-3-jiaqing.zhao@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220610164555.2322930-1-jiaqing.zhao@linux.intel.com> References: <20220610164555.2322930-1-jiaqing.zhao@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" The NCSI_CAP_VLAN_NO actually stands for the "VLAN + non-VLAN" mode defined in NCSI spec, which accepts both VLAN-tagged packets that match the enabled VLAN filter settings and non-VLAN-tagged packets. It would be more clear to rename it to NCSI_CAP_VLAN_FILTERED. Signed-off-by: Jiaqing Zhao --- net/ncsi/internal.h | 2 +- net/ncsi/ncsi-manage.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/net/ncsi/internal.h b/net/ncsi/internal.h index bc4a00e41695..7f384f841019 100644 --- a/net/ncsi/internal.h +++ b/net/ncsi/internal.h @@ -46,7 +46,7 @@ enum { NCSI_CAP_AEN_HDS =3D 0x04, /* HNC driver status */ NCSI_CAP_AEN_MASK =3D 0x07, NCSI_CAP_VLAN_ONLY =3D 0x01, /* Filter VLAN packet only */ - NCSI_CAP_VLAN_NO =3D 0x02, /* Filter VLAN and non-VLAN */ + NCSI_CAP_VLAN_FILTERED =3D 0x02, /* Filter VLAN and non-VLAN */ NCSI_CAP_VLAN_ANY =3D 0x03, /* Filter Any-and-non-VLAN */ NCSI_CAP_VLAN_MASK =3D 0x07 }; diff --git a/net/ncsi/ncsi-manage.c b/net/ncsi/ncsi-manage.c index 78814417d753..a8f7a2ff52a0 100644 --- a/net/ncsi/ncsi-manage.c +++ b/net/ncsi/ncsi-manage.c @@ -1098,7 +1098,7 @@ static void ncsi_configure_channel(struct ncsi_dev_pr= iv *ndp) nca.type =3D NCSI_PKT_CMD_DV; } else { nca.type =3D NCSI_PKT_CMD_EV; - nca.bytes[3] =3D NCSI_CAP_VLAN_NO; + nca.bytes[3] =3D NCSI_CAP_VLAN_FILTERED; } nd->state =3D ncsi_dev_state_config_sma; } else if (nd->state =3D=3D ncsi_dev_state_config_sma) { --=20 2.34.1 From nobody Mon Apr 27 16:11:16 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BD656C43334 for ; Fri, 10 Jun 2022 16:48:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349835AbiFJQsM (ORCPT ); Fri, 10 Jun 2022 12:48:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37374 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241054AbiFJQrw (ORCPT ); Fri, 10 Jun 2022 12:47:52 -0400 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C136DB224E; Fri, 10 Jun 2022 09:47:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1654879669; x=1686415669; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=nS9jBzEdJm76RP0LAjTlMRfAbVC9/X57Mw2W3mH7Yrc=; b=iqiAv1JLUbTJB+P08nlT41p9qJw2njftnqmFtFc1uta6MTQlP3tKQ9Y8 SIRT4ndP4s48o/cyEsM6HjWnesKsu71GySJZei4sioGERHm8yQmHmLKhU RZxSs6enmReYAToXknjlIOHKj500mjlUojD4Tjos3O7NKTf9cHOnsRab6 qoEaejSNIhao4CunQxgUKMNYGILL0ctSvzzfD5TjIlaG/k6agzcRdTkFu qgJkHAdWJyqbx7eucGKkvhCtdOf7hA+8mdbnEn0eMD1bvwIZ7fJwBW5+a Q5qmzeqr/6egtCwtfF/NUuLvjgqOUEurWmg92hc87qEAFQLrtYB0/U3t5 g==; X-IronPort-AV: E=McAfee;i="6400,9594,10374"; a="275209620" X-IronPort-AV: E=Sophos;i="5.91,290,1647327600"; d="scan'208";a="275209620" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jun 2022 09:47:49 -0700 X-IronPort-AV: E=Sophos;i="5.91,290,1647327600"; d="scan'208";a="638211044" Received: from unknown (HELO jiaqingz-server.sh.intel.com) ([10.239.48.171]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jun 2022 09:47:48 -0700 From: Jiaqing Zhao To: Samuel Mendoza-Jonas , "David S . Miller" , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jiaqing Zhao Subject: [PATCH 3/6] net/ncsi: Enable VLAN filtering when callback is registered Date: Sat, 11 Jun 2022 00:45:52 +0800 Message-Id: <20220610164555.2322930-4-jiaqing.zhao@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220610164555.2322930-1-jiaqing.zhao@linux.intel.com> References: <20220610164555.2322930-1-jiaqing.zhao@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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 =3D true; } =20 + /* Enable hardware VLAN filtering */ + if (dev->netdev_ops->ndo_vlan_rx_add_vid =3D=3D ncsi_vlan_rx_add_vid && + dev->netdev_ops->ndo_vlan_rx_kill_vid =3D=3D ncsi_vlan_rx_kill_vid) + dev->hw_features |=3D NETIF_F_HW_VLAN_CTAG_FILTER; + return nd; } EXPORT_SYMBOL_GPL(ncsi_register_dev); --=20 2.34.1 From nobody Mon Apr 27 16:11:16 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C066BCCA47D for ; Fri, 10 Jun 2022 16:48:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349845AbiFJQsI (ORCPT ); Fri, 10 Jun 2022 12:48:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37400 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349781AbiFJQrw (ORCPT ); Fri, 10 Jun 2022 12:47:52 -0400 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D5FAB5272; Fri, 10 Jun 2022 09:47:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1654879671; x=1686415671; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=tfHmXri7R6Bw+I2ET1tz+X8i7YZFY1rCt76KxR+OC/A=; b=jtzR6WxHUZTMpwAwxfIvyKlIhcON+q4hC+TSObOl3F5nPuyFxxe6Z/Br jGE9L/Dy1C+bzE5DjRIOiybEcVW8h3EwAXu9vJ6lQbv/XO98gGwG/ka6J mQQFF8+Y8DIIv/U5qsSJoAdIoaG92rs4MTb8liUznUMTeMlX/px13r9vS /eu1gxv53MI7V1JfQLZ0Z/J574L0rRsuUIjM0UNIlcmaNoqwAqwPWSZW4 y0us2a98RLOYPAa1M3QQgIefPji5VNZi/ItsCdkjjnAppk/bFouwcJUeL ZyB7ZalHoGE3Idw50trWO9dv8fL4Lkqm8X/pJrgJzizcS3m/i7YSQYBKd g==; X-IronPort-AV: E=McAfee;i="6400,9594,10374"; a="275209626" X-IronPort-AV: E=Sophos;i="5.91,290,1647327600"; d="scan'208";a="275209626" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jun 2022 09:47:51 -0700 X-IronPort-AV: E=Sophos;i="5.91,290,1647327600"; d="scan'208";a="638211051" Received: from unknown (HELO jiaqingz-server.sh.intel.com) ([10.239.48.171]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jun 2022 09:47:49 -0700 From: Jiaqing Zhao To: Samuel Mendoza-Jonas , "David S . Miller" , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jiaqing Zhao Subject: [PATCH 4/6] ftgmac100: Remove enable NCSI VLAN filtering Date: Sat, 11 Jun 2022 00:45:53 +0800 Message-Id: <20220610164555.2322930-5-jiaqing.zhao@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220610164555.2322930-1-jiaqing.zhao@linux.intel.com> References: <20220610164555.2322930-1-jiaqing.zhao@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Setting NETIF_F_HW_VLAN_CTAG_FILTER flag to enable NCSI VLAN filtering has been moved to the NCSI driver, the logic in ftgmac100 driver is no longer needed. Signed-off-by: Jiaqing Zhao --- drivers/net/ethernet/faraday/ftgmac100.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/etherne= t/faraday/ftgmac100.c index 5231818943c6..18821ca38795 100644 --- a/drivers/net/ethernet/faraday/ftgmac100.c +++ b/drivers/net/ethernet/faraday/ftgmac100.c @@ -1922,9 +1922,6 @@ static int ftgmac100_probe(struct platform_device *pd= ev) NETIF_F_GRO | NETIF_F_SG | NETIF_F_HW_VLAN_CTAG_RX | NETIF_F_HW_VLAN_CTAG_TX; =20 - if (priv->use_ncsi) - netdev->hw_features |=3D NETIF_F_HW_VLAN_CTAG_FILTER; - /* AST2400 doesn't have working HW checksum generation */ if (np && (of_device_is_compatible(np, "aspeed,ast2400-mac"))) netdev->hw_features &=3D ~NETIF_F_HW_CSUM; --=20 2.34.1 From nobody Mon Apr 27 16:11:16 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B11CEC43334 for ; Fri, 10 Jun 2022 16:48:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349831AbiFJQsR (ORCPT ); Fri, 10 Jun 2022 12:48:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38840 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346457AbiFJQsF (ORCPT ); Fri, 10 Jun 2022 12:48:05 -0400 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 333A2B82D2; Fri, 10 Jun 2022 09:47:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1654879673; x=1686415673; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=xfml1NwpVsO1qKFhuV1kEyknIGEvUDk3GH8dIhLg1z4=; b=kjMbCJy411KZHyaEXzxQ7UwNdFw1WdHyA/CeNAtaLvvaPkzpMIzUErn9 zgOkivyD4+DMyEOVU2VmQ6zuhJIHS1WhxH/Wn4H0RhQkt6ShAGpFxwJcl ihmZLyoNhgkUkAYzvknFeWsPGhanivajtJsbZUM5QcR2YPEKsBdvHqTMW D4tDXIcMIQL70AysK+KBOIJEZUD8mi2UOk3P1ctThOuggmLKDRAPRk+Fb oFKBJxsx/zZEu1AbkIvf2u88P+VP0WSCO4esX0CKXOM8myfRtTHhcY/ya CDqBDJOayTM55jsdn/xLA1brrZ4DVolds4NW3zMzr8gxMwyxJ7v57TS0Y A==; X-IronPort-AV: E=McAfee;i="6400,9594,10374"; a="275209634" X-IronPort-AV: E=Sophos;i="5.91,290,1647327600"; d="scan'208";a="275209634" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jun 2022 09:47:53 -0700 X-IronPort-AV: E=Sophos;i="5.91,290,1647327600"; d="scan'208";a="638211058" Received: from unknown (HELO jiaqingz-server.sh.intel.com) ([10.239.48.171]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jun 2022 09:47:51 -0700 From: Jiaqing Zhao To: Samuel Mendoza-Jonas , "David S . Miller" , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jiaqing Zhao Subject: [PATCH 5/6] dt-bindings: net: Add NCSI bindings Date: Sat, 11 Jun 2022 00:45:54 +0800 Message-Id: <20220610164555.2322930-6-jiaqing.zhao@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220610164555.2322930-1-jiaqing.zhao@linux.intel.com> References: <20220610164555.2322930-1-jiaqing.zhao@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Add devicetree bindings for NCSI VLAN modes. This allows VLAN mode to be configured in devicetree. Signed-off-by: Jiaqing Zhao --- .../devicetree/bindings/net/ncsi.yaml | 34 +++++++++++++++++++ MAINTAINERS | 2 ++ include/dt-bindings/net/ncsi.h | 15 ++++++++ 3 files changed, 51 insertions(+) create mode 100644 Documentation/devicetree/bindings/net/ncsi.yaml create mode 100644 include/dt-bindings/net/ncsi.h diff --git a/Documentation/devicetree/bindings/net/ncsi.yaml b/Documentatio= n/devicetree/bindings/net/ncsi.yaml new file mode 100644 index 000000000000..ec76ae9a77a9 --- /dev/null +++ b/Documentation/devicetree/bindings/net/ncsi.yaml @@ -0,0 +1,34 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/net/ncsi.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Network Controller Sideband Interface (NCSI) + +maintainers: + - Samuel Mendoza-Jonas + +description: | + Bindings for the Network Controller Sideband Interface (NCSI) driver + +properties: + ncsi,vlan-mode: + description: VLAN mode used on the NCSI device. + $ref: /schemas/types.yaml#/definitions/uint32 + enum: [0, 1, 2, 3] + +examples: + - | + #include + + mac0: ethernet@1e660000 { + compatible =3D "aspeed,ast2600-mac", "faraday,ftgmac100"; + reg =3D <0x1e660000 0x180>; + status =3D "okay"; + + use-ncsi; + ncsi,vlan-mode =3D ; + }; + +... diff --git a/MAINTAINERS b/MAINTAINERS index f468864fd268..199e4b5bceab 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -13534,6 +13534,8 @@ F: drivers/scsi/sun3_scsi_vme.c NCSI LIBRARY M: Samuel Mendoza-Jonas S: Maintained +F: Documentation/devicetree/bindings/net/ncsi.yaml +F: include/dt-bindings/net/ncsi.h F: net/ncsi/ =20 NCT6775 HARDWARE MONITOR DRIVER diff --git a/include/dt-bindings/net/ncsi.h b/include/dt-bindings/net/ncsi.h new file mode 100644 index 000000000000..19eb9a5db08b --- /dev/null +++ b/include/dt-bindings/net/ncsi.h @@ -0,0 +1,15 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* + * Device Tree constants for NCSI + */ + +#ifndef _DT_BINDINGS_NCSI_H +#define _DT_BINDINGS_NCSI_H + +/* VLAN Modes */ +#define NCSI_VLAN_MODE_DISABLED 0 +#define NCSI_VLAN_MODE_ONLY 1 +#define NCSI_VLAN_MODE_FILTERED 2 +#define NCSI_VLAN_MODE_ANY 3 + +#endif --=20 2.34.1 From nobody Mon Apr 27 16:11:16 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5ABF6C43334 for ; Fri, 10 Jun 2022 16:48:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349859AbiFJQsW (ORCPT ); Fri, 10 Jun 2022 12:48:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38852 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349815AbiFJQsG (ORCPT ); Fri, 10 Jun 2022 12:48:06 -0400 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CE462B2EB6; Fri, 10 Jun 2022 09:47:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1654879674; x=1686415674; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=dTbJGn1wT4KOCMCBcHh3vCtqTv4ul5foDXW+RuzFICU=; b=LhhTH24iqh+l/4hFBcayLgBPEEqtNq/KcYS23TFGO6OjTY5ApSX9MEFe y4pxEkynT6ZRNcbj1OmVQtGfBW51UOKh2uYJik5tizVhhnO3fLYqLdY4D e83sPvlPZkTEkAZQwx2cW3AGtHsWYOgfPKs/lGD3zaxQfeksmbQpWpojY gfC3+w534za4VrvAt2v5d3aVzD4qgp3xK7ovuu9IGaok9uan3ekVni+La +kegdEeAMUDv478cb91aH+WlfzWuA5mZPhj+ATnv0I6QVXMu/jRgoHdjk Aqg5TbrKr1Qh4hRvL9ZwnlnlyRN2mDa++4V1XKyd0jgwOmDDPam1b1wKT A==; X-IronPort-AV: E=McAfee;i="6400,9594,10374"; a="275209640" X-IronPort-AV: E=Sophos;i="5.91,290,1647327600"; d="scan'208";a="275209640" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jun 2022 09:47:54 -0700 X-IronPort-AV: E=Sophos;i="5.91,290,1647327600"; d="scan'208";a="638211067" Received: from unknown (HELO jiaqingz-server.sh.intel.com) ([10.239.48.171]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jun 2022 09:47:53 -0700 From: Jiaqing Zhao To: Samuel Mendoza-Jonas , "David S . Miller" , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jiaqing Zhao Subject: [PATCH 6/6] net/ncsi: Support VLAN mode configuration Date: Sat, 11 Jun 2022 00:45:55 +0800 Message-Id: <20220610164555.2322930-7-jiaqing.zhao@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220610164555.2322930-1-jiaqing.zhao@linux.intel.com> References: <20220610164555.2322930-1-jiaqing.zhao@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" NCSI specification defines 4 VLAN modes, currently kernel NCSI driver only supports the "VLAN + non-VLAN" mode (Mode #2), and there is no way to detect which modes are supported by the device. This patch adds support for configuring VLAN mode via the "ncsi,vlan-mode" devicetree node. Signed-off-by: Jiaqing Zhao --- net/ncsi/internal.h | 1 + net/ncsi/ncsi-manage.c | 41 ++++++++++++++++++++++++++++++++++------- 2 files changed, 35 insertions(+), 7 deletions(-) diff --git a/net/ncsi/internal.h b/net/ncsi/internal.h index 7f384f841019..b868e07f7ffd 100644 --- a/net/ncsi/internal.h +++ b/net/ncsi/internal.h @@ -334,6 +334,7 @@ struct ncsi_dev_priv { struct work_struct work; /* For channel management */ struct packet_type ptype; /* NCSI packet Rx handler */ struct list_head node; /* Form NCSI device list */ + u32 vlan_mode; /* VLAN mode */ #define NCSI_MAX_VLAN_VIDS 15 struct list_head vlan_vids; /* List of active VLAN IDs */ =20 diff --git a/net/ncsi/ncsi-manage.c b/net/ncsi/ncsi-manage.c index 3fb95f29e3e2..a398b0eb72b2 100644 --- a/net/ncsi/ncsi-manage.c +++ b/net/ncsi/ncsi-manage.c @@ -10,6 +10,7 @@ #include #include #include +#include =20 #include #include @@ -1042,7 +1043,11 @@ static void ncsi_configure_channel(struct ncsi_dev_p= riv *ndp) nd->state =3D ncsi_dev_state_config_oem_gma; break; case ncsi_dev_state_config_oem_gma: - nd->state =3D ncsi_dev_state_config_clear_vids; + /* Only set up hardware VLAN filters in filtered mode */ + if (ndp->vlan_mode =3D=3D NCSI_VLAN_MODE_FILTERED) + nd->state =3D ncsi_dev_state_config_clear_vids; + else + nd->state =3D ncsi_dev_state_config_ev; ret =3D -1; =20 #if IS_ENABLED(CONFIG_NCSI_OEM_CMD_GET_MAC) @@ -1094,11 +1099,15 @@ static void ncsi_configure_channel(struct ncsi_dev_= priv *ndp) nd->state =3D ncsi_dev_state_config_svf; /* Enable/Disable the VLAN filter */ } else if (nd->state =3D=3D ncsi_dev_state_config_ev) { - if (list_empty(&ndp->vlan_vids)) { - nca.type =3D NCSI_PKT_CMD_DV; - } else { + if (ndp->vlan_mode =3D=3D NCSI_VLAN_MODE_FILTERED && + !list_empty(&ndp->vlan_vids)) { nca.type =3D NCSI_PKT_CMD_EV; nca.bytes[3] =3D NCSI_CAP_VLAN_FILTERED; + } else if (ndp->vlan_mode =3D=3D NCSI_VLAN_MODE_ANY) { + nca.type =3D NCSI_PKT_CMD_EV; + nca.bytes[3] =3D NCSI_CAP_VLAN_ANY; + } else { + nca.type =3D NCSI_PKT_CMD_DV; } nd->state =3D ncsi_dev_state_config_sma; } else if (nd->state =3D=3D ncsi_dev_state_config_sma) { @@ -1800,15 +1809,33 @@ struct ncsi_dev *ncsi_register_dev(struct net_devic= e *dev, ndp->ptype.dev =3D dev; dev_add_pack(&ndp->ptype); =20 + /* Set default VLAN mode (filtered) */ + ndp->vlan_mode =3D NCSI_VLAN_MODE_FILTERED; + pdev =3D to_platform_device(dev->dev.parent); if (pdev) { np =3D pdev->dev.of_node; - if (np && of_get_property(np, "mlx,multi-host", NULL)) - ndp->mlx_multi_host =3D true; + if (np) { + u32 vlan_mode; + + if (!of_property_read_u32(np, "ncsi,vlan-mode", &vlan_mode)) { + if (vlan_mode > NCSI_VLAN_MODE_ANY || + vlan_mode =3D=3D NCSI_VLAN_MODE_ONLY) + dev_warn(&pdev->dev, "NCSI: Unsupported VLAN mode %u", + vlan_mode); + else + ndp->vlan_mode =3D vlan_mode; + dev_info(&pdev->dev, "NCSI: Configured VLAN mode %u", + ndp->vlan_mode); + } + if (of_get_property(np, "mlx,multi-host", NULL)) + ndp->mlx_multi_host =3D true; + } } =20 /* Enable hardware VLAN filtering */ - if (dev->netdev_ops->ndo_vlan_rx_add_vid =3D=3D ncsi_vlan_rx_add_vid && + if (ndp->vlan_mode =3D=3D NCSI_VLAN_MODE_FILTERED && + dev->netdev_ops->ndo_vlan_rx_add_vid =3D=3D ncsi_vlan_rx_add_vid && dev->netdev_ops->ndo_vlan_rx_kill_vid =3D=3D ncsi_vlan_rx_kill_vid) dev->hw_features |=3D NETIF_F_HW_VLAN_CTAG_FILTER; =20 --=20 2.34.1