Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2385132rwd; Fri, 9 Jun 2023 10:20:38 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ43EkW8gSe28a95RshLgux7PA6wagNBF7ct2JT6184iZZGaviXUIEN4jyYC3gtEnZrSHG/3 X-Received: by 2002:a05:6358:e81a:b0:129:6079:14fe with SMTP id gi26-20020a056358e81a00b00129607914femr1871606rwb.14.1686331237877; Fri, 09 Jun 2023 10:20:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686331237; cv=none; d=google.com; s=arc-20160816; b=PgWOOFSEqN/lamQV00I5tHSUSXU0nfxlhzJG7UXUpf+tCj1x5QbGSdCZsazc6EaDep P/ul14skq750QNR2RY393mS3DGPHV4dSorjzH/gaQayq/GI6uHAvcovTHu3cQ6ILOk64 3A01kv0xNnLXlZ4Pp+bgvDbB4d3dVAwXapJE1ifdi5/O6TZXvYgobQTpsDvJz6eGjN8e g5wL5ILqRNyLL0jqYnfwcWDdJr9Ed/O3I8VUcEs4qbHD9uJjtSIN+sdyM/Anc2OUOpz4 RaHS53vf181vhInX/QQAevSCDGa/tvOEKsAAx4Gi8B7XRCAkzqEFhSzGGFQW4/BlAeqd +2wA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=fJHuQ8zacvpe7ZvXvHuaj0SxXvb3ZjOuhHjQXHcZ+tc=; b=PwWZnTsPvMOl9dB7f36zf891ubNxJ0UA1PxtCoSnKvc5LQZgieKOla5iILoXzPDIBA K7exPc7YHYA8jr3vjIyd8qPa3SSFg2clUAj9DyAp/CFIk+hdoTUY0txy85r/y9XDNXOx SConLoyHn3RGODFlmz6aYn+upw05DwEqNJnFwD9IgF/Up2B143Z8fSJk8sy8tXlOSCvb AsY40Wk3Lc6oK02NLrzQgPrCla7UqcIfHfOMRb7OJfPW37pbaKuPdT8AiGdPG6WhLtqi 8ISnVq9H35ylG3vzjye/Bf9G2yjXSsjDvxpDlg3SvzVBJm5/KgspqFPB26C9idt1HKBc dN9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=mBz5wKWg; 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=NONE sp=NONE dis=NONE) header.from=lunn.ch Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u189-20020a6385c6000000b005346af99305si2790685pgd.526.2023.06.09.10.20.18; Fri, 09 Jun 2023 10:20:37 -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=@lunn.ch header.s=20171124 header.b=mBz5wKWg; 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=NONE sp=NONE dis=NONE) header.from=lunn.ch Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229978AbjFIRQT (ORCPT + 99 others); Fri, 9 Jun 2023 13:16:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35110 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229662AbjFIRQR (ORCPT ); Fri, 9 Jun 2023 13:16:17 -0400 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 81097E4A; Fri, 9 Jun 2023 10:16:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=fJHuQ8zacvpe7ZvXvHuaj0SxXvb3ZjOuhHjQXHcZ+tc=; b=mBz5wKWg4QpH7XJ7Um49Ge35eK 21DL30tvw1vdJEcJM4x7mEM3JRl7ClTuABp7L1eX3yXFf7YfJEZgfRS7KujAduEaLEAQb0DXL6X67 EUHo0181Ghca2uYi9fsz+QAV9TD8dPenVCHeaOxSPTVnGDFHgF+zUq+Psc0aMlyjd478=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1q7fiW-00FMuM-A0; Fri, 09 Jun 2023 19:16:04 +0200 Date: Fri, 9 Jun 2023 19:16:04 +0200 From: Andrew Lunn To: Alexis =?iso-8859-1?Q?Lothor=E9?= 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 Subject: Re: [PATCH net-next 2/2] net: dsa: mv88e6xxx: implement egress tbf qdisc for 6393x family Message-ID: <176f073a-b5ab-4d8a-8850-fcd8eff65aa7@lunn.ch> References: <20230609141812.297521-1-alexis.lothore@bootlin.com> <20230609141812.297521-3-alexis.lothore@bootlin.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 > 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? Andrew