Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1470282rwl; Wed, 5 Apr 2023 18:23:22 -0700 (PDT) X-Google-Smtp-Source: AKy350Z5yEcVGKboHAYxROCgz6OK2Cveqnpl1L4OdAdIUT5uE1o1mIQYEi8Fs0lRcCtFU9OVFHDO X-Received: by 2002:a05:6402:1a49:b0:501:fe46:480b with SMTP id bf9-20020a0564021a4900b00501fe46480bmr3042776edb.15.1680744202053; Wed, 05 Apr 2023 18:23:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680744202; cv=none; d=google.com; s=arc-20160816; b=pO/nvOcmeCB3gQzZqKXPPNGW3zkuKEdRDvLuJ/w/BzUnhmHBQdw9bYqG/9iwhYWt4x M451ZfC/iZnM/wfvr1JKC7WSpWXaKnVl75Bt4u64/VqzVvn6NFLSLnMhQpT1SLUz1TWU pTrVciVpsr5mZhrC2Dne2ViNFRg9qct4JV+RN6Xif+wlTXGqPEVL4pe0jn1ako600RXV WTvdMq86SaF1JTJlCv3J/5jwvxjXasXYNsvqhVqMA3hRGp/WgJFB7Iu2eegZI5M7wPeK 5MIRl4ygJsTDsXGXzpcmM1KaeNZ4i4NqlarxeD64pnSDe5cVZH5UISSBWwGfxCrLhQZ9 pkdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=OPTvarwJ25Lh96FoCbXEohuztwMwvho/rhzSqzjGcm0=; b=vPuSYhoYWFWPWQiW7G0AjAxh5N7uKfvVfP2wV8c7YYShvLxfndTROJGodOmyLAvpO1 11oWXkkEeNDD/BrRq0cQWaFjuroya3RM6AvsDH3La4eaL7uOJch/4SpCuap3nEtwjgLg Y2b5AzxJ4y0tsvq1IL6cltGSh2DGEZKBQp9Pn6TzHT21iMNnE76Kr2ULK/TdsTc7sJ/I qTsINMBdi4hBhjMar3OlbvSP/WGYLFQXVVNI/9WO7r57V2WanKHAGkMwrMQ3xyT7+VY+ 1z9NEx7S6t4MiCNR3h8wZbV7mnTqWZwwpoMvxAkFWSoC1ohk47Ul+2L/NsXxwKgNPM1U Rc/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=AihnE643; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w13-20020aa7dccd000000b004fd23c8cf1esi133242edu.52.2023.04.05.18.22.31; Wed, 05 Apr 2023 18:23:22 -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=@kernel.org header.s=k20201202 header.b=AihnE643; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234539AbjDFBNk (ORCPT + 99 others); Wed, 5 Apr 2023 21:13:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52840 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234482AbjDFBNi (ORCPT ); Wed, 5 Apr 2023 21:13:38 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CBA598699; Wed, 5 Apr 2023 18:13:15 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id AA1A162B08; Thu, 6 Apr 2023 01:12:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 05FE9C433D2; Thu, 6 Apr 2023 01:12:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1680743556; bh=dP8/jMHNzL9KeQJlhwq07VX3j1IKkLRUF9JRQAZlzw8=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=AihnE643wEKX8L/vYQsqAiX/gazUXOQ9EGr5jKrE9AVzL9OhaB0PDqiTlt0clJwPi 1T+spMWJPK6MlsIOa/ZmMHxwyge6QKva2ob0Sdo20aac2NZder2kqlVc0HzOHY/C0M ZtLS3ijpQ62YS7CYkdFPMP/W6jb8zzEW5Do+JkpurmRHc3G7kyLLlfqRh1q1VUQYze WG54zuaGOOWbD/Y4szLrAHAmYFEffg/C5IWMg+GFrgjkUTrX++w1N8YgHn6qHKY954 66fkn4rIWW+sW8PrgeGaXnd4ifaGbVQUVkciENwf0tnZGLWoUXawe0OldYM23gNXfa xvDEA0XmkFT6Q== Date: Wed, 5 Apr 2023 18:12:34 -0700 From: Jakub Kicinski To: Vladimir Oltean Cc: netdev@vger.kernel.org, "David S. Miller" , Eric Dumazet , Paolo Abeni , Jamal Hadi Salim , 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 Subject: Re: [PATCH v4 net-next 6/9] net/sched: mqprio: allow per-TC user input of FP adminStatus Message-ID: <20230405181234.35dbd2f9@kernel.org> In-Reply-To: <20230403103440.2895683-7-vladimir.oltean@nxp.com> References: <20230403103440.2895683-1-vladimir.oltean@nxp.com> <20230403103440.2895683-7-vladimir.oltean@nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI,SPF_HELO_NONE, SPF_PASS 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 Mon, 3 Apr 2023 13:34:37 +0300 Vladimir Oltean wrote: > +static int mqprio_parse_tc_entry(u32 fp[TC_QOPT_MAX_QUEUE], > + struct nlattr *opt, > + unsigned long *seen_tcs, > + struct netlink_ext_ack *extack) > +{ > + struct nlattr *tb[TCA_MQPRIO_TC_ENTRY_MAX + 1] = { }; nit: no need to clear it nla_parse*() zeros the memory > + int err, tc; > + > + err = nla_parse_nested(tb, TCA_MQPRIO_TC_ENTRY_MAX, opt, > + mqprio_tc_entry_policy, extack); > + if (err < 0) > + return err; > + > + if (!tb[TCA_MQPRIO_TC_ENTRY_INDEX]) { > + NL_SET_ERR_MSG(extack, "TC entry index missing"); Are you not using NL_REQ_ATTR_CHECK() because iproute can't actually parse the result? :( > + return -EINVAL; > + } > + > + tc = nla_get_u32(tb[TCA_MQPRIO_TC_ENTRY_INDEX]); > + if (*seen_tcs & BIT(tc)) { > + NL_SET_ERR_MSG(extack, "Duplicate tc entry"); set attr in extack? minor heads up - I'll take the trivial cleanup patch from Pedro so make sure you rebase: https://lore.kernel.org/all/20230404203449.1627033-1-pctammela@mojatatu.com/