Message ID | 20230114134242.3737446-1-steen.hegelund@microchip.com |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp288905wrn; Sat, 14 Jan 2023 05:44:46 -0800 (PST) X-Google-Smtp-Source: AMrXdXuNWFgsEwSaWOrOR3dpgS+NrYIFeSOnP9QzX4gIfhKJoVjMFf7clVAmmCDRiOBqa95ayS41 X-Received: by 2002:a17:907:6292:b0:846:56fe:6c68 with SMTP id nd18-20020a170907629200b0084656fe6c68mr82651514ejc.21.1673703886032; Sat, 14 Jan 2023 05:44:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673703886; cv=none; d=google.com; s=arc-20160816; b=l6tnaGp/Uf0eYZejuMre3zSkxdRhnRfY9gE2Ayryc/8ZgzbyBy+JJECu5vO6c6itL0 BaCuyvdcmmQJBSh9SkuJyqyLUnvfYSUarljrDAkm9zuL4gePZ4x+pxaqJS4jtRQyLY2S rZNDjojVzYYVhkYjEtEZDXTkcmfCBarQqxlq1f10Jah6xgE6RQol/c13rt5lYDOujSUj lNTITf0wBmQ8yodTKHTV8EnwgkI0LTIwsgO7sq5sP6ZEP2Ptpme5j2TzyI0CQ0nQxmS6 qHimLwyZc/MCQ/wKw4N1rDXxZ34T7WXJEnI/+dIUHVm7CZHlZIC+PZbKewi7ikGwOAKS cOjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=1MCq4x4BiMB/sg/2nV2PcdKagZLc9o9Hdcro8LbS7ao=; b=ky+cHcmAjBfRS1dZVv/Yq+jZRy7J5tuE8liFTHmtB3yeXK5J8CMfg4FBgMPLpvgzyt ifvP5GYD3l8hS+QZ15d765LRuylRgINN5cX6zwsfItVXIvFKBmYIQB/+9sDh41ddju/M Cu+9ODyIBNFvJJPNfgN+ztqt+5RETFeOsqgcqpw6K9OBUuh9OJT7Nh8Lt51ahqq9w8mD li7VXw7TZSOjowgkiwY2Y31gYy0kVISVgoublYt5ApynOzF4BHClUfN+qlBG1p0QPvf8 +d+HwcBoevIFtoJU8yFUIfQNY0BN3Oij99lG2E3xW3ZlglmdWGnyoycayZ9Adtesqtbr O17A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=wBTby1kH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cs14-20020a170906dc8e00b00863bde89120si9401963ejc.128.2023.01.14.05.44.21; Sat, 14 Jan 2023 05:44:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=wBTby1kH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229674AbjANNmz (ORCPT <rfc822;limurcpp@gmail.com> + 99 others); Sat, 14 Jan 2023 08:42:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49276 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229739AbjANNmy (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sat, 14 Jan 2023 08:42:54 -0500 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 86A25524F; Sat, 14 Jan 2023 05:42:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1673703772; x=1705239772; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=EgsloK4GNcROOIjStl6+TFXiEnL7mEEToz3XHFGbjvg=; b=wBTby1kHpL/lBUZ8up8AhK9AUz5zDG4ejyBn/4/TFtghMJwQtOMrRxGq OZHfYY8zPi285kD1/TE5fAbyUKtgUqOvY6qzlrh5ca731VGLbWYkL25yh y3XGDKwkxBCixLgoUJ0rzFZRyOZRpmPUYaxFM88fwyS5DsKJB1C9gKiaW 79CiF51rmCDrlUQlyG5TTYRuIcpwZH60pwHA/yHkgmkSL8870doqSDFCd KK6bGv3BYE89Uywz+SeET6tpeoPt+gS15cvYSlGDxioyjsFXxFdtKiczp eU7SwIpIIBXrP3a5gVEzaZIyeUqXBzrgcZ8eum1aW76+aaEoeFpJmJeVP g==; X-IronPort-AV: E=Sophos;i="5.97,216,1669100400"; d="scan'208";a="192264067" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa4.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 14 Jan 2023 06:42:51 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) 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; Sat, 14 Jan 2023 06:42:49 -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.16 via Frontend Transport; Sat, 14 Jan 2023 06:42:46 -0700 From: Steen Hegelund <steen.hegelund@microchip.com> To: "David S . Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com> CC: Steen Hegelund <steen.hegelund@microchip.com>, <UNGLinuxDriver@microchip.com>, Randy Dunlap <rdunlap@infradead.org>, "Casper Andersson" <casper.casan@gmail.com>, Russell King <rmk+kernel@armlinux.org.uk>, Wan Jiabing <wanjiabing@vivo.com>, "Nathan Huckleberry" <nhuck@google.com>, <linux-kernel@vger.kernel.org>, <netdev@vger.kernel.org>, <linux-arm-kernel@lists.infradead.org>, "Steen Hegelund" <Steen.Hegelund@microchip.com>, Daniel Machon <daniel.machon@microchip.com>, Horatiu Vultur <horatiu.vultur@microchip.com>, Lars Povlsen <lars.povlsen@microchip.com>, Dan Carpenter <error27@gmail.com>, Michael Walle <michael@walle.cc> Subject: [PATCH net-next v4 0/8] Add support for two classes of VCAP rules Date: Sat, 14 Jan 2023 14:42:34 +0100 Message-ID: <20230114134242.3737446-1-steen.hegelund@microchip.com> X-Mailer: git-send-email 2.39.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1755005726078736416?= X-GMAIL-MSGID: =?utf-8?q?1755005726078736416?= |
Series |
Add support for two classes of VCAP rules
|
|
Message
Steen Hegelund
Jan. 14, 2023, 1:42 p.m. UTC
This adds support for two classes of VCAP rules: - Permanent rules (added e.g. for PTP support) - TC user rules (added by the TC userspace tool) For this to work the VCAP Loopups must be enabled from boot, so that the "internal" clients like PTP can add rules that are always active. When the TC tool add a flower filter the VCAP rule corresponding to this filter will be disabled (kept in memory) until a TC matchall filter creates a link from chain 0 to the chain (lookup) where the flower filter was added. When the flower filter is enabled it will be written to the appropriate VCAP lookup and become active in HW. Likewise the flower filter will be disabled if there is no link from chain 0 to the chain of the filter (lookup), and when that happens the corresponding VCAP rule will be read from the VCAP instance and stored in memory until it is deleted or enabled again. Version History: ================ v4 Removed a leftover 'Fixes' tag from v2. No functional changes. v3 Removed the change that allowed rules to always be added in the LAN996x even though the lookups are not enabled (Horatiu Vultur). This was sent separately to net instead. Removed the 'Fixes' tags due to the patch sent to net by Horatiu Vultur. Added a check for validity of the chain source when enabling a lookup. v2 Adding a missing goto exit in vcap_add_rule (Dan Carpenter). Added missing checks for error returns in vcap_enable_rule. v1 Initial version Steen Hegelund (8): net: microchip: vcap api: Erase VCAP cache before encoding rule net: microchip: sparx5: Reset VCAP counter for new rules net: microchip: vcap api: Always enable VCAP lookups net: microchip: vcap api: Convert multi-word keys/actions when encoding net: microchip: vcap api: Use src and dst chain id to chain VCAP lookups net: microchip: vcap api: Check chains when adding a tc flower filter net: microchip: vcap api: Add a storage state to a VCAP rule net: microchip: vcap api: Enable/Disable rules via chains in VCAP HW .../ethernet/microchip/lan966x/lan966x_goto.c | 10 +- .../ethernet/microchip/lan966x/lan966x_main.h | 3 +- .../microchip/lan966x/lan966x_tc_flower.c | 30 +- .../microchip/lan966x/lan966x_tc_matchall.c | 16 +- .../microchip/lan966x/lan966x_vcap_impl.c | 21 +- .../microchip/sparx5/sparx5_tc_flower.c | 28 +- .../microchip/sparx5/sparx5_tc_matchall.c | 16 +- .../microchip/sparx5/sparx5_vcap_debugfs.c | 2 +- .../microchip/sparx5/sparx5_vcap_impl.c | 29 +- .../net/ethernet/microchip/vcap/vcap_api.c | 767 +++++++++++++----- .../net/ethernet/microchip/vcap/vcap_api.h | 5 - .../ethernet/microchip/vcap/vcap_api_client.h | 8 +- .../microchip/vcap/vcap_api_debugfs.c | 57 +- .../microchip/vcap/vcap_api_debugfs_kunit.c | 10 +- .../ethernet/microchip/vcap/vcap_api_kunit.c | 32 +- .../microchip/vcap/vcap_api_private.h | 12 +- 16 files changed, 699 insertions(+), 347 deletions(-)
Comments
Hello: This series was applied to netdev/net-next.git (master) by David S. Miller <davem@davemloft.net>: On Sat, 14 Jan 2023 14:42:34 +0100 you wrote: > This adds support for two classes of VCAP rules: > > - Permanent rules (added e.g. for PTP support) > - TC user rules (added by the TC userspace tool) > > For this to work the VCAP Loopups must be enabled from boot, so that the > "internal" clients like PTP can add rules that are always active. > > [...] Here is the summary with links: - [net-next,v4,1/8] net: microchip: vcap api: Erase VCAP cache before encoding rule https://git.kernel.org/netdev/net-next/c/6573f71ae72f - [net-next,v4,2/8] net: microchip: sparx5: Reset VCAP counter for new rules https://git.kernel.org/netdev/net-next/c/95fa74148daa - [net-next,v4,3/8] net: microchip: vcap api: Always enable VCAP lookups https://git.kernel.org/netdev/net-next/c/01ef75a257fa - [net-next,v4,4/8] net: microchip: vcap api: Convert multi-word keys/actions when encoding https://git.kernel.org/netdev/net-next/c/33e3a273fd4f - [net-next,v4,5/8] net: microchip: vcap api: Use src and dst chain id to chain VCAP lookups https://git.kernel.org/netdev/net-next/c/cfd9e7b74a1e - [net-next,v4,6/8] net: microchip: vcap api: Check chains when adding a tc flower filter https://git.kernel.org/netdev/net-next/c/784c3067d094 - [net-next,v4,7/8] net: microchip: vcap api: Add a storage state to a VCAP rule https://git.kernel.org/netdev/net-next/c/814e7693207f - [net-next,v4,8/8] net: microchip: vcap api: Enable/Disable rules via chains in VCAP HW https://git.kernel.org/netdev/net-next/c/18a15c769d4a You are awesome, thank you!