From patchwork Tue Mar 7 22:09:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Horatiu Vultur X-Patchwork-Id: 13164813 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 1C54AC678D5 for ; Tue, 7 Mar 2023 22:10:50 +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=tSlTB3pA2pEyjqhj/yWwgHYSehsr2QS4F2FhOYHRKi0=; b=nESc23Qw88++fC nD6cRhdpQmA9V8bOpYiMwfzhqfq3lq/p2dyPc/FkY7BrfEVt5cS+YH0P+M759B0WwxefjqoyrFoie O2dcf/XN+y6gF9jOuGkhYXgQFMFh6UKna4pt+h/MCIZ9OjfI/FNeimprM27FqHVhGuU0aF98C19DC 1HwEiWpmv96fINKPzciAQ9eBQ8j0Y7FhqQGJcrUzUONLpqfv2wVqCVpfNWHPSoebnywTatDpBdN/K c/n7p0xOxGKvo3+9RGuYR7gs2ukxxSMgwLcoF8206mghs3MzvO+mZ/nl2kzvmHcxcfcDH924yB1Mt GSrmRLd/zjIEJfKQseRw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pZfVH-002aIB-9L; Tue, 07 Mar 2023 22:09:51 +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 1pZfVC-002aFn-M7 for linux-arm-kernel@lists.infradead.org; Tue, 07 Mar 2023 22:09:48 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1678226986; x=1709762986; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=XUDBH90Ywy2lvsQPZLArMoZSilL67u+aRGzBmB/ErqA=; b=yml99/6Q7gDI1bq4Clyu9FTz0Vj4kt3Ub3mN7Xwj+DxIxmeqpjprA7mH P207JaQv6mG5fBasnueLImN3JOjRNsVjiclLjWXs1XJV6oHyijyrgC2zQ Z0cfUBMRw8ZFrWJGMiCxYmU/Ou5AzY7S5pOqh/ig9ygxOQq0yA9EmFepI kwtefmYb8f8Gb6X7C3sJ9LYSA+YBRsUnucswy8addQkTo9gJzW10paga+ q5piuvlWUJYIb6Pek5pJFyCextQMF93kKkOp//veOW5IfidZgh/iHdoSf wS1MppytfxHOLhMug8EU8Af95ah2+WF8clGolDhx41eY5hQv9to3U+rOt A==; X-IronPort-AV: E=Sophos;i="5.98,242,1673938800"; d="scan'208";a="215245446" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa1.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 07 Mar 2023 15:09:41 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) 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; Tue, 7 Mar 2023 15:09:41 -0700 Received: from soft-dev3-1.microsemi.net (10.10.115.15) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.2507.16 via Frontend Transport; Tue, 7 Mar 2023 15:09:39 -0700 From: Horatiu Vultur To: , , CC: , , , , , , , , Horatiu Vultur Subject: [PATCH net-next 0/5] net: lan966x: Add support for IS1 VCAP Date: Tue, 7 Mar 2023 23:09:24 +0100 Message-ID: <20230307220929.834219-1-horatiu.vultur@microchip.com> X-Mailer: git-send-email 2.38.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230307_140946_746828_40DDBC46 X-CRM114-Status: UNSURE ( 9.37 ) X-CRM114-Notice: Please train this message. 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 Provide the Ingress Stage 1 (IS1) VCAP (Versatile Content-Aware Processor) support for the Lan966x platform. The IS1 VCAP has 3 lookups and they are accessible with a TC chain id: - chain 1000000: IS1 Lookup 0 - chain 1100000: IS1 Lookup 1 - chain 1200000: IS1 Lookup 2 The IS1 is capable of different actions like rewrite VLAN tags, change priority of the frames, police the traffic, etc. These features will be added at a later point. The IS1 currently implements the 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. In this way a rule in IS0 VCAP can 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. For example "goto chain 8000001" will use a PAG value of 1 to chain to a rule in IS2 lookup 0. Horatiu Vultur (5): net: lan966x: Add IS1 VCAP model net: lan966x: Add IS1 VCAP keyset configuration for lan966x net: lan966x: Add TC support for IS1 VCAP net: lan966x: Add TC filter chaining support for IS1 and IS2 VCAPs net: lan966x: Add support for IS1 VCAP ethernet protocol types .../ethernet/microchip/lan966x/lan966x_main.h | 38 + .../ethernet/microchip/lan966x/lan966x_regs.h | 36 + .../microchip/lan966x/lan966x_tc_flower.c | 221 ++- .../microchip/lan966x/lan966x_vcap_ag_api.c | 1402 ++++++++++++++++- .../microchip/lan966x/lan966x_vcap_debugfs.c | 133 +- .../microchip/lan966x/lan966x_vcap_impl.c | 192 ++- .../net/ethernet/microchip/vcap/vcap_ag_api.h | 217 ++- .../microchip/vcap/vcap_api_debugfs_kunit.c | 4 +- 8 files changed, 2156 insertions(+), 87 deletions(-)