From patchwork Fri Jan 20 09:08:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steen Hegelund X-Patchwork-Id: 13109462 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 E9402C25B50 for ; Fri, 20 Jan 2023 09:10:03 +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=6cnUNRm3gfWQp0j7sNJsI7zqFQTb/8Q9h5/lPg70QMA=; b=Tl3aZiyho5v7MG dMgE5eYdHBixIUkUruWxN+uoFsi4L1z3ZQnGuKPLBwybGV1aEm4dSNVsdYRO5oygZTI6eA3B+hZbl h1FNkqN3M8dfeS6UUn2pOq7y/4eL1ubuaakkKR3TkM2Hh3PCc2aE2QVOBBpFIoqUVBauplP+OSwKL lvj/+x+Tfb457cTcu/VJe1XZN3tlnZLD6arWMLp5ICt+f0HNt3RAizjYo621BLQ5/k/ca4L7GOpwh HP6oM16wN+Suognjxl8dbo358IwJBWgy/VD/qJWSp6y7NOUMC6LqNDW7QAt/KpDfdHxo5EhlOEqEd W1xJ9NZFEC91YcHYkZtw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pInOB-009DcC-J0; Fri, 20 Jan 2023 09:08:48 +0000 Received: from esa.microchip.iphmx.com ([68.232.153.233]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pInO6-009DZp-Gd for linux-arm-kernel@lists.infradead.org; Fri, 20 Jan 2023 09:08:44 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1674205723; x=1705741723; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=FYB5GHXd7qMXK5pW/4qFeibiAIi0jeycEJNE6wVIobo=; b=pb03iHrMrVcrHGaDKVQ/52KhoNAP8/T11X24QkYItZAuljr1pEWIPTI0 7lDHGqV2BSafXJBFaQfMgmAxtGcFGdHk+hBUlK2hZZ9S3FZ0Qe0B9zALf gJr/l8Rm3J2qRylybUOFz/pBrZmYJDjiP0lq27oscDm6p8aUobXXPb7DZ l7IlDbw2RGbzJXkLMgAdN7OsR+gcBQ9P2giTgW3Bz56lWXOVXnHRld1O4 C9eT8tynNF2U4lMgjWLWi4Qx2SJeHOUzzQjyme12JeF7CbzB9A3uh0tkW L8dz4gvWRP3Fz0FMxf+DQVJbIsROZmZaEnbD5V+WPXZOf3h8+CXh2rQbM g==; X-IronPort-AV: E=Sophos;i="5.97,231,1669100400"; d="scan'208";a="197598466" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa5.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 20 Jan 2023 02:08:40 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Fri, 20 Jan 2023 02:08:39 -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; Fri, 20 Jan 2023 02:08:36 -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 IS0 VCAP support Date: Fri, 20 Jan 2023 10:08:23 +0100 Message-ID: <20230120090831.20032-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-20230120_010842_768900_9D0C5643 X-CRM114-Status: GOOD ( 10.87 ) 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. 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(-)