Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp3682323rwb; Tue, 20 Sep 2022 03:14:05 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6CE/SQopO9oqoxpocqB8wqsj54UcDkyT0H5I9tN+Tv0jSRO2iCUfnHqOw7xAcoYTBwfG1L X-Received: by 2002:a17:907:1b0e:b0:72f:9b43:b98c with SMTP id mp14-20020a1709071b0e00b0072f9b43b98cmr16294251ejc.710.1663668845411; Tue, 20 Sep 2022 03:14:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663668845; cv=none; d=google.com; s=arc-20160816; b=XXP8wZIEZMwXIP4VKPigJF7/sk3kxQ3KghwCzgIT6EG+0sWjKgT0EsaoFh3ZaA41Ba 2u3QivtI7/ws2dhxhCyhEEDLzCQz5Q+xnDbOeWAZGx35QaF/cXid+RU8ozqDVeMQVsYj ByBJ+XiBqTfOaf4GHXjev5CZHixwoAFYEOD0CKwwram80V0i42kFMvABIW/Hz2c3XgVA wFvLa9IHw+6x9jOYfc2S6FtAbBxGjS7dXu+KA3OjnOzh3dYNiG4HENVRSdGxWJrke4cF 04jxDGsOBsSSJ+sTEoVV/Jb1uaw3EbZHuAGlDKkJBRbd+0N3E5tsseVUOyRAsC3JBD3D yKsA== 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=0Zr4chEKdGRW5pd7oFkozU6PFCm7V7V9neBvGkFPtRM=; b=MyjNte3beoW13TgPN2eK99Oeaj1prN0lvrOXuSaJAzu1d9DNvXHQIdhyxUufmcIZM1 SwUP1zGIFkbX/1ON4ni1b+1oYFfUzDHxFdmMStnSeR3K0xQUx5YvDprydeIk8smiM+Dp wSPXay6pNcs3a6elebcVNtDlWqEJeZLGXvHdOo+GUZJOWCPNfORim2H+I/WOq7pECx1N cMMZbLw9JVNUl9RVm4BtF7zUDReP6IOkGLyqw7JpLQ+BLExEQ9x+bbDtK9Z8w8ufJJ1N ty0atKjniL++NxMpGKxJN99yYEQwCGCB3jF1vOKuCbEgH/X/dtBnG5e0eYGYlHsw56fb +hBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=ujqWHZXh; 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 o7-20020a056402038700b004516b10a1a4si1011389edv.307.2022.09.20.03.13.38; Tue, 20 Sep 2022 03:14:05 -0700 (PDT) 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=ujqWHZXh; 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 S230328AbiITKFi (ORCPT + 99 others); Tue, 20 Sep 2022 06:05:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59708 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230091AbiITKF1 (ORCPT ); Tue, 20 Sep 2022 06:05:27 -0400 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 410B154CB4; Tue, 20 Sep 2022 03:05:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1663668323; x=1695204323; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=TF9Z14Cf+4jHWEAHeCx4BawtaGnTswA4wIDLFjzWOCE=; b=ujqWHZXhesrDwJajEXbTE6OEA5YrSPYw8IyZJUo+oIK4r+Bg40mHQrCu yy4rI66IprGP2LgKhup9yl6tLLMkok/QTmlGE40Emlx8E34c04U2WeTV8 Ry28j+ykkV1O4OCixRhsrTwGjPi0s07oMYI7GwBCW7nOPMS2KUPg+izJI NYHLlerFd2YXBLy8HuH7U+eyvx1yQwbnfhX60lTRGsWmanZFC3Ugk5gRh FGX7D8VEfEOBTJ0TeusPCE3uojVu2jqPtZylONrzNnOVekRSZe5xEcCrP QxnsW4u+SXfb5aKr6CoBpPdX4o6mQ6KH3TOYr/b4cMdVOOcv/z5a4Kydu g==; X-IronPort-AV: E=Sophos;i="5.93,330,1654585200"; d="scan'208";a="181220968" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa3.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 20 Sep 2022 03:05:22 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.87.72) by chn-vm-ex02.mchp-main.com (10.10.87.72) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.12; Tue, 20 Sep 2022 03:05:21 -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.12 via Frontend Transport; Tue, 20 Sep 2022 03:05:19 -0700 From: Daniel Machon To: CC: , , , , , , , , , , , Subject: [PATCH net-next v2 0/5] Add QoS offload support for sparx5 Date: Tue, 20 Sep 2022 12:14:27 +0200 Message-ID: <20220920101432.139323-1-daniel.machon@microchip.com> X-Mailer: git-send-email 2.34.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 patch series adds support for offloading QoS features with the tc command suite, to the sparx5 switch. The new offloadable QoS features introduced in this patch series are: - tc-mqprio for mapping traffic class to hardware queue. Queues are by default mapped 1:1 in hardware, as such the mqprio qdisc is used as an attachment point for qdiscs tbf and ets. $ tc qdisc add dev eth0 root handle 1:0 mqprio - tc-tbf for setting up shaping on scheduler elements of the HSCH (Hierarchical Scheduler) block. Shaping on either port output or queue output is supported. Port shaper: $ tc qdisc add dev eth0 root handle 1:0 tbf rate \ 10000000 burst 8192 limit 1m Queue shaper: $ tc qdisc replace dev eth0 parent 1:5 handle 2:0 tbf \ rate 10000000 burst 8192 limit 1m - tc-ets for setting up strict and or bandwidth-sharing bands on one through eight priority queues. Configure a mix of strict and bw-sharing bands: $ tc qdisc add dev eth0 handle 1: root ets bands 8 strict 5 \ quanta 1000 1000 1000 priomap 7 6 5 4 3 2 1 0 Patch #1 Sets up the tc hook. Patch #2 Adds support for offloading the tc-mqprio qdisc. Patch #3 Adds support for offloading the tc-tbf qdisc. Patch #4 Adds support for offloading the tc-ets qdisc. Patch #5 Updates the maintainers of the sparx5 driver. ======================================================================== v1: https://lore.kernel.org/netdev/20220919120215.3815696-1-daniel.machon@microchip.com/ v1 -> v2: - Fix compiler warning in patch #2 - Fix comment style in patch #4 Daniel Machon (5): net: microchip: sparx5: add tc setup hook net: microchip: sparx5: add support for offloading mqprio qdisc net: microchip: sparx5: add support for offloading tbf qdisc net: microchip: sparx5: add support for offloading ets qdisc maintainers: update MAINTAINERS file. MAINTAINERS | 1 + .../net/ethernet/microchip/sparx5/Makefile | 2 +- .../ethernet/microchip/sparx5/sparx5_main.c | 7 + .../microchip/sparx5/sparx5_main_regs.h | 165 ++++++ .../ethernet/microchip/sparx5/sparx5_netdev.c | 8 +- .../ethernet/microchip/sparx5/sparx5_qos.c | 514 ++++++++++++++++++ .../ethernet/microchip/sparx5/sparx5_qos.h | 82 +++ .../net/ethernet/microchip/sparx5/sparx5_tc.c | 125 +++++ .../net/ethernet/microchip/sparx5/sparx5_tc.h | 15 + 9 files changed, 917 insertions(+), 2 deletions(-) create mode 100644 drivers/net/ethernet/microchip/sparx5/sparx5_qos.c create mode 100644 drivers/net/ethernet/microchip/sparx5/sparx5_qos.h create mode 100644 drivers/net/ethernet/microchip/sparx5/sparx5_tc.c create mode 100644 drivers/net/ethernet/microchip/sparx5/sparx5_tc.h -- 2.34.1