Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1220366rwl; Fri, 7 Apr 2023 11:53:07 -0700 (PDT) X-Google-Smtp-Source: AKy350a9XHJfp/H5afsEGP/pe0Tlya3Wlh04DnVjPvS4SnEO8au4wnegHwiWqhPekaRmkdPUXpPY X-Received: by 2002:a17:907:25c8:b0:933:4d47:55b7 with SMTP id ae8-20020a17090725c800b009334d4755b7mr416036ejc.2.1680893587350; Fri, 07 Apr 2023 11:53:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680893587; cv=none; d=google.com; s=arc-20160816; b=Ig/78f/C92w8D/7aU9bBFs9bCQK7VDfA2luH7gN54B7xiVeAnFuEz92iQzp8Llh5bH Nl8nmfDiuCWFSGhuJXBwUocjTUaV8KbUTT7IjxT2exLyM0IkFsEFsKniEDSHAkLoHhfa YGzNOQqJ62ndjZvqx/eygakbk4uASsQ0naUZdaBdgr984kf//PWDrgsP8mugzLUJZ/6N r0N7+UKIAqLdTxnwMrHYfm/Tmq57zoU57MW730cUwk9nrhLnx3uOoNtqIBw62cPhvx7e F/f7C+KMWyA8xZpPPmweOXkiBjI5sjNeNCWKRphUj3qDIgHPAELpap1gAFSaiPMgM5xP ugaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=0t5i43wGGIz6RL/As6jYxd4q/8/bvGtJKBPYe204Cnk=; b=gC8LjEpB8piNrElehDVTepRCvY1A1VktzFM/a+hAVWubR9HVMfs17WOMsl73bJc4am ijCUdQ1mAw5+hADL5yCpggvKzkvGzae/STo0tCt+cuY9WdcAkvx+4Ni8WX9kt8WwBwQs +gWNAh/C8Hmbec1oWft43qsKw9WHre9EkZkCVeXvoDiNALR5NwG/6e51/U+fJX1+wCdw CH8OQexStKa8D/P14ZwHfzf5z90WLGzc6FZr0f4j9coej9fzb5k7HM+vjbqfNBDBhDik tC/rbpCJhcAVaP87HNelUOlC8ijpTpN7VWdp5dAuHPaDIogcVIR74PM6G+yYnUfxSiD/ 8jCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mojatatu-com.20210112.gappssmtp.com header.s=20210112 header.b=gKmjpf6w; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u10-20020a17090617ca00b00947c7226bc6si3617366eje.150.2023.04.07.11.52.42; Fri, 07 Apr 2023 11:53:07 -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=@mojatatu-com.20210112.gappssmtp.com header.s=20210112 header.b=gKmjpf6w; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231493AbjDGSwC (ORCPT + 99 others); Fri, 7 Apr 2023 14:52:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58778 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233373AbjDGSvj (ORCPT ); Fri, 7 Apr 2023 14:51:39 -0400 Received: from mail-yb1-xb32.google.com (mail-yb1-xb32.google.com [IPv6:2607:f8b0:4864:20::b32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E5FF9CC36 for ; Fri, 7 Apr 2023 11:49:55 -0700 (PDT) Received: by mail-yb1-xb32.google.com with SMTP id i20so3233059ybg.10 for ; Fri, 07 Apr 2023 11:49:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mojatatu-com.20210112.gappssmtp.com; s=20210112; t=1680893353; x=1683485353; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=0t5i43wGGIz6RL/As6jYxd4q/8/bvGtJKBPYe204Cnk=; b=gKmjpf6w1ICxLZDfP31MkmQ5Vt8VhgqY243vOu354bZO1tNUMd87r1SkzNhbua3W7v 4i/r5IDyc+e8Xs5/JeoxeEzQPHRM9r0GWhB8dpCpiiZ+qDDhQPEU2Z6XgHUtbr1BDR76 7xvbLSUABgvNRiKQN1JU6K6k4qUY9i6Zox54pXUUcSYygaaYt+KevKoy57YX7kg1r/bF sknTeqa2uT/LGK2Q0J8ABtlnk5Fo6RyIqYec4Kn891Btj14UzlUXFESR9hd8V+PjuPsx WFUMxCyoL3L5ZNzRKF/8vdAmBfWOSDsyXfYl/mGvo8VqHTxS1RupoWqkDQOccBHSkdeH UK2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680893353; x=1683485353; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0t5i43wGGIz6RL/As6jYxd4q/8/bvGtJKBPYe204Cnk=; b=fxAsGaMSuLF7TvRKl7ttEJvb6C+OlIAh/8A6MAYDPWR2dElWEbEIRXxf6M75SQ2zyW ordvthom+mL8nEQ72HvUsspLEa1FstY095mepC9u6lMIzjcDj/aratkk4IBp968DLwVz d5AWYdVfysZR9tsJTSgGKVu+NJS8vFP/nqmj7+RPmY8ioHAhMTSMIFQjOw7UOJkbqsco XWNAkdQCgQp1kg9VVB0ZN2U76hIQaXsgEz2wkHryJ27MxMhgMXyCd2YYecZ+heXYX0Lk hLZhBn70r3zHEeX/XEnXXyOAyATZrVlYziw9abyPRayy/mehznZQsyNe1iGa0orcV6BU Yeig== X-Gm-Message-State: AAQBX9cYL8AaUdN+WcHh5L5hl1Yj6G89l9yZXjIKZTQh6NKHD/irX5C7 1TNAokPIOgbGtFJnGmHntOKuEk7YhJMHe7jTUl5zJw== X-Received: by 2002:a25:ca85:0:b0:b8b:f52c:a785 with SMTP id a127-20020a25ca85000000b00b8bf52ca785mr2379050ybg.7.1680893352900; Fri, 07 Apr 2023 11:49:12 -0700 (PDT) MIME-Version: 1.0 References: <20230403103440.2895683-1-vladimir.oltean@nxp.com> <20230403103440.2895683-7-vladimir.oltean@nxp.com> <20230407164103.vstxn2fmswno3ker@skbuf> In-Reply-To: <20230407164103.vstxn2fmswno3ker@skbuf> From: Jamal Hadi Salim Date: Fri, 7 Apr 2023 14:49:01 -0400 Message-ID: Subject: Re: [PATCH v4 net-next 6/9] net/sched: mqprio: allow per-TC user input of FP adminStatus To: Vladimir Oltean Cc: netdev@vger.kernel.org, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Cong Wang , Jiri Pirko , Vinicius Costa Gomes , Kurt Kanzenbach , 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, Ferenc Fejes , Simon Horman Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=0.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE autolearn=unavailable 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 On Fri, Apr 7, 2023 at 12:41=E2=80=AFPM Vladimir Oltean wrote: > > On Fri, Apr 07, 2023 at 12:22:26PM -0400, Jamal Hadi Salim wrote: > > > +enum { > > > + TC_FP_EXPRESS =3D 1, > > > + TC_FP_PREEMPTIBLE =3D 2, > > > +}; > > > > Suggestion: Add a MAX to this enum (as is traditionally done).. > > Max what? This doesn't count anything, it just expresses whether the > quality of one traffic class, from the Frame Preemption standard's > perspective, is express or preemptible... > > > > @@ -145,13 +149,94 @@ static int mqprio_parse_opt(struct net_device *= dev, struct tc_mqprio_qopt *qopt, > > > return 0; > > > } > > > > > > +static const struct > > > +nla_policy mqprio_tc_entry_policy[TCA_MQPRIO_TC_ENTRY_MAX + 1] =3D { > > > + [TCA_MQPRIO_TC_ENTRY_INDEX] =3D NLA_POLICY_MAX(NLA_U32, > > > + TC_QOPT_MAX_= QUEUE), > > > > And use it here... > > Where? Above or below the comment? I think you mean below (for the > policy of TCA_MQPRIO_TC_ENTRY_FP)? > That was what I meant. I misread that code thinking it was a nested TLV range check. If it is only going to be those two specific values, I understand - but then wondering why you need a u32; wouldnt a u8 be sufficient? The only reason you would need a MAX is if it is possible that new values greater than TC_FP_PREEMPTIBLE showing up in the future. > > Out of curiosity, could you have more that 16 queues in this spec? I > > noticed 802.1p mentioned somewhere (typically 3 bits). > > "This spec" is IEEE 802.1Q :) It doesn't say how many "queues" (struct > netdev_queue) there are, and this UAPI doesn't work with those, either. > The standard defines 8 priority values, groupable in (potentially fewer) > traffic classes. Linux liked to extend the number of traffic classes to > 16 (and the skb->priority values are arbitrarily large IIUC) and this is > where that number 16 came from. The number of 16 traffic classes still > allows for more than 16 TXQs though. > > > Lead up question: if the max is 16 then can preemptible_tcs for example= be u32? > > I don't understand this question, sorry. preemptible_tcs is declared as > "unsigned long", which IIUC is at least 32-bit. I meant: if you only had 16 possible values, meaning 16 bits are sufficient, (although i may be misunderstanding the goal of those bits) why not be explicit and use the proper type/size? cheers, jamal > > > > > + [TCA_MQPRIO_TC_ENTRY_FP] =3D NLA_POLICY_RANGE(NLA_U32, > > > + TC_FP_EXPR= ESS, > > > + TC_FP_PREE= MPTIBLE),