From patchwork Tue Nov 22 14:59:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steen Hegelund X-Patchwork-Id: 13052475 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 DC30DC433FE for ; Tue, 22 Nov 2022 15:03:05 +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=ju1eKrwtYSu2zw9OjTEoqIzqFgkgLqyD9DeJKQmyP7Y=; b=nBKMKYMHa+9KtR Qmv9v9Z5aQc8qIQdc26q0SU6sBfyJ7fn2xFMDEmrR9yQliHbWJzrd3jhG7N3Xr/ulI9wsezjk2Th5 Jm8pVRWb6qbDNvkoFwl9wAr6muwiVed3kMXW0wYvZkhT7rkzEkbgT/eX27+U8lgZ8gL7AQAQgl+J6 szvbd3z+Dh8FmgB1TjGL5Hyi3RxageFcq5OhmDEW82qGax2365sb3Q413ihnKEv0sqrTFwC8opTyX 7+20rLP67CfKG5cRWWfBnEjw69bTKMBk4Eoq+d7UdXn3cwADtarX+f5mwy9Sx0ywCkzXDCcnJKNCZ OgXiCbQmvrN+k2Is37lg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oxUld-00A9ML-Dg; Tue, 22 Nov 2022 15:00:58 +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 1oxUks-00A924-C3 for linux-arm-kernel@lists.infradead.org; Tue, 22 Nov 2022 15:00:17 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1669129210; x=1700665210; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=yoaRy2gDtW63BXtnZKqLDxjD74iXcQjBoXtKtoIvfa4=; b=VPuqBOaGD5q6XC20I+1goYqKZKGi0JO6D90vRRoeO2pEGSJCXeOM5Kri XkVy3hFlKVrnQK/ixGkM+tokYO0PIewS5HKKPLc7ZI8efeNKMFQZLA7ty Bo/9P5ovyWsCrL95lnx+OphGmTQ4F7HgsnYaVXWDYGqYnr9ZOBimXCSW6 Jly01c2BS80uYlsOw5g+f3tDTd3P+PAvkqRoZe1MH1iHBTR3dR1DyMURi wPJYAyeWok5Owx8H80HL6QJZy8nbjbrreLdYoh/AV8JUJKEHrPs7oQcXA 57roT6Qs7hP1RS05pvIVn58D0j56HnDrtbU7LyWR567ijkfRvMZHCgpbr g==; X-IronPort-AV: E=Sophos;i="5.96,184,1665471600"; d="scan'208";a="184689520" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa4.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 22 Nov 2022 07:59:51 -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.12; Tue, 22 Nov 2022 07:59:43 -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.12 via Frontend Transport; Tue, 22 Nov 2022 07:59:40 -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 Subject: [PATCH net-next 0/4] TC protocol all support in Sparx5 IS2 VCAP Date: Tue, 22 Nov 2022 15:59:34 +0100 Message-ID: <20221122145938.1775954-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-20221122_070010_515070_4236F829 X-CRM114-Status: GOOD ( 13.85 ) 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 support for the TC flower filters 'protocol all' clause in the Sparx5 IS2 VCAP. It builds on top of the initial IS2 VCAP support found in these series: https://lore.kernel.org/all/20221020130904.1215072-1-steen.hegelund@microchip.com/ https://lore.kernel.org/all/20221109114116.3612477-1-steen.hegelund@microchip.com/ https://lore.kernel.org/all/20221111130519.1459549-1-steen.hegelund@microchip.com/ https://lore.kernel.org/all/20221117213114.699375-1-steen.hegelund@microchip.com/ Functionality: ============== As the configuration for the Sparx5 IS2 VCAP consists of one (or more) keyset(s) for each lookup/port per traffic classification, it is not always possible to cover all protocols with just one ordinary VCAP rule. To improve this situation the driver will try to find out what keysets a rule will need to cover a TC flower "protocol all" filter and then compare this set of keysets to what the hardware is currently configured for. In case multiple keysets are needed then the driver can create a rule per rule size (e.g. X6 and X12) and use a mask on the keyset type field to allow the VCAP to match more than one keyset with just one rule. This is possible because the keysets that have the same size typically has many keys in common, so the VCAP rule keys can make a common match. The result is that one TC filter command may create multiple IS2 VCAP rules of different sizes that have a type field with a masked type id. Delivery: ========= This is current plan for delivering the full VCAP feature set of Sparx5: - Sparx5 IS0 VCAP support - TC policer and drop action support (depends on the Sparx5 QoS support upstreamed separately) - Sparx5 ES0 VCAP support - 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 (4): net: microchip: sparx5: Support for copying and modifying rules in the API net: microchip: sparx5: Support for TC protocol all net: microchip: sparx5: Support for displaying a list of keysets net: microchip: sparx5: Add VCAP filter keys KUNIT test .../microchip/sparx5/sparx5_tc_flower.c | 209 +++++++++++++++++- .../microchip/sparx5/sparx5_vcap_impl.c | 18 +- .../microchip/sparx5/sparx5_vcap_impl.h | 13 ++ .../net/ethernet/microchip/vcap/vcap_api.c | 185 +++++++++++++++- .../ethernet/microchip/vcap/vcap_api_client.h | 22 +- .../microchip/vcap/vcap_api_debugfs.c | 98 ++++---- .../microchip/vcap/vcap_api_debugfs_kunit.c | 20 +- .../ethernet/microchip/vcap/vcap_api_kunit.c | 200 ++++++++++++++++- .../microchip/vcap/vcap_api_private.h | 4 - 9 files changed, 708 insertions(+), 61 deletions(-)