Message ID | 20230106201507.2206113-1-horatiu.vultur@microchip.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp1007979wrt; Fri, 6 Jan 2023 12:16:13 -0800 (PST) X-Google-Smtp-Source: AMrXdXvqQZfrZ2/1PJLdMYWq4IwNbGbgKrM9LWG+M8VwCKCT+l7XnUUuISerKUMbRAbXtzCiX8ny X-Received: by 2002:a17:906:1583:b0:83f:384f:ea23 with SMTP id k3-20020a170906158300b0083f384fea23mr45667469ejd.57.1673036173519; Fri, 06 Jan 2023 12:16:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673036173; cv=none; d=google.com; s=arc-20160816; b=IGmClBCYHsxVkQkqkuWlajV6wqpMaoPxPoEuJIk4Q3hS827sF0pr6IWPfPeaVZ2rNg M+9JeMePWSjKsoLb6kUbAynJVk/nHAYQo64VfWTdTBSSEMvDouEh871N8WFYpNbWASQo AtNwfIAXmKuO8TD/Uz3IBtEpPrfxbJtw9XGaTdbrDBUgvAWOLdzCItyufTlEaWd15U/w yo27K6vGPm/iR7FUaOa+IYbFk42JG5IaXb/1OsT6qrkDYtWE+T6+GoGMHTv/lJjDxa2z VjPBNCOG6SPGmYT2WsXwQHh95m15IGLlvuoZD/VbY/pTnRVVSo8fwWHMzERf29BVaRU0 sofA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=LtxE1WWcz2mwg+u+qXvN1LFM+etiuovAXABwARuW+Ug=; b=oDXsbSYJCJ6akeD7/4T0ix3O/1tiY5VVPrHFB0qRjwYMCfg4iHipunlptLNYIJY2ny lTQR5ouhU39W4DzMeWcacCQMFHvZnu7rqgK8BSU9fsozdwZLmo0xuKY85xjnbCyPwPjg HhanOvcrTUncAhdGFDctJk5sbANoBkEOpuBTgu5AGKyhoQYhFNvAbs2vtf8RY95LMFek HYLCWfdzDc+924dF+H3RtlN/oreM34Piok6semI2hu4bvjTXPnU853ak/KyyBx0+WIdp NKhhuR6jBpIKN6WgoJapM7A4ns8IDtqUifL642drRKfJAWfI1/CdXih48lfjj+Lgw2Ee 0B+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=TrrLxCVR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g18-20020a1709065d1200b007ae186b15f9si2380180ejt.597.2023.01.06.12.15.46; Fri, 06 Jan 2023 12:16:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=TrrLxCVR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236642AbjAFUMm (ORCPT <rfc822;ahmedalshaiji.dev@gmail.com> + 99 others); Fri, 6 Jan 2023 15:12:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49032 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236639AbjAFULQ (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 6 Jan 2023 15:11:16 -0500 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A4463AB02; Fri, 6 Jan 2023 12:11:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1673035863; x=1704571863; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=iNGgPBxl9mMcCW/EJLM/F3Imh9ZuEmThyhwpRRQ3fnM=; b=TrrLxCVR5nF8b+YuuDT6Hyh0FlKKeB2XlVwShV2CDDUIjzHKNBEiUtFS 5lfaJ9aM6JkwoVoAU3fRtUvK4c/GcT3deczxVmrH/yNSICtX4eY0iAGxc xrLwi59sX5+Wcz2wvz7QXcEnmqb5gOkGm/lxtFSEgDzhJiB2DJfLJX6qV VAm9Yz78nBXEt83TGfhXmMVJj6fBFacLgitV8jOTATXHVAXIccmY6pvmy IK0TwzJQ003PGKNZqGrJdHI+jlMD/YpVeuMBUI1uYZXaThJuBDxSfjh1o m2VCftpoldp40bDgqCcLbEYpONR3z9C/vqxfmhU5OFUta0wSJp0vZNwsA g==; X-IronPort-AV: E=Sophos;i="5.96,306,1665471600"; d="scan'208";a="191137480" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa4.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 06 Jan 2023 13:11:00 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Fri, 6 Jan 2023 13:10:46 -0700 Received: from soft-dev3-1.microsemi.net (10.10.115.15) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server id 15.1.2507.16 via Frontend Transport; Fri, 6 Jan 2023 13:10:44 -0700 From: Horatiu Vultur <horatiu.vultur@microchip.com> To: <netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org> CC: <davem@davemloft.net>, <edumazet@google.com>, <kuba@kernel.org>, <pabeni@redhat.com>, <UNGLinuxDriver@microchip.com>, <michael@walle.cc>, <steen.hegelund@microchip.com>, Horatiu Vultur <horatiu.vultur@microchip.com> Subject: [PATCH] net: lan966x: Allow to add rules in TCAM even if not enabled Date: Fri, 6 Jan 2023 21:15:07 +0100 Message-ID: <20230106201507.2206113-1-horatiu.vultur@microchip.com> X-Mailer: git-send-email 2.38.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754305578933505549?= X-GMAIL-MSGID: =?utf-8?q?1754305578933505549?= |
Series |
net: lan966x: Allow to add rules in TCAM even if not enabled
|
|
Commit Message
Horatiu Vultur
Jan. 6, 2023, 8:15 p.m. UTC
The blamed commit implemented the vcap_operations to allow to add an
entry in the TCAM. One of the callbacks is to validate the supported
keysets. If the TCAM lookup was not enabled, then this will return
failure so no entries could be added.
This doesn't make much sense, as you can enable at a later point the
TCAM. Therefore change it such to allow entries in TCAM even it is not
enabled.
Fixes: 4426b78c626d ("net: lan966x: Add port keyset config and callback interface")
Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
---
drivers/net/ethernet/microchip/lan966x/lan966x_vcap_impl.c | 3 ---
1 file changed, 3 deletions(-)
Comments
Hello: This patch was applied to netdev/net.git (master) by David S. Miller <davem@davemloft.net>: On Fri, 6 Jan 2023 21:15:07 +0100 you wrote: > The blamed commit implemented the vcap_operations to allow to add an > entry in the TCAM. One of the callbacks is to validate the supported > keysets. If the TCAM lookup was not enabled, then this will return > failure so no entries could be added. > This doesn't make much sense, as you can enable at a later point the > TCAM. Therefore change it such to allow entries in TCAM even it is not > enabled. > > [...] Here is the summary with links: - net: lan966x: Allow to add rules in TCAM even if not enabled https://git.kernel.org/netdev/net/c/76761babaa98 You are awesome, thank you!
diff --git a/drivers/net/ethernet/microchip/lan966x/lan966x_vcap_impl.c b/drivers/net/ethernet/microchip/lan966x/lan966x_vcap_impl.c index d8dc9fbb81e1a..a54c0426a35f3 100644 --- a/drivers/net/ethernet/microchip/lan966x/lan966x_vcap_impl.c +++ b/drivers/net/ethernet/microchip/lan966x/lan966x_vcap_impl.c @@ -95,10 +95,7 @@ lan966x_vcap_is2_get_port_keysets(struct net_device *dev, int lookup, bool found = false; u32 val; - /* Check if the port keyset selection is enabled */ val = lan_rd(lan966x, ANA_VCAP_S2_CFG(port->chip_port)); - if (!ANA_VCAP_S2_CFG_ENA_GET(val)) - return -ENOENT; /* Collect all keysets for the port in a list */ if (l3_proto == ETH_P_ALL)