From patchwork Wed Nov 23 15:25:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steen Hegelund X-Patchwork-Id: 13054087 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 4D59FC4332F for ; Wed, 23 Nov 2022 18:13: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=xfg89Y+8mExCVck52HVC4vOIF/8wVFdrxmgl2/pz16g=; b=hfbeXQoTuh3LeC 9fQ42s5F78EGxqWCoKYHYSDTEn0THYC4e979G8XRagp2ezqvUQl+vFAYHOd7ynwGgLsl/HGEoRq+o WXGWr5ocwzJ8MMHrQXC3kX/YS60yb1gDpWcQBA/fBIFdFb9LipVJrFgdp0Y51//cCkAyW301baEL+ s7WgK9dhwFKYM8b+jrUiWiai4wrltRMOC3DBMA2oAZBh13WS38+rXL2+wb50Od8DqHTOwwoZs0Tiw QShbeze82NRsERCNV7cO2wX+nhz6FnzpTcurhjXDzkEqMnXK+1KzxU0xCjH8RpVIjsCt8SkZbJuWg mUeSd70I2w3cGGWnKpIA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oxuDu-001T3v-Tj; Wed, 23 Nov 2022 18:11: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 1oxu9C-001QSa-Of for linux-arm-kernel@lists.infradead.org; Wed, 23 Nov 2022 18:07:02 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1669226818; x=1700762818; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=bKG2HOj9nnlSS7G6luWwtI1OPs62ZJxGmE/IN3HYTWI=; b=cIug/hJAeNud+oOx6jWoy24UihvbBnb/9xqbPKwBcQ9i0I/0959MfnGO gl+uN+fpQwoTsCulVpTiD/4jqqwHwbdFiJn1qEPK3QPsgJ+D9OW+Gc0zJ Z2MmzOoajTAH/iIektudc6Yzu46pWyvP0vhCA+JW2l+NOPAGWyxx2mfK6 iYd7wfEiboPZ/iYye9xbPzBT+12CarKrsxc6aq/tDTeGOoKVeKH0q4Xz8 L6hIH+Jk6ye3jPPkqMIQac+rWfRu3eR5yjWlcL5SJFsMqcZp0WpCdOKxJ mufKD1RRlozbUsVe57Rl6dM7SkGCBZpS//gaEn1IdYlYszov8V0nDR2wO Q==; X-IronPort-AV: E=Sophos;i="5.96,187,1665471600"; d="scan'208";a="201127180" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa1.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 23 Nov 2022 08:25: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; Wed, 23 Nov 2022 08:25:51 -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; Wed, 23 Nov 2022 08:25:48 -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 v2 0/4] TC protocol all support in Sparx5 IS2 VCAP Date: Wed, 23 Nov 2022 16:25:41 +0100 Message-ID: <20221123152545.1997266-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-20221123_100658_899943_630C78D1 X-CRM114-Status: GOOD ( 15.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 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 Version History: ================ v2 Fixed a NULL return value compiler warning. Moved the new vcap_find_actionfield function a bit up in the file. v1 Initial version 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(-)