Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2128466rwb; Fri, 11 Nov 2022 05:32:38 -0800 (PST) X-Google-Smtp-Source: AA0mqf68lOOH10vRPhWQeZyJQSrcnc5bYRRKdCZQk+Wzve55ztGj8qExT0pwyhZL3MYtMjy3OEvP X-Received: by 2002:a63:a47:0:b0:470:30c5:5af with SMTP id z7-20020a630a47000000b0047030c505afmr1742735pgk.259.1668173557735; Fri, 11 Nov 2022 05:32:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668173557; cv=none; d=google.com; s=arc-20160816; b=Uk/6hymZJdjbGoI44i+W5DCJ5iWfyftsujtMrMecPkbGErjdpCTy5wn046REkgBMkK VTQxKKPGqeDUgvwmYh+CCAXfD7z0rwURk8QnqAkTmAYJ9wsSr4f2bXwEO5aC9OGeJB0p ojdFm8+cseoh7M/4yEg+mKUe9b4blNy5LQ1pJRPZ7OCrRQ3jBIgFdnKpkw0lQPC1HN/1 FGP1f7sbV/0PeloBrwI2uR5iUcnSiqZAIqG+kmSfbW4i9Fn8aiIAkWYlbGWFjZsDmaJR ng6LHbh0Q0IR6io0huBWFNkVMuJca6Ru6Orv03GhnEqJ5nRCnkb7EQPDJujFPICt8k4e Nx1w== 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=zTZV8MQHB9a4XpIYAS5OpgtPNcLVzx0iIWLa7sQSU6s=; b=wTagUa7dpoyERhP+gqBmmvIMX3ejmTzeoIDJSYA3NmqffezHZWCIGSJbs6ON6fL/tI GcJb1JaQ23dYUAkGXYZnaSWjk2wvm0SWyBW2VtuDbkKIKULceqVOg0CmOUorqDQgst3Y qqX8n+BWT33Di0IR9X7mwdsH5Wfy+n6EoXCuiDnRxPcMRryxBjC1vx6YwYmP40gBAxHT iIs26Pe3psfwFIsyUh/Q4TjOxI3jeFODdyp+ZM/dx/rL/26+jWdW0c9BnWCvcIWk/KM6 iUHpQt51AiB57z5TB6lLdWapN/Z15PBsaid+AkD/6D+z1bSuy1nAMF8NAUUV6vwuZ7y6 CrNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=cM+grD8T; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b11-20020a17090ae38b00b001fe1c9436b1si2475004pjz.86.2022.11.11.05.32.25; Fri, 11 Nov 2022 05:32:37 -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=cM+grD8T; 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 S233770AbiKKNFd (ORCPT + 92 others); Fri, 11 Nov 2022 08:05:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35532 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233217AbiKKNFc (ORCPT ); Fri, 11 Nov 2022 08:05:32 -0500 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 19E0F120A4; Fri, 11 Nov 2022 05:05:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1668171929; x=1699707929; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=OkhSa88+pvWXzzNAdUKByN9C89JcvFoOdQy9ZtA7Az4=; b=cM+grD8TaT0LhSUEiPn8h9wK/zm5Sh14+fbp2JVJZSmKlQkH//wQxVjk Q88LCEF1TjUv9pWc4c8csNpeaKehgIvSSUj7N5vE7ueRVf2g/YtmJJd+I dYOTZ2LQ6ZrTIHyphRrUdvlapOuL6b29T+cuuZrwmKtqGaoake3df4EcY KNQfYcAZXPc6t5dTzsLCYj9K58Qp1DMuKdr26944vIHX5sB+lN59cIDmA xmKRVxayZaX7fISPDh54oCtVwZ7t7E5kyYjlDTt3Wla/BvLyQkE9Y+PLB 9kcSaHpmJyXtM2OdEOSUxi84/tmF6TTkN1lP26rm1om6MwndxhBpD0itM Q==; X-IronPort-AV: E=Sophos;i="5.96,156,1665471600"; d="scan'208";a="123000811" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa6.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 11 Nov 2022 06:05:28 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.12; Fri, 11 Nov 2022 06:05:28 -0700 Received: from den-dk-m31857.microchip.com (10.10.115.15) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server id 15.1.2507.12 via Frontend Transport; Fri, 11 Nov 2022 06:05:24 -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 , Simon Horman , Louis Peens , "Wojciech Drewek" , Baowen Zheng , Maksym Glubokiy , Pablo Neira Ayuso Subject: [PATCH net-next 0/6] Add support for sorted VCAP rules in Sparx5 Date: Fri, 11 Nov 2022 14:05:13 +0100 Message-ID: <20221111130519.1459549-1-steen.hegelund@microchip.com> X-Mailer: git-send-email 2.38.1 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, 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: X-Mailing-List: linux-kernel@vger.kernel.org This provides support for adding Sparx5 VCAP rules in sorted order, VCAP rule counters and TC filter matching on ARP frames. 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/ Functionality ============= When a new VCAP rule is added the driver will now ensure that the rule is inserted in sorted order, and when a rule is removed, the remaining rules will be moved to keep the sorted order and remove any gaps in the VCAP address space. A VCAP rule is ordered using these 3 values: - Rule size: the count of VCAP addresses used by the rule. The largest rule have highest priority - Rule User: The rules are ordered by the user enumeration - Priority: The priority provided in the flower filter. The lowest value has the highest priority. A VCAP instance may contain the counter as part of the VCAP cache area, and this counter may be one or more bits in width. This type of counter automatically increments its value when the rule is hit. Other VCAP instances have a dedicated counter area outside of the VCAP and in this case the rule must contain the counter id to be able to locate the counter value and cause the counter to be incremented. In this case there must also be a VCAP rule action that sets the counter id. The Sparx5 IS2 VCAP uses a dedicated counter area with 32bit counters. This series adds support for getting VCAP rule counters and provide these via the TC statistic interface. This only support packet counters, not byte counters. Finally the series adds support for the ARP frame dissector and configures the Sparx5 IS2 VCAP to generate the ARP keyset when ARP traffic is received. Delivery: ========= This is current plan for delivering the full VCAP feature set of Sparx5: - DebugFS support for inspecting rules - TC protocol all support - 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 (6): net: flow_offload: add support for ARP frame matching net: microchip: sparx5: Add support for TC flower ARP dissector net: microchip: sparx5: Add/delete rules in sorted order net: microchip: sparx5: Add support for IS2 VCAP rule counters net: microchip: sparx5: Add support for TC flower filter statistics net: microchip: sparx5: Add KUNIT test of counters and sorted rules .../microchip/sparx5/sparx5_tc_flower.c | 144 +++++ .../microchip/sparx5/sparx5_vcap_impl.c | 76 ++- .../net/ethernet/microchip/vcap/vcap_api.c | 233 +++++++- .../ethernet/microchip/vcap/vcap_api_client.h | 14 + .../ethernet/microchip/vcap/vcap_api_kunit.c | 526 ++++++++++++++++++ include/net/flow_offload.h | 6 + net/core/flow_offload.c | 7 + 7 files changed, 990 insertions(+), 16 deletions(-) -- 2.38.1