Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp385488rwn; Wed, 14 Sep 2022 23:27:30 -0700 (PDT) X-Google-Smtp-Source: AA6agR7bZYythsa5ZG2oda5Gr3TgcoAuRmAIrVfqoGe0w8ew/ynQIzFPddFZmzijDBITND6gTzKf X-Received: by 2002:a63:b4a:0:b0:438:c97c:994d with SMTP id a10-20020a630b4a000000b00438c97c994dmr20449838pgl.597.1663223250379; Wed, 14 Sep 2022 23:27:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663223250; cv=none; d=google.com; s=arc-20160816; b=xUnZ+1VaTMt5f+9TOAy8uesXqE3Hkj2o7ZZEyFYR1wrOk7cbvYQ2/+gCKSkHzcPZx4 WamJiUJgY0SDG+SIqG6fWvw6TwVEHR8TS64104tCcrdMu5vskowTAIo1cXBDDfALkqQG QJLcv4AuVE0PKpasuM0PDKHkOdv/6lHttzxv+nIVlegougdzGd7+4BubrNLOm2v0mjHO h2p5O7CVT3sPh5EBl+VQQ3IZ04HoXK3PZ52lPJzN1aN+B02urLUTEjI0DlDXrQl5xlDd +271phVtdiZC9Zu4XUc0+sJ+mqRldddk1ibqwsNT/Nqnok4lWLSSgQn9V65uEBlpu+rr 3CIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=16EkOxJWOJ2VYr1fBeCMv5EVP+eK/aR5IZaZqnAsUIs=; b=tF8p+GnID5lbeBY1B2ea5e31u6OHJCiHkOjiztVbVHaDKMutsDP/JhunU030hwjxg3 +DkjkxkbaIiWSt6z/8mOa9KH33gU3dYwu2Ev2AzpmMcifRSw6R5g52igGvVT6StYgvqY 0yiVAKmlLPlxkpMUYEFb6MiMYcf4jHFdixbfo5/h45Ew4/AdkMjdQxuHt7iNyUQaO5Vt gIJcHiD2UgZDMn42UKVD+5KBz8ZipthvRl5fhtQXdrRgT33V39++qpKpL165sZlxhV1+ iE0QfNNQcWMPqSEdvEEJXKdRgWBJ8zi1PtWu8T3AyGTqxSwWmH1xHzjX9au7Wg1j+wZ5 nFXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=Jo8DAk+8; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; 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=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f3-20020a056a00238300b005429324b543si12553823pfc.360.2022.09.14.23.27.18; Wed, 14 Sep 2022 23:27:30 -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=@linutronix.de header.s=2020 header.b=Jo8DAk+8; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; 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=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229598AbiIOGQB (ORCPT + 99 others); Thu, 15 Sep 2022 02:16:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44258 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229462AbiIOGP7 (ORCPT ); Thu, 15 Sep 2022 02:15:59 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 83C5466108; Wed, 14 Sep 2022 23:15:58 -0700 (PDT) From: Kurt Kanzenbach DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1663222556; 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: in-reply-to:in-reply-to:references:references; bh=16EkOxJWOJ2VYr1fBeCMv5EVP+eK/aR5IZaZqnAsUIs=; b=Jo8DAk+8XrNoO7qyclUY85EEstbXluGvNbeLjVv0bmnHJBXpHyemrxgzapTX9LAwxcq9F7 YaTbyvayjfjFZcRRxwqY9JjSqi6bWAa3ZIZ9U/zpeW2P3VoRsuTJwvaLrfA992648tagko vrfx5TvArtJwnj+td0JluzwC1HdIGZ5pyA+DvAdVZrYsBXHsTvFI8mVeqC1y1V5B0Kil74 hIa2oCgO3zt7KISU9Tq5hh4CdimcCGzcB2HFM59DeUrsigtrTVaEiQLF1nILyGTMxc45Jz Qzbd4sZmeTHv0RihaKBUM6nvHPs1JTq3yad76jSVmkW8uQHv5hsz8PFYo7XySA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1663222556; 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: in-reply-to:in-reply-to:references:references; bh=16EkOxJWOJ2VYr1fBeCMv5EVP+eK/aR5IZaZqnAsUIs=; b=DdTVkZycJlCNKiaDfqsVG7UN73DsE5FEavr2HXLbrbqdTrrTADF8xbscteukrg32W2lW42 +hZBDt1u3ep4OrAg== To: Vladimir Oltean Cc: "netdev@vger.kernel.org" , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Xiaoliang Yang , Rui Sousa , Claudiu Manoil , Alexandre Belloni , "UNGLinuxDriver@microchip.com" , Andrew Lunn , Vivien Didelot , Florian Fainelli , Michael Walle , Vinicius Costa Gomes , Maxim Kochetkov , Colin Foster , Richie Pearn , Vladimir Oltean , Jesse Brandeburg , Tony Nguyen , Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , Jamal Hadi Salim , Cong Wang , Jiri Pirko , Gerhard Engleder , Grygorii Strashko , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH net-next 08/13] net: dsa: hellcreek: deny tc-taprio changes to per-tc max SDU In-Reply-To: <20220914184051.2awuutgr4vm4tfgf@skbuf> References: <20220914153303.1792444-1-vladimir.oltean@nxp.com> <20220914153303.1792444-9-vladimir.oltean@nxp.com> <87a671bz8e.fsf@kurt> <20220914184051.2awuutgr4vm4tfgf@skbuf> Date: Thu, 15 Sep 2022 08:15:54 +0200 Message-ID: <87r10dxiw5.fsf@kurt> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE 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 --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Wed Sep 14 2022, Vladimir Oltean wrote: > On Wed, Sep 14, 2022 at 08:13:53PM +0200, Kurt Kanzenbach wrote: >> I'd rather like to see that feature implemented :-). Something like belo= w. >>=20 >> From 3d44683979bf50960125fa3005b1142af61525c7 Mon Sep 17 00:00:00 2001 >> From: Kurt Kanzenbach >> Date: Wed, 14 Sep 2022 19:51:40 +0200 >> Subject: [PATCH] net: dsa: hellcreek: Offload per-tc max SDU from tc-tap= rio >>=20 >> Add support for configuring the max SDU per priority and per port. If not >> specified, keep the default. >>=20 >> Signed-off-by: Kurt Kanzenbach >> --- > > Nice :) Do you also want the iproute2 patch, so you can test it? Sure. I see you posted that patch already. > >> drivers/net/dsa/hirschmann/hellcreek.c | 61 +++++++++++++++++++++++--- >> drivers/net/dsa/hirschmann/hellcreek.h | 7 +++ >> 2 files changed, 61 insertions(+), 7 deletions(-) >>=20 >> diff --git a/drivers/net/dsa/hirschmann/hellcreek.c b/drivers/net/dsa/hi= rschmann/hellcreek.c >> index 5ceee71d9a25..1b22710e1641 100644 >> --- a/drivers/net/dsa/hirschmann/hellcreek.c >> +++ b/drivers/net/dsa/hirschmann/hellcreek.c >> @@ -128,6 +128,16 @@ static void hellcreek_select_prio(struct hellcreek = *hellcreek, int prio) >> hellcreek_write(hellcreek, val, HR_PSEL); >> } >>=20=20 >> +static void hellcreek_select_port_prio(struct hellcreek *hellcreek, int= port, >> + int prio) >> +{ >> + u16 val =3D port << HR_PSEL_PTWSEL_SHIFT; >> + >> + val |=3D prio << HR_PSEL_PRTCWSEL_SHIFT; >> + >> + hellcreek_write(hellcreek, val, HR_PSEL); >> +} >> + >> static void hellcreek_select_counter(struct hellcreek *hellcreek, int c= ounter) >> { >> u16 val =3D counter << HR_CSEL_SHIFT; >> @@ -1537,6 +1547,42 @@ hellcreek_port_prechangeupper(struct dsa_switch *= ds, int port, >> return ret; >> } >>=20=20 >> +static void hellcreek_setup_maxsdu(struct hellcreek *hellcreek, int por= t, >> + const struct tc_taprio_qopt_offload *schedule) >> +{ >> + int tc; >> + >> + for (tc =3D 0; tc < 8; ++tc) { >> + u16 val; >> + >> + if (!schedule->max_sdu[tc]) >> + continue; >> + >> + hellcreek_select_port_prio(hellcreek, port, tc); >> + >> + val =3D (schedule->max_sdu[tc] & HR_PTPRTCCFG_MAXSDU_MASK) >> + << HR_PTPRTCCFG_MAXSDU_SHIFT; >> + >> + hellcreek_write(hellcreek, val, HR_PTPRTCCFG); > > So the maxSDU hardware register tracks exactly the L2 payload size, like > the software variable does, or does it include the Ethernet header size > and/or FCS? This is something I'm not sure about. I'll ask the HW engineer when he's back from vacation. Thanks, Kurt --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJHBAEBCgAxFiEEvLm/ssjDfdPf21mSwZPR8qpGc4IFAmMiwxoTHGt1cnRAbGlu dXRyb25peC5kZQAKCRDBk9HyqkZzgjmEEACRHYyHMI670c5W4f+UhOMFFjlsRN71 CHM/yAlx/EIdMHAdiEXhHNU3qs7zGYVP8Lg4/ZKzN1gwzb6Phujs9R/7Phr+Brle ukNjrm+bZHQojiVfh4ZtuvMdEiycia8DQUHBuLv8ZZ8wSBYACCqQVpNMTKclIBR/ J59EhDB+CFWTEhLx9VnmS9ee9kk3VcPl49J97svnG5bjbebvAFNER5oeqryKwQDd CmkDOh1CA/vPp71QcOrtrOjAdldCd3cvoC+GeKdGFmeDRHOKaiXc8DFxQjISLNo6 KrG/frMVm8YLSwifkNvHol4gRem81pBjGGhcnGxu5V4dFOwThEdt7hek44ySYFOc oXTYhUl3A1w54xeSinJ2m3Isyt54iLPL4PnqVvl3Sa/4/LYEFrVCYbuHIO8rmMUS TwPQPPICJvdIsCuNmVKH1F720t7hR4AZ76UoaR7mCBeMicqRanb1qoMZWoFr6LMC /0zhzT7oZkBJekAuBkb0nVCgrMARjlhDb9Ciqupp9gX4Wgogk5udHHocHEXFVko+ gUtiNc2K+Dc5iK2iW3lULiPjjcvkdY4N2bIP4tA+O5MstJlQivAFOU+qQOdiEB3d kpP8RKJRC/viM0sCoIhKE7eHz/mcd+GYYjQ3miyxi299SwUYneRczQ3tjQcCBPMa rPKxH9J0HJksNg== =38X1 -----END PGP SIGNATURE----- --=-=-=--