Message ID | 20230216232126.3402975-9-vladimir.oltean@nxp.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp583181wrn; Thu, 16 Feb 2023 15:23:42 -0800 (PST) X-Google-Smtp-Source: AK7set+0u7nRG6R335FYwUl7wVdwPXeY7uC9QCfCzlDX/2xSrF3jFr1SuRKch5AwSeoMjoxY+5vE X-Received: by 2002:a05:6a00:1489:b0:594:26a7:cbd2 with SMTP id v9-20020a056a00148900b0059426a7cbd2mr4137729pfu.8.1676589821882; Thu, 16 Feb 2023 15:23:41 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1676589821; cv=pass; d=google.com; s=arc-20160816; b=Wt9adzOHS2qvnpkdjKM3KHhaqLtVWmcttIbh8QimIdx0pq56GMJ+I1ZnFL42Y60Sv7 aDN2dMooMv+rUZxIaSsOsjS/WEtJZcxTZ0BLfPhfAFDVtmQJtutuBEce2W4nHtau8Jan eb5Tq32YVG08VQRLjPN4Cfu0HnyOEHx2xE5AIEL7CRTMpI+OINH4qK8zlqvApEEIN4wV 7ngRW35ZHK//sJsJI+8cMrPi5hBi6d8ZlUrVxxlxukHfk4j1d66lfmph1wPab/R7htNl yNT/oQnxwT9xHjH0R1ThfJoH7X2IN0ppzBAv936fGnoSPOPIMdlM1H1ObK7EJjctMAwg SsFw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ahom7zc0vAt42PO8uFVSUdi6HqcyiIxgwgjJivK1p78=; b=n+WBdlqQfUEUGLPuW9R8t8p1MCHvWLEzVWps0VaTz3XflyR0jfeZWVxXedaee8JQUw +MeHUZ1DaTQX04oFtOF4fQiVyB7nau7gkuy76FtnpFe2kW6vIw5Fe3mdPa+vpt9qTaLc NUhhbdQnMo6Kx4SXOt5oJMoZVc7A3vdWUUcWIrcjHdkqk7PR0j54zxBAz5ro3xnXbDcd Go6urKFaOPWC8Pr3DRgbD3LiqF+jyCwvUy22+1aQTTWY5Z1Gr6HX7DQf7eTqZ7dj/h8k 7CsqBIHRhkuZHwOEpSFpDFAnUKJm+jaf8UFY/RUUS5RK7yQHZaG+uyUDhlpHsFOT06k9 AEdg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=JSXYc0BR; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); 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=nxp.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 194-20020a6300cb000000b004fbf9dee276si2892714pga.841.2023.02.16.15.23.28; Thu, 16 Feb 2023 15:23:41 -0800 (PST) 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=@nxp.com header.s=selector2 header.b=JSXYc0BR; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); 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=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230130AbjBPXWh (ORCPT <rfc822;aimixsaka@gmail.com> + 99 others); Thu, 16 Feb 2023 18:22:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33698 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229927AbjBPXW1 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 16 Feb 2023 18:22:27 -0500 Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03on2089.outbound.protection.outlook.com [40.107.104.89]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 10E8554D50; Thu, 16 Feb 2023 15:21:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ErxKvLgXnVNRz6lgujfD6ZCHfe/YyPFrxT29GpQ2/C5ZBvwpQNyvO2KRLvfmsEjxPB8D5HzeLgkwjgF7UN0kPfJ74aT1Ttf3/umktoSNXvrAn6y1isDrdtujHHVZmX7MiHODr0jBOHRloZJrMHgbB/9NIsSDOScAKxB8P7hEtZhwmG8TYbk2cHAntlFUP4KZOHeHaKbjfJoBTx/jhWrPrnE3mUmFdsihEakz/i5+G0OTMZS20UAsZoGuUtlketMkYAZ0BnOCsivGOQwaBlqp2hpgnFuecwMhXhe6U2wzcLJZeLqtftgLCuCCkXLiXtS/xPg55fgzxmbX13yMGWzx2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ahom7zc0vAt42PO8uFVSUdi6HqcyiIxgwgjJivK1p78=; b=e2lLA+v49vTldDjI++zDXeTwKWxhYtajhxIUxWxLBAoUWV1TRys9xgDP9FwiC2m1NtBB05i/2wjbOZE8/v1/kaAK3/lcUewdNcTfwTU6Eo2swzU43MDwNl8Sne36h2heVHxsCLsQYhl96YU9HVPA5bzuQsi49YxoJRPI/AgfI5hoD/u9M8D2rEZo/UjZ31NsrlNoG9igy/ZJn1T1qW6BoMsTolfbrRBtCw7nADA+sWRvb1Z3C2dZ+K+87emFH4gvheVARJk+0nR0xYYG9jFRBBeAPFUKfT75VhT+hefzXlFukxW2cBitevdVAHJjgO3PTb8/E9lKq/GaK4Rg7fIDJg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ahom7zc0vAt42PO8uFVSUdi6HqcyiIxgwgjJivK1p78=; b=JSXYc0BRBuIDSoeHdD27FlKS5qrhAW4S5tphPo+1LBf6Fz2gquJ9+PUsI+UBDqqx3PPCJRhdDf5LmA46j/nPIoBJ7F5IK69cJvBZU2PffIIdWBbilnDsz3DM8JDInFT8I2EsxkL2S7PVdx3eE07Z5HNfIL4QL8A0SyyDSuoYWQ4= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB5136.eurprd04.prod.outlook.com (2603:10a6:803:55::19) by PR3PR04MB7436.eurprd04.prod.outlook.com (2603:10a6:102:87::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.26; Thu, 16 Feb 2023 23:21:49 +0000 Received: from VI1PR04MB5136.eurprd04.prod.outlook.com ([fe80::3cfb:3ae7:1686:a68b]) by VI1PR04MB5136.eurprd04.prod.outlook.com ([fe80::3cfb:3ae7:1686:a68b%4]) with mapi id 15.20.6086.026; Thu, 16 Feb 2023 23:21:49 +0000 From: Vladimir Oltean <vladimir.oltean@nxp.com> To: netdev@vger.kernel.org Cc: "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Jamal Hadi Salim <jhs@mojatatu.com>, Cong Wang <xiyou.wangcong@gmail.com>, Jiri Pirko <jiri@resnulli.us>, Vinicius Costa Gomes <vinicius.gomes@intel.com>, Kurt Kanzenbach <kurt@linutronix.de>, Gerhard Engleder <gerhard@engleder-embedded.com>, Amritha Nambiar <amritha.nambiar@intel.com>, Claudiu Manoil <claudiu.manoil@nxp.com>, Alexandre Belloni <alexandre.belloni@bootlin.com>, UNGLinuxDriver@microchip.com, Andrew Lunn <andrew@lunn.ch>, Florian Fainelli <f.fainelli@gmail.com>, Ferenc Fejes <ferenc.fejes@ericsson.com>, Xiaoliang Yang <xiaoliang.yang_1@nxp.com>, linux-kernel@vger.kernel.org Subject: [PATCH net-next 08/12] net/sched: mqprio: add an extack message to mqprio_parse_opt() Date: Fri, 17 Feb 2023 01:21:22 +0200 Message-Id: <20230216232126.3402975-9-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230216232126.3402975-1-vladimir.oltean@nxp.com> References: <20230216232126.3402975-1-vladimir.oltean@nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: VI1PR0501CA0018.eurprd05.prod.outlook.com (2603:10a6:800:92::28) To VI1PR04MB5136.eurprd04.prod.outlook.com (2603:10a6:803:55::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VI1PR04MB5136:EE_|PR3PR04MB7436:EE_ X-MS-Office365-Filtering-Correlation-Id: ab0c7b92-7090-4cf2-c3b8-08db1074944c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +PEHy+cXGy/Luqn4fMy5ZjGclZBPBlPSsM3FklSPbIGdEsXApdpl477cGJs0ewIaPQEg8OvXoeu+PJiI6ohmR7ZWL37UWPE0YiqAAd4b7WOFlk5KrclMIwWrwRcGyBxpBnibejjBM6f/aN0VZYPeHhvDNzuj0+uGwHerGOfXqdUVTn69GEWpV/4M+O5uud+DRPtGuZfLqcuzBrYIj7UZ2y81JW+YyM/DatBYd/0del4zvCyuGYCwkdgr7bvt6n6ZEtONyqZzWXIvr0RUVGrLNE+wQXIpl/si/Z/GyaLeqE3SanoOvOWuMbkZ6EQ8Ox+5b8nsvkeHv8HCWFqhp8Ci/NXBIq69dY80RZ+9V7cR1oRrGumiZM9tbXCCMJlnCez/+fhcY22EthfNT8Q4TKhIg/hsYGennr7vntEAvqT4IbQgGgA9bK9sUpObhybKaWbO5y1Tv3lsWOhfwUH9BlHF8/T6GB/sPFehEMelKae+6cwyknCqm14Fu4FYevnxjI8g12EezqMCeT1zAQ2QCturzaawzDHMFWuLWOfvFkjxFUCv+hqnjScY5wBCLB5W3D+tEk5nlSaumCrr8vmfML376fxo5uTHZ8Egb9OgzZOeBR1r/AjfI31DkfL7Dr8IPPP4vE2vIvGVau1qZ4U/6Jrip6oaZaqrOWjwVe62V9w//4Wx3sMOgQTl9VImGmBWA/w/ X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB5136.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(376002)(366004)(396003)(136003)(39860400002)(346002)(451199018)(38100700002)(2906002)(38350700002)(44832011)(7416002)(83380400001)(66476007)(2616005)(966005)(86362001)(478600001)(6916009)(66556008)(36756003)(5660300002)(41300700001)(6506007)(52116002)(6666004)(4326008)(66946007)(6486002)(54906003)(186003)(316002)(8936002)(26005)(6512007)(1076003)(8676002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: EED9sLfd8PfFjkI7QWCphD0nShZdLDQsqAFFtCIejKFMwsSBiY4Xz27P+arvp17rvTlVIKFmRwc10j8Yp3iOr4k9atEq+SS+8IVjXQMWdtJLeUlOExgfAVeaHVA8aC5PtOQrcyw9p5BKz+2ThQQqPaSpXO60h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3MUixZwVaAhjMwvrNJCq/zJhd6k6Wz1+5Fg8bpoQe1w3Bvi69mKZiAl9fhN8fW8shA6uDmwGz00KtBbBT/fmnNvO3ljEbNBm+BIVJjjoCQRNdAALcOr7nu1dZODelh8zMphhKp9jW/7g3c4ul3DnFrmbNFSLivJ8MSuaAAT/ISSh23Soh6e34kVgVQcjkh2Y6c+1V4xO+9q/FCs9OZ5a/071GlC4DLkhuliSGQ4NGH0Km1ur8Cv6tMhHaMuC3DtBv8iogDwr6qy7x31vAw/Z6uxqZB14mzv6C67hn5jmtTokUnrHyCSIfGUsAB7cXjQGIrildmz8bhTtFTx0iLQIxRtJchpYSQ1SUbrxbWxvarcw/KlqWewVq758EorclwnlSnLRRvdA== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: ab0c7b92-7090-4cf2-c3b8-08db1074944c X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5136.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Feb 2023 23:21:49.5710 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: XON40SMMTeM+FxisnyXbs5yoCniowuIGtUqisJ/FHB1YsWgv3MFTC0lJ36003TYy4HhIoeeSvV/uhZ3OdMjHeg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3PR04MB7436 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1758031849108497999?= X-GMAIL-MSGID: =?utf-8?q?1758031849108497999?= |
Series |
Add tc-mqprio and tc-taprio support for preemptible traffic classes
|
|
Commit Message
Vladimir Oltean
Feb. 16, 2023, 11:21 p.m. UTC
Ferenc reports that a combination of poor iproute2 defaults and obscure
cases where the kernel returns -EINVAL make it difficult to understand
what is wrong with this command:
$ ip link add veth0 numtxqueues 8 numrxqueues 8 type veth peer name veth1
$ tc qdisc add dev veth0 root mqprio num_tc 8 map 0 1 2 3 4 5 6 7 \
queues 1@0 1@1 1@2 1@3 1@4 1@5 1@6 1@7
RTNETLINK answers: Invalid argument
Hopefully with this patch, the cause is clearer:
Error: Device does not support hardware offload.
This was rejected because iproute2 defaults to "hw 1" if the option is
not specified.
Link: https://patchwork.kernel.org/project/netdevbpf/patch/20230204135307.1036988-3-vladimir.oltean@nxp.com/#25215636
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
---
net/sched/sch_mqprio.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
Comments
Hi Vladimir! On Fri, 2023-02-17 at 01:21 +0200, Vladimir Oltean wrote: > Ferenc reports that a combination of poor iproute2 defaults and > obscure > cases where the kernel returns -EINVAL make it difficult to > understand > what is wrong with this command: > > $ ip link add veth0 numtxqueues 8 numrxqueues 8 type veth peer name > veth1 > $ tc qdisc add dev veth0 root mqprio num_tc 8 map 0 1 2 3 4 5 6 7 \ > queues 1@0 1@1 1@2 1@3 1@4 1@5 1@6 1@7 > RTNETLINK answers: Invalid argument > > Hopefully with this patch, the cause is clearer: > > Error: Device does not support hardware offload. Much better, great improvement! > > This was rejected because iproute2 defaults to "hw 1" if the option > is > not specified. > > Link: > https://patchwork.kernel.org/project/netdevbpf/patch/20230204135307.1036988-3-vladimir.oltean@nxp.com/#25215636 > Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> > --- > net/sched/sch_mqprio.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/net/sched/sch_mqprio.c b/net/sched/sch_mqprio.c > index 18eda5fade81..52cfc0ec2e23 100644 > --- a/net/sched/sch_mqprio.c > +++ b/net/sched/sch_mqprio.c > @@ -134,8 +134,11 @@ static int mqprio_parse_opt(struct net_device > *dev, struct tc_mqprio_qopt *qopt, > /* If ndo_setup_tc is not present then hardware doesn't > support offload > * and we should return an error. > */ > - if (qopt->hw && !dev->netdev_ops->ndo_setup_tc) > + if (qopt->hw && !dev->netdev_ops->ndo_setup_tc) { > + NL_SET_ERR_MSG(extack, > + "Device does not support hardware > offload"); > return -EINVAL; > + } > > return 0; > } Thanks for doing this! Best, Ferenc
Hi Ferenc,
On Fri, Feb 17, 2023 at 07:24:07AM +0000, Ferenc Fejes wrote:
> Much better, great improvement!
Would appreciate a formal review/test tag on v2 :)
diff --git a/net/sched/sch_mqprio.c b/net/sched/sch_mqprio.c index 18eda5fade81..52cfc0ec2e23 100644 --- a/net/sched/sch_mqprio.c +++ b/net/sched/sch_mqprio.c @@ -134,8 +134,11 @@ static int mqprio_parse_opt(struct net_device *dev, struct tc_mqprio_qopt *qopt, /* If ndo_setup_tc is not present then hardware doesn't support offload * and we should return an error. */ - if (qopt->hw && !dev->netdev_ops->ndo_setup_tc) + if (qopt->hw && !dev->netdev_ops->ndo_setup_tc) { + NL_SET_ERR_MSG(extack, + "Device does not support hardware offload"); return -EINVAL; + } return 0; }