From patchwork Thu Oct 27 14:42:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steen Hegelund X-Patchwork-Id: 13022228 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 75BB8FA3740 for ; Thu, 27 Oct 2022 14:44:33 +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=1i+Eq3xOWAuwcbvP2AiYxf2mAu9/WRsKTXKx28PxgJY=; b=5C8VXJV6GkoiAV p7i9Y+0loE+llSyH5EzONNPeIRM/naD3W2Jmp4j/mXb72KxOzoqlk9ZzQrICTW8N5wVXLzNYt1TyF Y2DR8ZH/B8VPCf/W3nTAXw87R7ttKIXP5fYfcA2JAyr1dTwRruVl0DIp6s/enYtnLfeDuE/gftcJj DLI3UfhHacXKJumQH8uu0/DXjaLPQHRkoBv8B1cveHSRJ3UpPptqu3P/JYEXfXhGuBE6+gkD0N1/z 7y8Mi4y0HLsDBEDdbZTwVi3XPYRANezi+ekmVIe6t/l722cN4U64KpBe6QpAl1VnfrgAHrjBlzAMM b4MCnzRLtjmr8VebMhZQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oo46Y-00Dpvr-S2; Thu, 27 Oct 2022 14:43:34 +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 1oo46L-00DpqD-FV for linux-arm-kernel@lists.infradead.org; Thu, 27 Oct 2022 14:43:23 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1666881802; x=1698417802; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=v0XTJ3Nv1TiA5oAIdEGKqGuDbvZqe4fFSa+/9Fdppj0=; b=mXAYJe4Skkq7OiWGhSMVMOP8qrCwSM6AAvI/W5ampXC6+c2mL374aCSz bfAy6GaaNFds0+dPzLLgbkCNngka/PdvKJ/lI3XIr2GrAMXBR7XHATyHi bp3TT1/3x4tXOfxJxE4P0BOFBwrIvhLMSytiOsqFKVs3OlHDLA4Jb+Phh i1soQX8Jz+q/SRogbyfCQLH7eBZCdJXNNj+edjckRZVEzZ6leKxTym5Lt 1xnPJ0UXB9g5FKT246nvmxPShUTnbth/cIo8I80TAMHbS0z4H5VcGLu5O ZB1Kt9r39FtN2Ekh+T7mL2qaB52ZK71jLeYi/6rZANXNu4RtcZ9m6VzaP w==; X-IronPort-AV: E=Sophos;i="5.95,217,1661842800"; d="scan'208";a="186548683" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa5.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 27 Oct 2022 07:43:18 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) 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.12; Thu, 27 Oct 2022 07:43:16 -0700 Received: from den-dk-m31857.microchip.com (10.10.115.15) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server id 15.1.2507.12 via Frontend Transport; Thu, 27 Oct 2022 07:43: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" , , , , "Daniel Machon" , Horatiu Vultur , Lars Povlsen Subject: [PATCH net-next 0/5] Extend TC key support for Sparx5 IS2 VCAP Date: Thu, 27 Oct 2022 16:42:55 +0200 Message-ID: <20221027144300.2936955-1-steen.hegelund@microchip.com> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221027_074321_586856_48C4DCD4 X-CRM114-Status: GOOD ( 11.17 ) 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 extended tc flower filter key support for the Sparx5 VCAP functionality. It builds on top of the initial IS2 VCAP support found in this series: https://lore.kernel.org/all/20221020130904.1215072-1-steen.hegelund@microchip.com/ Overview: ========= The added flower filter key (dissector) support is this: - ipv4_addr (sip and dip) - ipv6_addr (sip and dip) - control (IPv4 fragments) - portnum (tcp and udp port numbers) - basic (L3 and L4 protocol) - vlan (outer vlan tag info) - tcp (tcp flags) - ip (tos field) The IS2 VCAP supports classified VLAN information which amounts to the outer VLAN info in case of multiple tags. Functionality: ============== Before frames can match IS2 VCAP rules with e.g an IPv4 source address, the IS2 VCAPs keyset configuration must include keyset that contains a IPv4 source address and this must be configured for the lookup/port/traffic-type that you want to match on. The Sparx5 IS2 VCAP has the following traffic types: - Non-Ethernet frames - IPv4 Unicast frames - IPv4 Multicast frames - IPv6 Unicast frames - IPv6 Multicast frames - ARP frames So to cover IPv4 traffic the two IPv4 categories must be configured with a keyset that contains IPv4 address information such as the VCAP_KFS_IP4_TCP_UDP keyset. The IPv4 and IPv6 traffic types are configured with useful default keysets, in later series we will use the tc template functionality when we want to change these defaults. Delivery: ========= This is current plan for delivering the full VCAP feature set of Sparx5: - support for TC protocol all - debugfs support for inspecting rules - TC flower filter statistics using VCAP counters - Sparx5 IS0 VCAP support and more TC keys and actions to support this - add TC policer and drop action support (depends on the Sparx5 QoS support upstreamed separately) - Sparx5 ES0 VCAP support and more TC actions to support this - TC flower template support - TC matchall filter support for mirroring and policing ports - TC flower filter mirror action support - Sparx5 ES2 VCAP support Steen Hegelund (5): net: microchip: sparx5: Differentiate IPv4 and IPv6 traffic in keyset config net: microchip: sparx5: Adding more tc flower keys for the IS2 VCAP net: microchip: sparx5: Match keys in configured port keysets net: microchip: sparx5: Let VCAP API validate added key- and actionfields net: microchip: sparx5: Adding KUNIT tests of key/action values in VCAP API .../microchip/sparx5/sparx5_tc_flower.c | 410 +++++++++++++++++- .../microchip/sparx5/sparx5_vcap_impl.c | 168 ++++++- .../net/ethernet/microchip/vcap/vcap_api.c | 251 ++++++++++- .../ethernet/microchip/vcap/vcap_api_client.h | 13 + .../ethernet/microchip/vcap/vcap_api_kunit.c | 406 +++++++++++++++++ 5 files changed, 1215 insertions(+), 33 deletions(-)