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 smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 31E3EC7EE23 for ; Tue, 30 May 2023 12:21:00 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id A05F9416D0; Tue, 30 May 2023 12:20:59 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org A05F9416D0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1685449259; bh=NkG8G4C3YPWlpZtMUuzyh8QqD2FffC2jG3Ku1ffs89U=; h=From:To:In-Reply-To:References:Date:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=1CYLyf45PeUm4PGqb7ioiGX69D6iO/rcTt/IiL1R1WFnQlk6Y9OBmpd3I0slZodTY QJ1pqA+KJQIoracTs/aOJ5ar7kZht+29WJRQh8T9ixAlK25DbG/LICca8ZZSVaaqSU q8idy8HbN7N0WPXnyB/Xzb0LJKrEKLae9Cw+z0Rno8ZF3p8HjA64p6zV9qut+4uAdz En4UvLIT1bg3wKaY3zZvcdXCAW3JKUf89OUyFX3cWD5J/h4XK7jtY3CoVE3JTJ6aAs TiDKeqaFzON5tN2zrO5YYO9ymZio3eRvfc+pEnpsshivw2YE0MtuvBCeyUA/QQOdQZ ARjWoXukNGuPQ== X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id bEwFhtN11gNs; Tue, 30 May 2023 12:20:58 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp4.osuosl.org (Postfix) with ESMTP id 3AE8341E7B; Tue, 30 May 2023 12:20:58 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 3AE8341E7B Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 5B29F1BF5E9 for ; Tue, 30 May 2023 12:20:56 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 338E341E7B for ; Tue, 30 May 2023 12:20:56 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 338E341E7B X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id MEF48Pm_wOH1 for ; Tue, 30 May 2023 12:20:55 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org CF245416D0 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by smtp4.osuosl.org (Postfix) with ESMTPS id CF245416D0 for ; Tue, 30 May 2023 12:20:54 +0000 (UTC) From: Kurt Kanzenbach To: Vladimir Oltean , netdev@vger.kernel.org In-Reply-To: <20230530091948.1408477-3-vladimir.oltean@nxp.com> References: <20230530091948.1408477-1-vladimir.oltean@nxp.com> <20230530091948.1408477-3-vladimir.oltean@nxp.com> Date: Tue, 30 May 2023 14:20:50 +0200 Message-ID: <87leh6qacd.fsf@kurt> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1685449252; 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=tdnAZsjhgls6Ysa0NOeGOUiZJaoZowNmTdGhfiI/C5U=; b=fZ8qv0Te23M/bJLqj9Tgbb6ugLulO4dv61shIIvrlyKEBW41yLyUKBn0iNHMPNtKFd2821 hkp0tNq3kBGxqPg684mBxMVGyGc6ykkwnDkaPUujjhu9YJmZYGSaqC4W2YOG4JJzhci0Pl P4IyAJ+Kfg7WpBsb0U7owvrkNiMuqsJ8A91b5BUWCk5dbZmDvPJ3HtQySAozCDWlvBwRge JX+21vUpL52Ye+ta5dvu1tUOZcum/Yq4f3F92883L//eYymb5IRXX5WLJrGvfnt40WjdfI X9BiPl0QuRP43rXkBw1qFMXIWOi4i54hjjPcSJruT5/z9TtqmyblvbcbaMrMvQ== X-Mailman-Original-DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1685449252; 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=tdnAZsjhgls6Ysa0NOeGOUiZJaoZowNmTdGhfiI/C5U=; b=xzMIJMURQ7ginLdQaR9ahBUEgohs1yMYQ3L6XcZKS7DdsKI8IGT0ffq+b4ML/g1j3pSCMm nW3/uAatyUQETvBg== X-Mailman-Original-Authentication-Results: smtp4.osuosl.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.a=rsa-sha256 header.s=2020 header.b=fZ8qv0Te; dkim=pass header.d=linutronix.de header.i=@linutronix.de header.a=ed25519-sha256 header.s=2020e header.b=xzMIJMUR Subject: Re: [Intel-wired-lan] [PATCH net-next 2/5] net/sched: taprio: replace tc_taprio_qopt_offload :: enable with a "cmd" enum X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Lunn , Alexandre Belloni , Ferenc Fejes , Alexandre Torgue , Eric Dumazet , Tony Nguyen , Cong Wang , Gerhard Engleder , UNGLinuxDriver@microchip.com, Horatiu Vultur , Florian Fainelli , Xiaoliang Yang , Jesse Brandeburg , Mohammad Athari Bin Ismail , intel-wired-lan@lists.osuosl.org, Jakub Kicinski , Paolo Abeni , Pranavi Somisetty , Jiri Pirko , Jamal Hadi Salim , Roger Quadros , Claudiu Manoil , Giuseppe Cavallaro , Michael Sit Wei Hong , Harini Katakam , linux-kernel@vger.kernel.org, Jose Abreu , Oleksij Rempel , Maxime Coquelin , "David S. Miller" Content-Type: multipart/mixed; boundary="===============4828022638765800172==" Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" --===============4828022638765800172== Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Tue May 30 2023, Vladimir Oltean wrote: > Inspired from struct flow_cls_offload :: cmd, in order for taprio to be > able to report statistics (which is future work), it seems that we need > to drill one step further with the ndo_setup_tc(TC_SETUP_QDISC_TAPRIO) > multiplexing, and pass the command as part of the common portion of the > muxed structure. > > Since we already have an "enable" variable in tc_taprio_qopt_offload, > refactor all drivers to check for "cmd" instead of "enable", and reject > every other command except "replace" and "destroy" - to be future proof. > > Signed-off-by: Vladimir Oltean > --- [...] > diff --git a/drivers/net/dsa/hirschmann/hellcreek.c b/drivers/net/dsa/hir= schmann/hellcreek.c > index 595a548bb0a8..af50001ccdd4 100644 > --- a/drivers/net/dsa/hirschmann/hellcreek.c > +++ b/drivers/net/dsa/hirschmann/hellcreek.c > @@ -1885,13 +1885,17 @@ static int hellcreek_port_setup_tc(struct dsa_swi= tch *ds, int port, > case TC_SETUP_QDISC_TAPRIO: { > struct tc_taprio_qopt_offload *taprio =3D type_data; >=20=20 > - if (!hellcreek_validate_schedule(hellcreek, taprio)) > - return -EOPNOTSUPP; > + switch (taprio->cmd) { > + case TAPRIO_CMD_REPLACE: > + if (!hellcreek_validate_schedule(hellcreek, taprio)) > + return -EOPNOTSUPP; >=20=20 > - if (taprio->enable) > return hellcreek_port_set_schedule(ds, port, taprio); > - > - return hellcreek_port_del_schedule(ds, port); > + case TAPRIO_CMD_DESTROY: > + return hellcreek_port_del_schedule(ds, port); > + default: > + return -EOPNOTSUPP; > + } > } > default: > return -EOPNOTSUPP; Uhm, seems like the current code validates the schedule even for removing a schedule which seems a bit odd. With your changes it looks correct. Acked-by: Kurt Kanzenbach # hellcreek Anyway, the hellcreek device has Tx overrun counters per TC. Even though they should be zero, simply because the hardware Length Aware Shaper is enabled by default. Thanks, Kurt --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJHBAEBCgAxFiEEvLm/ssjDfdPf21mSwZPR8qpGc4IFAmR16iITHGt1cnRAbGlu dXRyb25peC5kZQAKCRDBk9HyqkZzgkgAD/sH6+pSNn/XkaMNq42jziiZnqWffmMr Nh0eHkqZEXNIBdYtaHhMDv+UySQW2mYItvt+A5sEWzMGDphJluPslMtYdrm98yaE LMklWNsKSD0Rp4r74n9b1nFjwSYUbdFX9juS4d/fWMlLAdxfIQ5+ADem4v+82nHa h8STScKKSQLU2L6js/NO1vRXqlOI2Kk2dycw7PPDcCLme/GaWygQG2u8SNE7g+ij wp/3sh4O1N6P7wIPHJoRhpr+LU5qBpRjkkE89t/7l7aj91XqnSQ1e08Pe7ryZ5wz Uq2sVg8oDtGpmv6xciMGGpkAYrIYG/qCjLEz+w15Nq6ur9dwvrNqsyYmTUu84GqH bSQLxYIPynAOacF7oLy2I+YVMdWJwSw/3iP63LSszGmv7igjaWk/rKRW/OnBLKNj 5q+SVPvCaMGl7PRlaEGnW2QMy4ua2CWIL0nBsJLpe26UFljXA860aytaV1zCItGg s5GlMspLwC0OEbL8s/E+l8InjJoqIMTn7I6Pqh/G+Wk0QfCD+3vZenRo/uyOBCuc /xOs0fevBDhGNGqbYR0y6oX/fwzSvwEfjYBb/pWFov5Vh1gh7Dbd6TG2PUq/0g9H TEc/Qqzr3JDPy1kKkrDVnjOdxwYmFXDcQ3I3V+TmOG2hSkMgdCdZqGE0ygem6W7X nI5BAnq+D8if4g== =C7wP -----END PGP SIGNATURE----- --=-=-=-- --===============4828022638765800172== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Intel-wired-lan mailing list Intel-wired-lan@osuosl.org https://lists.osuosl.org/mailman/listinfo/intel-wired-lan --===============4828022638765800172==-- 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 998E6C77B7A for ; Tue, 30 May 2023 12:20:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230201AbjE3MU5 (ORCPT ); Tue, 30 May 2023 08:20:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49348 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229691AbjE3MUz (ORCPT ); Tue, 30 May 2023 08:20:55 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F215EC5; Tue, 30 May 2023 05:20:53 -0700 (PDT) From: Kurt Kanzenbach DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1685449252; 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=tdnAZsjhgls6Ysa0NOeGOUiZJaoZowNmTdGhfiI/C5U=; b=fZ8qv0Te23M/bJLqj9Tgbb6ugLulO4dv61shIIvrlyKEBW41yLyUKBn0iNHMPNtKFd2821 hkp0tNq3kBGxqPg684mBxMVGyGc6ykkwnDkaPUujjhu9YJmZYGSaqC4W2YOG4JJzhci0Pl P4IyAJ+Kfg7WpBsb0U7owvrkNiMuqsJ8A91b5BUWCk5dbZmDvPJ3HtQySAozCDWlvBwRge JX+21vUpL52Ye+ta5dvu1tUOZcum/Yq4f3F92883L//eYymb5IRXX5WLJrGvfnt40WjdfI X9BiPl0QuRP43rXkBw1qFMXIWOi4i54hjjPcSJruT5/z9TtqmyblvbcbaMrMvQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1685449252; 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=tdnAZsjhgls6Ysa0NOeGOUiZJaoZowNmTdGhfiI/C5U=; b=xzMIJMURQ7ginLdQaR9ahBUEgohs1yMYQ3L6XcZKS7DdsKI8IGT0ffq+b4ML/g1j3pSCMm nW3/uAatyUQETvBg== To: Vladimir Oltean , netdev@vger.kernel.org Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Jamal Hadi Salim , Cong Wang , Jiri Pirko , Vinicius Costa Gomes , Gerhard Engleder , Amritha Nambiar , Ferenc Fejes , Xiaoliang Yang , Roger Quadros , Pranavi Somisetty , Harini Katakam , Giuseppe Cavallaro , Alexandre Torgue , Michael Sit Wei Hong , Mohammad Athari Bin Ismail , Oleksij Rempel , Jacob Keller , linux-kernel@vger.kernel.org, Andrew Lunn , Florian Fainelli , Claudiu Manoil , Alexandre Belloni , UNGLinuxDriver@microchip.com, Jesse Brandeburg , Tony Nguyen , Horatiu Vultur , Jose Abreu , Maxime Coquelin , intel-wired-lan@lists.osuosl.org, Muhammad Husaini Zulkifli Subject: Re: [PATCH net-next 2/5] net/sched: taprio: replace tc_taprio_qopt_offload :: enable with a "cmd" enum In-Reply-To: <20230530091948.1408477-3-vladimir.oltean@nxp.com> References: <20230530091948.1408477-1-vladimir.oltean@nxp.com> <20230530091948.1408477-3-vladimir.oltean@nxp.com> Date: Tue, 30 May 2023 14:20:50 +0200 Message-ID: <87leh6qacd.fsf@kurt> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Tue May 30 2023, Vladimir Oltean wrote: > Inspired from struct flow_cls_offload :: cmd, in order for taprio to be > able to report statistics (which is future work), it seems that we need > to drill one step further with the ndo_setup_tc(TC_SETUP_QDISC_TAPRIO) > multiplexing, and pass the command as part of the common portion of the > muxed structure. > > Since we already have an "enable" variable in tc_taprio_qopt_offload, > refactor all drivers to check for "cmd" instead of "enable", and reject > every other command except "replace" and "destroy" - to be future proof. > > Signed-off-by: Vladimir Oltean > --- [...] > diff --git a/drivers/net/dsa/hirschmann/hellcreek.c b/drivers/net/dsa/hir= schmann/hellcreek.c > index 595a548bb0a8..af50001ccdd4 100644 > --- a/drivers/net/dsa/hirschmann/hellcreek.c > +++ b/drivers/net/dsa/hirschmann/hellcreek.c > @@ -1885,13 +1885,17 @@ static int hellcreek_port_setup_tc(struct dsa_swi= tch *ds, int port, > case TC_SETUP_QDISC_TAPRIO: { > struct tc_taprio_qopt_offload *taprio =3D type_data; >=20=20 > - if (!hellcreek_validate_schedule(hellcreek, taprio)) > - return -EOPNOTSUPP; > + switch (taprio->cmd) { > + case TAPRIO_CMD_REPLACE: > + if (!hellcreek_validate_schedule(hellcreek, taprio)) > + return -EOPNOTSUPP; >=20=20 > - if (taprio->enable) > return hellcreek_port_set_schedule(ds, port, taprio); > - > - return hellcreek_port_del_schedule(ds, port); > + case TAPRIO_CMD_DESTROY: > + return hellcreek_port_del_schedule(ds, port); > + default: > + return -EOPNOTSUPP; > + } > } > default: > return -EOPNOTSUPP; Uhm, seems like the current code validates the schedule even for removing a schedule which seems a bit odd. With your changes it looks correct. Acked-by: Kurt Kanzenbach # hellcreek Anyway, the hellcreek device has Tx overrun counters per TC. Even though they should be zero, simply because the hardware Length Aware Shaper is enabled by default. Thanks, Kurt --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJHBAEBCgAxFiEEvLm/ssjDfdPf21mSwZPR8qpGc4IFAmR16iITHGt1cnRAbGlu dXRyb25peC5kZQAKCRDBk9HyqkZzgkgAD/sH6+pSNn/XkaMNq42jziiZnqWffmMr Nh0eHkqZEXNIBdYtaHhMDv+UySQW2mYItvt+A5sEWzMGDphJluPslMtYdrm98yaE LMklWNsKSD0Rp4r74n9b1nFjwSYUbdFX9juS4d/fWMlLAdxfIQ5+ADem4v+82nHa h8STScKKSQLU2L6js/NO1vRXqlOI2Kk2dycw7PPDcCLme/GaWygQG2u8SNE7g+ij wp/3sh4O1N6P7wIPHJoRhpr+LU5qBpRjkkE89t/7l7aj91XqnSQ1e08Pe7ryZ5wz Uq2sVg8oDtGpmv6xciMGGpkAYrIYG/qCjLEz+w15Nq6ur9dwvrNqsyYmTUu84GqH bSQLxYIPynAOacF7oLy2I+YVMdWJwSw/3iP63LSszGmv7igjaWk/rKRW/OnBLKNj 5q+SVPvCaMGl7PRlaEGnW2QMy4ua2CWIL0nBsJLpe26UFljXA860aytaV1zCItGg s5GlMspLwC0OEbL8s/E+l8InjJoqIMTn7I6Pqh/G+Wk0QfCD+3vZenRo/uyOBCuc /xOs0fevBDhGNGqbYR0y6oX/fwzSvwEfjYBb/pWFov5Vh1gh7Dbd6TG2PUq/0g9H TEc/Qqzr3JDPy1kKkrDVnjOdxwYmFXDcQ3I3V+TmOG2hSkMgdCdZqGE0ygem6W7X nI5BAnq+D8if4g== =C7wP -----END PGP SIGNATURE----- --=-=-=--