From mboxrd@z Thu Jan 1 00:00:00 1970 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 262D0C61DA4 for ; Thu, 2 Feb 2023 10:45:27 +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=SMcnoonspDIMqRqd2WLx9MDaflxV9a6a7G+C28cVCPA=; b=cPzvsG6+rSMKCT SEcakkUZi0ud18Qi9dgP7xGfzrj/+m0XGcQinNyxKP+NGLLHsNky5Vg5v1/OIOKgdsZxq7WqJjmC7 0srLTEZD3+AT3vveCCrGh8lNqdQJBo0kZK32e7+4to5/yT0o9IArgw8URxyXehO6fX2ftyl7XzMio tBmw+8q/jGphAP5usEf9DAWSZZZrOcyK4O3/IiUlE8JvTinfrVt6mSqBmjOJi3ojvsYNRS+QOfQh7 Ehe7AAobjdoTizJwK9DLoCd2wzPS+JOy9rkTqkvE/5NNipJ7IRBEFQ0h+UEhV8C53vhcIxe1sUSGM CpdRRoZgmZnk4QEXwFbw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pNX4t-00FP55-GH; Thu, 02 Feb 2023 10:44:27 +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 1pNX4p-00FP3u-V6 for linux-arm-kernel@lists.infradead.org; Thu, 02 Feb 2023 10:44:25 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1675334664; x=1706870664; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=K8wVM1cMa8IR9e2Ua/lVlZG9gJBktVk3YV6jXWvcn3U=; b=tVW8gc54sR374SDm7k+y0KoejbeEak3SN4zd8tNTKmUyVkan6Bh/lEmu bDk06GZbpcZvsCS4tEmKQo9nVAd7Ghmz7Lh4R+pqstOqn65rW+ujsBZ/M nsoJ1EKmxnS2U1mCNcPkoTqMwwdKOjZ/PRMpcpRYB2vVNzqwFTr7m5jPC +obVTcIqa/F7Qwg7d01OyMhLD/VNAV06r72YIVTq/xAUOLZ3TSJgwlX/O LiU+n7PEx/UrGKhgwSV8EfBoS55Aq3lNG4lTlRzo0M0Edrn5fdJmhhgJM exA2BE9Rq7NHzc1em0O1KRdCtt1o44ePDKrOZ1xQ3ojIWzKGybKUpWh5t w==; X-IronPort-AV: E=Sophos;i="5.97,267,1669100400"; d="scan'208";a="199297135" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa5.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 02 Feb 2023 03:44:20 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) 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; Thu, 2 Feb 2023 03:44:19 -0700 Received: from DEN-LT-70577.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.16 via Frontend Transport; Thu, 2 Feb 2023 03:44:15 -0700 From: Daniel Machon To: CC: , , , , , , , , , , , , , , , , , Subject: [PATCH net-next 00/10] Add support for PSFP in Sparx5 Date: Thu, 2 Feb 2023 11:43:45 +0100 Message-ID: <20230202104355.1612823-1-daniel.machon@microchip.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230202_024424_027444_AE8AE0BE X-CRM114-Status: GOOD ( 10.74 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org ================================================================================ Add support for Per-Stream Filtering and Policing (802.1Q-2018, 8.6.5.1). ================================================================================ The VCAP CLM (VCAP IS0 ingress classifier) classifies streams, identified by ISDX (Ingress Service Index, frame metadata), and maps ISDX to streams. Flow meters are also classified by ISDX, and implemented using service policers (Service Dual Leacky Buckets, SDLB). Leacky buckets are linked together in a leak chain of a leak group. Leak groups a preconfigured to serve buckets within a certain rate interval. Stream gates are time-based policers used by PSFP. Frames are dropped based on the gate state (OPEN/ CLOSE), whose state will be altered based on the Gate Control List (GCL) and current PTP time. Apart from time-based policing, stream gates can alter egress queue selection for the frames that pass through the Gate. This is done through Internal Priority Selector (IPS). Stream gates are mapped from stream filters. Support for tc actions gate and police, have been added to the VCAP IS0 set of supported actions. Examples: // tc filter with gate action $ tc filter add dev eth1 ingress chain 1100000 prio 1 handle 1001 protocol \ 802.1q flower skip_sw vlan_id 100 action gate base-time 0 sched-entry open \ 700000 7 8m sched-entry close 300000 action goto chain 1200000 // tc filter with police action $ tc filter add dev eth1 ingress chain 1100000 prio 1 handle 1002 protocol \ 802.1q flower skip_sw vlan_id 100 action police rate 1gbit burst 8096 \ conform-exceed drop action goto chain 1200000 ================================================================================ Patches ================================================================================ Patch #1: Adds new register needed for PSFP. Patch #2: Adds resource pools to control PSFP needed chip resources. Patch #3: Adds support for SDLB's needed for flow-meters. Patch #4: Adds support for service policers. Patch #5: Adds support for PSFP flow-meters, using service policers. Patch #6: Adds a new function to calculate basetime, required by flow-meters. Patch #7: Adds support for PSFP stream gates. Patch #8: Adds support for PSFP stream filters. Patch #9: Adds a function to initialize flow-meters, stream gates and stream filters. Patch #10: Adds the required flower code to configure PSFP using the tc command. Daniel Machon (10): net: microchip: add registers needed for PSFP net: microchip: sparx5: add resource pools net: microchip: sparx5: add support for Service Dual Leacky Buckets net: microchip: sparx5: add support for service policers net: microchip: sparx5: add support for PSFP flow-meters net: microchip: sparx5: add function for calculating PTP basetime net: microchip: sparx5: add support for PSFP stream gates net: microchip: sparx5: add support for PSFP stream filters net: microchip: sparx5: initialize PSFP sparx5: add support for configuring PSFP via tc .../net/ethernet/microchip/sparx5/Makefile | 3 +- .../ethernet/microchip/sparx5/sparx5_main.c | 5 +- .../ethernet/microchip/sparx5/sparx5_main.h | 125 ++++ .../microchip/sparx5/sparx5_main_regs.h | 581 +++++++++++++++++- .../ethernet/microchip/sparx5/sparx5_police.c | 53 ++ .../ethernet/microchip/sparx5/sparx5_pool.c | 81 +++ .../ethernet/microchip/sparx5/sparx5_psfp.c | 332 ++++++++++ .../ethernet/microchip/sparx5/sparx5_ptp.c | 3 +- .../ethernet/microchip/sparx5/sparx5_qos.c | 59 ++ .../ethernet/microchip/sparx5/sparx5_sdlb.c | 335 ++++++++++ .../microchip/sparx5/sparx5_tc_flower.c | 238 ++++++- .../net/ethernet/microchip/vcap/vcap_api.c | 3 +- .../ethernet/microchip/vcap/vcap_api_client.h | 3 + 13 files changed, 1808 insertions(+), 13 deletions(-) create mode 100644 drivers/net/ethernet/microchip/sparx5/sparx5_police.c create mode 100644 drivers/net/ethernet/microchip/sparx5/sparx5_pool.c create mode 100644 drivers/net/ethernet/microchip/sparx5/sparx5_psfp.c create mode 100644 drivers/net/ethernet/microchip/sparx5/sparx5_sdlb.c -- 2.34.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel