From patchwork Fri Jan 27 13:08:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steen Hegelund X-Patchwork-Id: 13118692 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DEF2CC54EAA for ; Fri, 27 Jan 2023 13:34:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:CC :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=ODZbCNvHF9udzQ/5kzybU1UnV5v21Wgu3/TbYFBvYk4=; b=zPvec17ZB6GX5s Xl7pWmbws+u/nEzHnKtqmTDytGl10OYdp3lq3FdTguya6fAcxomwUUzYmEWNIkdjc3BIPhurOZUPp 0fJE1LL0NZ1OMIGeEHgrTl9usBY9YBiFradoxIvJkQXfujBsFIn7MxTJ6I1dj3H97cCNsNXlyGXZd HhU0VARadbpZ1JPizHvc5pzlTADuA9oASS2SqEIgVTduCPtnlAKrQv9cmiQ9mVnU61JRNBusxAW0b re+ymCYWXRrHggmXzBBvTgKwjbGJivEKoIiGmFkVcD5o/OgG+mznr/9z5rD06SEKB/qM2FtLSZKQf fLZnMPlUDHnfa2uUbrnQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pLOr6-00F1qS-9B; Fri, 27 Jan 2023 13:33:25 +0000 Received: from esa.microchip.iphmx.com ([68.232.154.123]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pLOTI-00EsmN-MQ for linux-arm-kernel@lists.infradead.org; Fri, 27 Jan 2023 13:08:51 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1674824928; x=1706360928; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=6OU5WNoVZZvJd9NlVlGxnPHtjT/vU2I5rNLU9tH7Wmw=; b=Q57EKLhLxWmiDknvt19RNUqHjxJawuNrBhljdYcfuQbV799EZQslLihc a4X+SJ+LeUWgBojUtPmj1xSQ6AIajghc+CCTizJ6UEWxgwPNh/gHFVj6o Z6id5Cn1l1ZBrfpBjJzWlQOBSGgcJYPNWK/qTr+U3nXHriV1ceUO/qXtO NfXclgPiqYaFVvkco50VsUGkYqScWzOUeyqVG/c3Nc57drjRi3BzYDvNV 57R9JsEwPTrmCqwQxUYNXnXDZOyHl+f7xFS4J5RpcxiNpg4LbTmK+YxDV d8j+BXYzhSuKuFzXDeEN6aVQOy+eeAHg34CPMyaqtfXEO2zO9NJym5Uus Q==; X-IronPort-AV: E=Sophos;i="5.97,251,1669100400"; d="scan'208";a="194150129" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa4.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 27 Jan 2023 06:08:41 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Fri, 27 Jan 2023 06:08:40 -0700 Received: from den-dk-m31857.microchip.com (10.10.115.15) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server id 15.1.2507.16 via Frontend Transport; Fri, 27 Jan 2023 06:08:34 -0700 From: Steen Hegelund To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni CC: Steen Hegelund , , Randy Dunlap , "Casper Andersson" , Russell King , Wan Jiabing , "Nathan Huckleberry" , , , , "Steen Hegelund" , Daniel Machon , Horatiu Vultur , Lars Povlsen , Dan Carpenter , Michael Walle Subject: [PATCH net-next 0/8] Adding Sparx5 ES2 VCAP support Date: Fri, 27 Jan 2023 14:08:22 +0100 Message-ID: <20230127130830.1481526-1-steen.hegelund@microchip.com> X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230127_050848_932265_C40F8C19 X-CRM114-Status: GOOD ( 11.22 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This provides the Egress Stage 2 (ES2) VCAP (Versatile Content-Aware Processor) support for the Sparx5 platform. The ES2 VCAP is an Egress Access Control VCAP that uses frame keyfields and previously classified keyfields to apply e.g. policing, trapping or mirroring to frames. The ES2 VCAP has 2 lookups and they are accessible with a TC chain id: - chain 20000000: ES2 Lookup 0 - chain 20100000: ES2 Lookup 1 As the other Sparx5 VCAPs the ES2 VCAP has its own lookup/port keyset configuration that decides which keys will be used for matching on which traffic type. The ES2 VCAP has these traffic classifications: - IPv4 frames - IPv6 frames - Other frames The ES2 VCAP can match on an ISDX key (Ingress Service Index) as one of the frame metadata keyfields. The IS0 VCAP can update this key using its actions, and this allows a IS0 VCAP rule to be linked to an ES2 rule. This is similar to how the IS0 VCAP and the IS2 VCAP use the PAG (Policy Association Group) keyfield to link rules. From user space this is exposed via "chain offsets", so an IS0 rule with a "goto chain 20000015" action will use an ISDX key value of 15 to link to a rule in the ES2 VCAP attached to the same chain id. Steen Hegelund (8): net: microchip: sparx5: Add support for getting keysets without a type id net: microchip: sparx5: Improve the IP frame key match for IPv6 frames net: microchip: sparx5: Improve error message when parsing CVLAN filter net: microchip: sparx5: Add ES2 VCAP model and updated KUNIT VCAP model net: microchip: sparx5: Add ES2 VCAP keyset configuration for Sparx5 net: microchip: sparx5: Add ingress information to VCAP instance net: microchip: sparx5: Add TC support for the ES2 VCAP net: microchip: sparx5: Add KUNIT tests for enabling/disabling chains .../ethernet/microchip/lan966x/lan966x_main.h | 3 +- .../ethernet/microchip/lan966x/lan966x_tc.c | 2 +- .../microchip/lan966x/lan966x_tc_flower.c | 16 +- .../microchip/lan966x/lan966x_vcap_impl.c | 3 + .../ethernet/microchip/sparx5/sparx5_main.c | 1 + .../microchip/sparx5/sparx5_main_regs.h | 227 +++- .../microchip/sparx5/sparx5_tc_flower.c | 57 +- .../microchip/sparx5/sparx5_vcap_ag_api.c | 1166 ++++++++++++++++- .../microchip/sparx5/sparx5_vcap_debugfs.c | 117 ++ .../microchip/sparx5/sparx5_vcap_impl.c | 786 +++++++++-- .../microchip/sparx5/sparx5_vcap_impl.h | 34 + .../net/ethernet/microchip/vcap/vcap_ag_api.h | 11 +- .../net/ethernet/microchip/vcap/vcap_api.c | 36 +- .../net/ethernet/microchip/vcap/vcap_api.h | 1 + .../ethernet/microchip/vcap/vcap_api_client.h | 2 +- .../microchip/vcap/vcap_api_debugfs.c | 6 +- .../microchip/vcap/vcap_api_debugfs_kunit.c | 4 + .../ethernet/microchip/vcap/vcap_api_kunit.c | 66 + .../microchip/vcap/vcap_model_kunit.c | 14 +- 19 files changed, 2390 insertions(+), 162 deletions(-)