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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C9AC9C7EE25 for ; Fri, 9 Jun 2023 17:37:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230521AbjFIRh4 (ORCPT ); Fri, 9 Jun 2023 13:37:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45540 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229595AbjFIRhz (ORCPT ); Fri, 9 Jun 2023 13:37:55 -0400 Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DD87DE4E; Fri, 9 Jun 2023 10:37:52 -0700 (PDT) X-GND-Sasl: alexis.lothore@bootlin.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1686332271; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MQ4UWZI119Iu57pHOjYmAYSbWSzI2+ZEVxuwq6FNsuI=; b=mO/OT8X4tcThPPSE1PqmZdLmTaSOyoq1g7YjekEN/Ni3Rykt6kECY4LCqekesRIC9+PG+L pm0HxrJqT2kBpulKFVwfe6kmrqeP1cbPtFtxCBV3i+x5IXKCred26TIYpoEqvK4HmnsAy+ Hp8XJyUGMbwDtC5mFrXYcPHqyRlEFQE5bvDod7yqNl9qiOpL1xTacNjEi9ch+rYMXHz07b qizwFTsx5p+rGkB0xf2c5A0pFH8JHykQR+fyu9Y+nVJ2/5ReKradFxieLZl2e77P/ma3R6 iLSiyXyhZx9Cm/HYKtAXIjQ1nHkddrnnUnSO1C8dTm0M1QptNNNycS7wwj0nEQ== X-GND-Sasl: alexis.lothore@bootlin.com X-GND-Sasl: alexis.lothore@bootlin.com X-GND-Sasl: alexis.lothore@bootlin.com X-GND-Sasl: alexis.lothore@bootlin.com X-GND-Sasl: alexis.lothore@bootlin.com X-GND-Sasl: alexis.lothore@bootlin.com X-GND-Sasl: alexis.lothore@bootlin.com X-GND-Sasl: alexis.lothore@bootlin.com X-GND-Sasl: alexis.lothore@bootlin.com X-GND-Sasl: alexis.lothore@bootlin.com X-GND-Sasl: alexis.lothore@bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPSA id 2D736FF802; Fri, 9 Jun 2023 17:37:50 +0000 (UTC) Message-ID: Date: Fri, 9 Jun 2023 19:38:13 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.2 Subject: Re: [PATCH net-next 2/2] net: dsa: mv88e6xxx: implement egress tbf qdisc for 6393x family Content-Language: en-US To: Andrew Lunn Cc: Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Thomas Petazzoni , paul.arola@telus.com, scott.roberts@telus.com References: <20230609141812.297521-1-alexis.lothore@bootlin.com> <20230609141812.297521-3-alexis.lothore@bootlin.com> <176f073a-b5ab-4d8a-8850-fcd8eff65aa7@lunn.ch> From: =?UTF-8?Q?Alexis_Lothor=c3=a9?= In-Reply-To: <176f073a-b5ab-4d8a-8850-fcd8eff65aa7@lunn.ch> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/9/23 19:16, Andrew Lunn wrote: >> Yes, I can do that (or maybe -EINVAL to match Vladimir's comment ?). I think >> it's worth mentioning that I encountered an issue regarding those values during >> tests: I use tc program to set the tbf, and I observed that tc does not even >> reach kernel to set the qdisc if we pass no burst/latency value OR if we set it >> to 0. So tc enforces right on userspace side non-zero value for those >> parameters, and I have passed random values and ignored them on kernel side. > > That is not good. Please take a look around and see if any other > driver offloads TBF, and what they do with burst. > >> Checking available doc about tc-tbf makes me feel like that indeed a TBF qdisc >> command without burst or latency value makes no sense, except my use case can >> not have such values. That's what I struggled a bit to find a proper qdisc to >> match hardware cap. I may fallback to a custom netlink program to improve testing. > > We don't really want a custom application, since we want users to use > TC to set this up. > > Looking at the 6390 datasheet, Queue Counter Registers, mode 8 gives > the number of egress buffers for a port. You could validate that the > switch has at least the requested number of buffers assigned to the > port? There is quite a bit you can configure, so maybe there is a way > to influence the number of buffers, so you can actually implement the > burst parameter? Thanks for the pointers. I will check the egress buffers configuration and see if I can come up with something better > > Andrew -- Alexis Lothoré, Bootlin Embedded Linux and Kernel engineering https://bootlin.com