From patchwork Tue Jan 24 10:45:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steen Hegelund X-Patchwork-Id: 13114071 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 28D6EC38142 for ; Tue, 24 Jan 2023 13:08:46 +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=iguaOcX4MlJztTbvtANN+fjldCNORSyjLVBVPjVQHhc=; b=WZWkEmsYYHGAoX 00Tcg2d9cEQUfvK7cESLraQfbHPFfC4mQ9yMq7hMk9PsAuP2hUj5+N0U/NazK/tsx8Z7QvPXIS7jn nQ2KFdI0u/VlFx1O8Eatsk3Y057HjLH4XAcw72k3eK0f+s1aFTmhAhCkQcPf+/8Xb3ePWmduN8SSX hLPGf/iLJbul9bck/ZwQEAvKvJ20oJVIhsjWNi3OgN5bxGPaEQjXq4EiQ5SqlKvG7Z0rx41d7ilH/ Oi7QRzMn6t+jD1qsFo8EiKBQGFuN2C/VRe2ri0bi2vgIupJUek5lUPMXuspRkBpqgZmOb9Cg4BdLC yfbkhXgm9ZC7A0Y/2ByA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pKJ1N-003rUX-GA; Tue, 24 Jan 2023 13:07:29 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pKIxe-003pix-NL for linux-arm-kernel@bombadil.infradead.org; Tue, 24 Jan 2023 13:03:38 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Type:Content-Transfer-Encoding :MIME-Version:Message-ID:Date:Subject:CC:To:From:Sender:Reply-To:Content-ID: Content-Description:In-Reply-To:References; bh=LVSbrwhQLDUJ8wattpqo6YjAtPObR3SvjV9df5bVp6w=; b=JZheqONk9ywTq1VW96WXOXqRea l24TaIwrWhlHi4+UmtAA+HXZ3/A49oMJO/FmxeVQnAjJlJ5XACDkXA+eTxGnFUeqN6RvUP6sY2GLg ilkU6eRxMwk+thF9O/vx8GaxTkEls+Lypm7kGaMBPlPD77iZSUrwEZVv8c8+MpeDZev+0KhNJ2Prn A2oAYCXTV5IznbyDaz14wHXxXY3Nq8KaXZbjPDeRr9x3HLVGCFar0eQH7pgzIB/fYgVaVoqaWrpEu 2r+XG50W5K7aTi9bkTxFtDsBL0ghE7CYMBMSC9jkZEEpLEbb5ujoR8L1bxKNxr5YAt68dl8WXx4sH LGJuN60A==; Received: from esa.microchip.iphmx.com ([68.232.153.233]) by desiato.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pKGnX-001n98-2y for linux-arm-kernel@lists.infradead.org; Tue, 24 Jan 2023 10:45:07 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1674557133; x=1706093133; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=RwiF2ESGcXxGOh6GWmHVLESVsmvz3aB1KmPhfiNoAWg=; b=t1+g+p9j6iyJ+BLicoTfdvarV4PxtPC9ZD3OM2lNvZjXKb+50HQaQ8aU e7P9UtNPQ7j0WPC9HL/5FyjIZI17LqPs4jbc2Tq30FVTTMfVJ4Z+qjtcV KbyVueE1RCs6jgoj9/hthRkuS/TEx+Goh2FmQnmMN2R6M24Yke1RXvnwa UaphfNn6smHJ81t0+8B3tt8sZw2jpO6r0rTqQwCAIluKUjiOM/rMOXQvy 7yjEQ9OldQHY8QsOzM6SatJTZA3EsAav5K8tGQTxsuMHQMbuzQinZPBvp eWE0cs2p/ciR/13TNDH2EDKTe2s7SivK8Uz9gEY5GmqXw17w+pe532hi8 A==; X-IronPort-AV: E=Sophos;i="5.97,242,1669100400"; d="scan'208";a="197853103" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa3.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 24 Jan 2023 03:45:19 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) 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; Tue, 24 Jan 2023 03:45:17 -0700 Received: from den-dk-m31857.microchip.com (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; Tue, 24 Jan 2023 03:45:13 -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 v2 0/8] Adding Sparx5 IS0 VCAP support Date: Tue, 24 Jan 2023 11:45:03 +0100 Message-ID: <20230124104511.293938-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-20230124_104504_881394_0806E877 X-CRM114-Status: GOOD ( 12.04 ) 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 Ingress Stage 0 (IS0) VCAP (Versatile Content-Aware Processor) support for the Sparx5 platform. The IS0 VCAP (also known in the datasheet as CLM) is a classifier VCAP that mainly extracts frame information to metadata that follows the frame in the Sparx5 processing flow all the way to the egress port. The IS0 VCAP has 4 lookups and they are accessible with a TC chain id: - chain 1000000: IS0 Lookup 0 - chain 1100000: IS0 Lookup 1 - chain 1200000: IS0 Lookup 2 - chain 1300000: IS0 Lookup 3 - chain 1400000: IS0 Lookup 4 - chain 1500000: IS0 Lookup 5 Each of these lookups have their own port keyset configuration that decides which keys will be used for matching on which traffic type. The IS0 VCAP has these traffic classifications: - IPv4 frames - IPv6 frames - Unicast MPLS frames (ethertype = 0x8847) - Multicast MPLS frames (ethertype = 0x8847) - Other frame types than MPLS, IPv4 and IPv6 The IS0 VCAP has an action that allows setting the value of a PAG (Policy Association Group) key field in the frame metadata, and this can be used for matching in an IS2 VCAP rule. This allow rules in the IS0 VCAP to be linked to rules in the IS2 VCAP. The linking is exposed by using the TC "goto chain" action with an offset from the IS2 chain ids. As an example a "goto chain 8000001" will use a PAG value of 1 to chain to a rule in IS2 Lookup 0. Version History: ================ v2 Added corrections suggested by Dan Carpenter. v1 Initial version Steen Hegelund (8): net: microchip: sparx5: Add IS0 VCAP model and updated KUNIT VCAP model net: microchip: sparx5: Add IS0 VCAP keyset configuration for Sparx5 net: microchip: sparx5: Add actionset type id information to rule net: microchip: sparx5: Add TC support for IS0 VCAP net: microchip: sparx5: Add TC filter chaining support for IS0 and IS2 VCAPs net: microchip: sparx5: Add automatic selection of VCAP rule actionset net: microchip: sparx5: Add support for IS0 VCAP ethernet protocol types net: microchip: sparx5: Add support for IS0 VCAP CVLAN TC keys .../microchip/sparx5/sparx5_main_regs.h | 64 +- .../microchip/sparx5/sparx5_tc_flower.c | 227 +- .../microchip/sparx5/sparx5_vcap_ag_api.c | 1110 ++++++++- .../microchip/sparx5/sparx5_vcap_debugfs.c | 131 +- .../microchip/sparx5/sparx5_vcap_impl.c | 401 +++- .../microchip/sparx5/sparx5_vcap_impl.h | 61 + .../net/ethernet/microchip/vcap/vcap_ag_api.h | 336 +-- .../net/ethernet/microchip/vcap/vcap_api.c | 184 +- .../net/ethernet/microchip/vcap/vcap_api.h | 7 + .../ethernet/microchip/vcap/vcap_api_client.h | 2 + .../ethernet/microchip/vcap/vcap_api_kunit.c | 2 +- .../microchip/vcap/vcap_model_kunit.c | 1994 ++--------------- 12 files changed, 2360 insertions(+), 2159 deletions(-)