Received: by 2002:a05:7412:8d06:b0:f9:332d:97f1 with SMTP id bj6csp79691rdb; Mon, 18 Dec 2023 09:22:35 -0800 (PST) X-Google-Smtp-Source: AGHT+IEyx234UFmHPHIEjjf1f1u1ndAa6FLQfb7wAcT9c+QOV8Pb4VgywiflYgpJZOhknZeVoWta X-Received: by 2002:a05:6a20:e11a:b0:194:74c8:5dba with SMTP id kr26-20020a056a20e11a00b0019474c85dbamr1041532pzb.74.1702920155169; Mon, 18 Dec 2023 09:22:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702920155; cv=none; d=google.com; s=arc-20160816; b=F6AfBPIYXWErFOzAN7fxQxHSjSA12D4kLvUiR9L0k5UgrxmLAqwSAKpwiLb2L2s+2b Ene3S8yfMa5F+FpmmY2shldb6LPr/OwSTuZnR/oHKOI7/eESIGA+koVfqXgsAOBr2e01 //eXLPUQWtBeHEQ6m2XMPLTlUJwtYBEpbPTHoqFbNRpcI/flF2pxjuxLz3242AcZZbeB v7cZSwDEJwscLwVCLB6Cy58wrSDwP7my+hTZxFuE4bh3rqLKEEFq5UIKE29Q+qA0PVFI 7j6v/g1XkXrFEs/BRytdwIhexjLsFvdB10O+1RCLJEH66zM+0BtP6IZl4WWoRCOdSeUN TQWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=IRSXzBUgzwtu0j/4UZet3BEcTprzLyaOK/iYJtJkH2E=; fh=RbL9DbuIGRTi8X8pceIrqP+FgPcE5MUr3rpO13R1TG4=; b=xivU50xsjw0KgSPZfL3KVEBV/AJNKlSKsG7aRsdlk10ObUWlEWSAQrKVRw9AdtyaMO tU7ifaXXjbEF3DiUs7EZxcIQ5DWmriuaiYBdGKPha3GaLaIMdHPo/6bQH1h7vfqbrKjs 70WwLtUsrgRaHmCLXPeOe1RoXmY4SmKx2lvRq6s7DV8coG8LaxKv8bPqD5KNNERqJY/h 6z7yW239xkPnvgouDvV8GLFDcv2P34gVB4EqM/xuoeaNBp5UYChG1Q6uB3O4WxMtMqiY 2z9o0hu2iTuvF+kzj1x7oaHBcC2bi8vdQp8aO9wf6YxNFNd0W4H74cTJ+jAaqvv579x4 OIIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Y2yQkEnF; spf=pass (google.com: domain of linux-kernel+bounces-4154-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-4154-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id j3-20020a056a00174300b006cd852a8a83si18710344pfc.147.2023.12.18.09.22.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Dec 2023 09:22:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-4154-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Y2yQkEnF; spf=pass (google.com: domain of linux-kernel+bounces-4154-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-4154-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id B69F5284E8E for ; Mon, 18 Dec 2023 17:22:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AD1C34878F; Mon, 18 Dec 2023 17:20:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Y2yQkEnF" X-Original-To: linux-kernel@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A220B5BF9C; Mon, 18 Dec 2023 17:20:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E3A77C433C7; Mon, 18 Dec 2023 17:20:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702920039; bh=mxQodVK8Qo9iWtDoh+f+wkylLrmy3Zyz6oU2mXSN1t0=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=Y2yQkEnF95YPtGg+mLklR/7o4FtDTIxrwVBi4PYmUk+YTwLBqcT7WpUmFm/jV8+sv VNScfR1KSaABDVNP9JzH40oMDEgbQr6DSyb42bkfc528E8CibzpjHYXJG8Su61gz1/ YCQZu5B7CIfpOK+Uyafa7Xqlub6I9MSbItN2deXY6MgKddE3LyJymziUMMLS8Sqp+W wqLFfV48vB88DppDq3YBH7TBO5i/ieDZ8991cFtCCivIAKmn1og8tkYY+RmZlitg3H ifkaTN7jH9ze3QcF9+ZwBiUXiQIFApfhUskYpeIsCm+wuJlAMRpB33E9blOO8K2kbF ovcDOXfb5uHIw== Message-ID: Date: Mon, 18 Dec 2023 19:20:33 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH net-next v10 08/10] net: ethernet: ti: am65-cpsw: add mqprio qdisc offload in channel mode Content-Language: en-US To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, shuah@kernel.org, vladimir.oltean@nxp.com Cc: s-vadapalli@ti.com, r-gunasekaran@ti.com, vigneshr@ti.com, srk@ti.com, horms@kernel.org, p-varis@ti.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org References: <20231218125513.52337-1-rogerq@kernel.org> <20231218125513.52337-9-rogerq@kernel.org> From: Roger Quadros In-Reply-To: <20231218125513.52337-9-rogerq@kernel.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 18/12/2023 14:55, Roger Quadros wrote: > From: Grygorii Strashko > > This patch adds MQPRIO Qdisc offload in full 'channel' mode which allows > not only setting up pri:tc mapping, but also configuring TX shapers > (rate-limiting) on external port FIFOs. > > The MQPRIO Qdisc offload is expected to work with or without VLAN/priority > tagged packets. > > The CPSW external Port FIFO has 8 Priority queues. The rate-limit can be > set for each of these priority queues. Which Priority queue a packet is > assigned to depends on PN_REG_TX_PRI_MAP register which maps header > priority to switch priority. > > The header priority of a packet is assigned via the RX_PRI_MAP_REG which > maps packet priority to header priority. > > The packet priority is either the VLAN priority (for VLAN tagged packets) > or the thread/channel offset. > > For simplicity, we assign the same priority queue to all queues of a > Traffic Class so it can be rate-limited correctly. > > Configuration example: > ethtool -L eth1 tx 5 > ethtool --set-priv-flags eth1 p0-rx-ptype-rrobin off > > tc qdisc add dev eth1 parent root handle 100: mqprio num_tc 3 \ > map 0 0 1 2 0 0 0 0 0 0 0 0 0 0 0 0 \ > queues 1@0 1@1 1@2 hw 1 mode channel \ > shaper bw_rlimit min_rate 0 100mbit 200mbit max_rate 0 101mbit 202mbit > > tc qdisc replace dev eth2 handle 100: parent root mqprio num_tc 1 \ > map 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 queues 1@0 hw 1 > > ip link add link eth1 name eth1.100 type vlan id 100 > ip link set eth1.100 type vlan egress 0:0 1:1 2:2 3:3 4:4 5:5 6:6 7:7 > > In the above example two ports share the same TX CPPI queue 0 for low > priority traffic. 3 traffic classes are defined for eth1 and mapped to: > TC0 - low priority, TX CPPI queue 0 -> ext Port 1 fifo0, no rate limit > TC1 - prio 2, TX CPPI queue 1 -> ext Port 1 fifo1, CIR=100Mbit/s, EIR=1Mbit/s > TC2 - prio 3, TX CPPI queue 2 -> ext Port 1 fifo2, CIR=200Mbit/s, EIR=2Mbit/s > > Signed-off-by: Grygorii Strashko > Signed-off-by: Roger Quadros > Reviewed-by: Vladimir Oltean > --- > drivers/net/ethernet/ti/Kconfig | 3 +- > drivers/net/ethernet/ti/am65-cpsw-nuss.c | 3 + > drivers/net/ethernet/ti/am65-cpsw-qos.c | 255 ++++++++++++++++++++++- > drivers/net/ethernet/ti/am65-cpsw-qos.h | 20 ++ > 4 files changed, 277 insertions(+), 4 deletions(-) This breaks build due to undefined BYTES_PER_MBIT. I'll fix it up and send another revision. -- cheers, -roger