From patchwork Fri Jun 10 16:48:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiaqing Zhao X-Patchwork-Id: 1642066 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=fq1D6qIv; 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 4LKRmh62yLz9s1l for ; Sat, 11 Jun 2022 02:51:00 +1000 (AEST) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4LKRmh5C29z3btY for ; Sat, 11 Jun 2022 02:51:00 +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=fq1D6qIv; 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=fq1D6qIv; 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 4LKRlm0gg6z3bnT for ; Sat, 11 Jun 2022 02:50:11 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1654879812; x=1686415812; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=SoQbox9LXcyX3/Opr6a2M/n8V2iom3/0Vp+el7IRj5A=; b=fq1D6qIval4mdMYrAm87fvnolkVThkHCsANWYYQg2LLejOtCOn6I5yJ4 huqATeqLJmloRjW2lvy29VQcX5NTDqyMKIcjK83YmL9FgcEx8xIa/a+SZ 6QN7JqvR1hE6gdfvzaUmcQ7vCaiTZx4Z2GJVqdfgafPXKuG6WvDu3B0jC qF5Bnm5hr5IE7hraw8/XTn3j1aFcjPAR1tkzxuRmxjUfTXoqKuedMMAaZ mV67MEkfOta4BYzMxALBaOwjKA4krY4et1kunWbIQhW2CnUj4ayzdrIIl sqcml3d6rZElClfN6kI02IO9tzWF6xFImG+6gRpoGOBmW40QNeQSVSNe4 A==; X-IronPort-AV: E=McAfee;i="6400,9594,10374"; a="341739917" X-IronPort-AV: E=Sophos;i="5.91,290,1647327600"; d="scan'208";a="341739917" 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:52 -0700 X-IronPort-AV: E=Sophos;i="5.91,290,1647327600"; d="scan'208";a="760587693" 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:50 -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 1/6] net/ncsi: Fix value of NCSI_CAP_VLAN_ANY Date: Sat, 11 Jun 2022 00:48:03 +0800 Message-Id: <20220610164808.2323340-2-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" 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 = 0x07, NCSI_CAP_VLAN_ONLY = 0x01, /* Filter VLAN packet only */ NCSI_CAP_VLAN_NO = 0x02, /* Filter VLAN and non-VLAN */ - NCSI_CAP_VLAN_ANY = 0x04, /* Filter Any-and-non-VLAN */ + NCSI_CAP_VLAN_ANY = 0x03, /* Filter Any-and-non-VLAN */ NCSI_CAP_VLAN_MASK = 0x07 }; From patchwork Fri Jun 10 16:48:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiaqing Zhao X-Patchwork-Id: 1642067 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=HKmjhwHr; 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 4LKRnP2Jqmz9s1l for ; Sat, 11 Jun 2022 02:51:37 +1000 (AEST) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4LKRnP03q4z3byF for ; Sat, 11 Jun 2022 02:51:37 +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=HKmjhwHr; 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=HKmjhwHr; 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 4LKRlm70Bmz3bnT for ; Sat, 11 Jun 2022 02:50:12 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1654879813; x=1686415813; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=n2DHPKG6LELctv9GPHh5MdlgXeZF+xfpjUKtxgbPNOI=; b=HKmjhwHrT7VVLbB4mJSTNlDHFXZlKtE++2+Doi82MwCaHt0XjPThBxvb JjGcg30Ds2FFTHgUf1ijPEPqXRpyIKiW/7b1w9ZhJSd18tntfhmTy//eC os7Lkho4ImzAY9eHEoZu0FO+p44vZu1VzeZcpMH/qIXbIcPmr2qKkSFkF 43ksld2nQj5bcg3HcR+rJzyrp8b9ZZBvcoMFI7kNSDCdjA5UcEptug2oN b1JBVHAHWPh1zjTuqaw9Tsup8qtYEL5C5lUfxkVJ5up15am4IsEPfupC2 KgrntEsIqEacpVgAVphjzsDL4vFNwx3gcNEExNarTC/ZbNm5p2ogJzVNf A==; X-IronPort-AV: E=McAfee;i="6400,9594,10374"; a="341739923" X-IronPort-AV: E=Sophos;i="5.91,290,1647327600"; d="scan'208";a="341739923" 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:54 -0700 X-IronPort-AV: E=Sophos;i="5.91,290,1647327600"; d="scan'208";a="760587696" 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:52 -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 2/6] net/ncsi: Rename NCSI_CAP_VLAN_NO to NCSI_CAP_VLAN_FILTERED Date: Sat, 11 Jun 2022 00:48:04 +0800 Message-Id: <20220610164808.2323340-3-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" 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 = 0x04, /* HNC driver status */ NCSI_CAP_AEN_MASK = 0x07, NCSI_CAP_VLAN_ONLY = 0x01, /* Filter VLAN packet only */ - NCSI_CAP_VLAN_NO = 0x02, /* Filter VLAN and non-VLAN */ + NCSI_CAP_VLAN_FILTERED = 0x02, /* Filter VLAN and non-VLAN */ NCSI_CAP_VLAN_ANY = 0x03, /* Filter Any-and-non-VLAN */ NCSI_CAP_VLAN_MASK = 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_priv *ndp) nca.type = NCSI_PKT_CMD_DV; } else { nca.type = NCSI_PKT_CMD_EV; - nca.bytes[3] = NCSI_CAP_VLAN_NO; + nca.bytes[3] = NCSI_CAP_VLAN_FILTERED; } nd->state = ncsi_dev_state_config_sma; } else if (nd->state == ncsi_dev_state_config_sma) { 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); From patchwork Fri Jun 10 16:48:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiaqing Zhao X-Patchwork-Id: 1642069 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=PeCPTu/P; 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 4LKRpq4VBNz9s1l for ; Sat, 11 Jun 2022 02:52:51 +1000 (AEST) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4LKRpq3T4rz3byP for ; Sat, 11 Jun 2022 02:52:51 +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=PeCPTu/P; 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=PeCPTu/P; 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 4LKRln6k13z3bsq 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=tfHmXri7R6Bw+I2ET1tz+X8i7YZFY1rCt76KxR+OC/A=; b=PeCPTu/PSY5d1+GFj7hOUffX++h0wOfIbXWgfvQMUEZ9GUQgdiEMVoHI nnczrOQ1e6DeFcLy4iIBMv27oIrdwV2FrsioocSXJ8SFgQmJAwWYtWBn4 uE42Z8Sq0ueTXw5ckvOQngHCQzXuamSbT1cN7cQIR9z3Ov0T5gawXvPqH kdnpOFTBr91BBNNwNT5oGusKXKHQtkjwr6JpcHwQDR0J9AJ208Ob9TkEK CqDv3u6bwq31+G4ibIKYXkU0bJp5hcd+yS8aE3W++7VsNary/ZrDCEdhA 35fEJzSZaBce/4atGytqSZZVu5FBAF5TsPeE6jnvcZx28YSVzFV2468u+ Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10374"; a="341739944" X-IronPort-AV: E=Sophos;i="5.91,290,1647327600"; d="scan'208";a="341739944" 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:59 -0700 X-IronPort-AV: E=Sophos;i="5.91,290,1647327600"; d="scan'208";a="760587730" 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:57 -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 4/6] ftgmac100: Remove enable NCSI VLAN filtering Date: Sat, 11 Jun 2022 00:48:06 +0800 Message-Id: <20220610164808.2323340-5-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" 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/ethernet/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 *pdev) NETIF_F_GRO | NETIF_F_SG | NETIF_F_HW_VLAN_CTAG_RX | NETIF_F_HW_VLAN_CTAG_TX; - if (priv->use_ncsi) - netdev->hw_features |= 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 &= ~NETIF_F_HW_CSUM; From patchwork Fri Jun 10 16:48:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiaqing Zhao X-Patchwork-Id: 1642070 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=KbWkwsVv; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org (client-ip=2404:9400:2:0:216:3eff:fee1:b9f1; helo=lists.ozlabs.org; envelope-from=openbmc-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org; receiver=) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2404:9400:2:0:216:3eff:fee1:b9f1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LKRqX0xmcz9s1l for ; Sat, 11 Jun 2022 02:53:28 +1000 (AEST) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4LKRqW4jXJz3bxY for ; Sat, 11 Jun 2022 02:53:27 +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=KbWkwsVv; 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=KbWkwsVv; 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 4LKRlp58Svz3bsq for ; Sat, 11 Jun 2022 02:50:14 +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=xfml1NwpVsO1qKFhuV1kEyknIGEvUDk3GH8dIhLg1z4=; b=KbWkwsVvHudEVSMV3hfUfZUmWDpErcynL/6oTDLRkCi9tJIs1B7O1ZqI 5gRxsYEGFDYyYHP8sMM191Z8dN6l7QYmMlCFUjOVLTvONVPlahJqV+Amg BQVpBFd/hjEzWVyAEptR/etGzH6mxscGQrmyvGR6v/C4zM+vM4fosmD5O /UFiEG8QKT5wR1qR/ZxTgCaFE28HBV1cMqYF1yV20L4/0gk5pq3geco39 UgtHbaOg0C6nFWemPPKl0aC+Yz+Ds/URtRtqi48h2qLz04LCHuqe/3R4w iZxfng0851/IDjT1h9ADXbO68nlMVRaU3pTlUzpW7+OnxT5XGSHRIfWyw w==; X-IronPort-AV: E=McAfee;i="6400,9594,10374"; a="341739959" X-IronPort-AV: E=Sophos;i="5.91,290,1647327600"; d="scan'208";a="341739959" 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:50:01 -0700 X-IronPort-AV: E=Sophos;i="5.91,290,1647327600"; d="scan'208";a="760587734" 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:59 -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 5/6] dt-bindings: net: Add NCSI bindings Date: Sat, 11 Jun 2022 00:48:07 +0800 Message-Id: <20220610164808.2323340-6-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" 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/Documentation/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 = "aspeed,ast2600-mac", "faraday,ftgmac100"; + reg = <0x1e660000 0x180>; + status = "okay"; + + use-ncsi; + ncsi,vlan-mode = ; + }; + +... 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/ 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 From patchwork Fri Jun 10 16:48:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiaqing Zhao X-Patchwork-Id: 1642071 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=CiVvm+Sc; 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 4LKRrC4BpMz9s1l for ; Sat, 11 Jun 2022 02:54:03 +1000 (AEST) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4LKRrC3Zqtz2xZR for ; Sat, 11 Jun 2022 02:54:03 +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=CiVvm+Sc; 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=CiVvm+Sc; 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 4LKRlp6Hmlz3btY for ; Sat, 11 Jun 2022 02:50:14 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1654879815; x=1686415815; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=dTbJGn1wT4KOCMCBcHh3vCtqTv4ul5foDXW+RuzFICU=; b=CiVvm+ScTpaG4mwxqUHL0h4PnUqzVvRpxKLWBfxGFpsWkOS1AOsPsmh/ RqaqS3McVRj0aHXVX2dFN1l5BcuGUXiOsXUWtsN2nhZc/R9F82CzxTyWY /wExnyC1OkAJCA0vvyLAr57bfdkCrqHjkA2RaKuuruv2z4+GzEPin0ylm 8JXkgUvBLCOG6HW+/jBeDA/d2qclfJ98cuKz1nVbuJ/TYsICdfxhhdadq /Lm6V/AdzImBcBsKhXnYTS5hc2cEHPWhpiGPZPQOH0j9t5+RhcKHQd4yR NKG6TPddNvAev7sz3WqZ6qWev1daU0k43Qb5udwt+NXL2HsaQVuzbAwJE g==; X-IronPort-AV: E=McAfee;i="6400,9594,10374"; a="341739967" X-IronPort-AV: E=Sophos;i="5.91,290,1647327600"; d="scan'208";a="341739967" 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:50:03 -0700 X-IronPort-AV: E=Sophos;i="5.91,290,1647327600"; d="scan'208";a="760587756" 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:50:01 -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 6/6] net/ncsi: Support VLAN mode configuration Date: Sat, 11 Jun 2022 00:48:08 +0800 Message-Id: <20220610164808.2323340-7-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" 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 */ 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 #include #include @@ -1042,7 +1043,11 @@ static void ncsi_configure_channel(struct ncsi_dev_priv *ndp) nd->state = ncsi_dev_state_config_oem_gma; break; case ncsi_dev_state_config_oem_gma: - nd->state = ncsi_dev_state_config_clear_vids; + /* Only set up hardware VLAN filters in filtered mode */ + if (ndp->vlan_mode == NCSI_VLAN_MODE_FILTERED) + nd->state = ncsi_dev_state_config_clear_vids; + else + nd->state = ncsi_dev_state_config_ev; ret = -1; #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 = ncsi_dev_state_config_svf; /* Enable/Disable the VLAN filter */ } else if (nd->state == ncsi_dev_state_config_ev) { - if (list_empty(&ndp->vlan_vids)) { - nca.type = NCSI_PKT_CMD_DV; - } else { + if (ndp->vlan_mode == NCSI_VLAN_MODE_FILTERED && + !list_empty(&ndp->vlan_vids)) { nca.type = NCSI_PKT_CMD_EV; nca.bytes[3] = NCSI_CAP_VLAN_FILTERED; + } else if (ndp->vlan_mode == NCSI_VLAN_MODE_ANY) { + nca.type = NCSI_PKT_CMD_EV; + nca.bytes[3] = NCSI_CAP_VLAN_ANY; + } else { + nca.type = NCSI_PKT_CMD_DV; } nd->state = ncsi_dev_state_config_sma; } else if (nd->state == ncsi_dev_state_config_sma) { @@ -1800,15 +1809,33 @@ struct ncsi_dev *ncsi_register_dev(struct net_device *dev, ndp->ptype.dev = dev; dev_add_pack(&ndp->ptype); + /* Set default VLAN mode (filtered) */ + ndp->vlan_mode = NCSI_VLAN_MODE_FILTERED; + pdev = to_platform_device(dev->dev.parent); if (pdev) { np = pdev->dev.of_node; - if (np && of_get_property(np, "mlx,multi-host", NULL)) - ndp->mlx_multi_host = 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 == NCSI_VLAN_MODE_ONLY) + dev_warn(&pdev->dev, "NCSI: Unsupported VLAN mode %u", + vlan_mode); + else + ndp->vlan_mode = 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 = true; + } } /* Enable hardware VLAN filtering */ - if (dev->netdev_ops->ndo_vlan_rx_add_vid == ncsi_vlan_rx_add_vid && + if (ndp->vlan_mode == NCSI_VLAN_MODE_FILTERED && + 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;