From patchwork Tue Apr 11 18:01:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 82120 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2759964vqo; Tue, 11 Apr 2023 11:04:43 -0700 (PDT) X-Google-Smtp-Source: AKy350aCHeREkj2vPrhT2m7RlmJ9smQZ1PyTkxe0NaQxRFu/079lVWqAqTv7OoLFZe95j47gT74M X-Received: by 2002:a17:906:ae9a:b0:94a:5c6c:e19a with SMTP id md26-20020a170906ae9a00b0094a5c6ce19amr60164ejb.19.1681236283634; Tue, 11 Apr 2023 11:04:43 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1681236283; cv=pass; d=google.com; s=arc-20160816; b=J7sJVJcKHybPl0A1PC1b1H1Wv0Xo7GQwnQgzlAIuEl+GV+DapEpWzb6E8ofo4Wvdm/ 71x8h6bCtu/AzPg50RI7kF1GpKPYIWdJGhmF4/xnxm/0xGG6lXh4RyRgTRECueiMEyNY ryyqFZEH8yNxUqrM0esY2Cx4skXAbkaDH2b29dxghhVKpIjertQdmHeluBCfdQjwZd2c GNswtQADYUHh9YDmvfSg/2yHiHlj/Ucdsu/ZtY4ndrFPm/JqyqYotRVYoUZ+K7d34hFx CmJEniLrephhZ5iWSy2QyidM0Y6Hk9X9dSBlzE9O6Q07npnbyxY9/t+FVRZWul1v34CP 3o0w== 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=6lAGmooedVC7J+3mmfkvE02wUN+57K6a6L3sSPi5grs=; b=E9iGfv2ZC8MCArHhmEWbL2cpNKekdXg5mzhi8SwYtQvrBwKO2NNvLwErgxrJ8X8ndE phTB3UCSBTz+0Xgm9//ejY7tOK5xHEAXTTOE9lXpHRpKmvncORpG+K0rrcHwd30eaZug ZFhl16dQzQcyL3JR3vsZPhLG/8alE87lAkXO65S+JOe5qN+bYYIDMvoLjWOvFJ8YPCut CVSAEMsKzL6GVAAWYGugDtDUE2cI0oXAyNwtpKcHPL0PLe8DvN72gSfgyJiM4hFFeoea ennF48EWTUzNu/Ucln4KAis3/9XlU9mlYs7q/FYGsBYaLqZzIARcWYlVY48ajoij34FX vG9Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=Eyn3c3n7; 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 dd11-20020a1709069b8b00b0092fbf61b95csi150180ejc.50.2023.04.11.11.04.19; Tue, 11 Apr 2023 11:04:43 -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=@nxp.com header.s=selector2 header.b=Eyn3c3n7; 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 S230094AbjDKSCp (ORCPT + 99 others); Tue, 11 Apr 2023 14:02:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44048 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229960AbjDKSC3 (ORCPT ); Tue, 11 Apr 2023 14:02:29 -0400 Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04on2045.outbound.protection.outlook.com [40.107.8.45]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 39A345B86; Tue, 11 Apr 2023 11:02:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZlnJX1Pddn6lroe/yNESAUEYOtwpMNRPuh3iTFrN5oxtPIGf5hbOR4cGyIc7XvK3C7nPaYL883uCBYRhvA8Vd7vjphPl+RUoJyQGaTg1NW5uv041NFXkkFY+LR1u2cemUj9hP6ap7rQ1ANbL35l5ZWwDtDatDJblnGXzC+2XiJNgYcnVel/NcT0bsMVHq89L3wMsiVOW0KdoyArKurrMS35I/5qd5t0IQd+T4DLHAcOEv+njpjRuolMj30XPuaNgMTKXlrwJb24r6Ik0rDOsweEfNgKak52iBrPKhm21bR9kzBxMfVz2w361QFSe2+KoeInpe/uD5d4QLgNuo0iZIA== 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=6lAGmooedVC7J+3mmfkvE02wUN+57K6a6L3sSPi5grs=; b=SqgKw5c7kEDuw4nBMDyZNM9SphuOMxuwVo1qsuPjhHXchGDS9J8ZAFwcXebSzuAld+gRBPfKON5TWfita3SFb6nl6Hm1+tgmwTtb2s7t/pE/Hjd4VpNREviGLP/LKEtlKKJMiTxXluBE5y1Goc4ilML4zwv8vVfL3vwG7ENKPkNSnvdduoc/Oh0QTcK2Tx+a0ETH8QuKz+yO2QyQckMFmhYMUI7CnjrcAONLM7eyVwZ0hunyQ+fMuJDYWeAlMCBIzhhPlMehroKhxnEaEawrr1ZQ4/J8YG61ZoPuxkJyc/heuSRteIaNidXqkEvaY1H8YHA8jsyNtJAuV4AEh4OF3g== 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=6lAGmooedVC7J+3mmfkvE02wUN+57K6a6L3sSPi5grs=; b=Eyn3c3n7M3PyrA3EN1loHPnaQVx6RUhp4mMmk5jD3iae5jO86cKrbHFmMSlHiIxIF+75vXEVW8a/erq0bDyvR7PzGvFwIO6vwl2vjWJ2YBzncKM6ER0SXMaHnJHIC8nXIercZ9G6W8tbnlXZgwwTS282KohL1WgDXqpay/0zQfQ= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM0PR04MB6452.eurprd04.prod.outlook.com (2603:10a6:208:16d::21) by AS8PR04MB7829.eurprd04.prod.outlook.com (2603:10a6:20b:2a7::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.38; Tue, 11 Apr 2023 18:02:27 +0000 Received: from AM0PR04MB6452.eurprd04.prod.outlook.com ([fe80::55b1:d2dd:4327:912b]) by AM0PR04MB6452.eurprd04.prod.outlook.com ([fe80::55b1:d2dd:4327:912b%5]) with mapi id 15.20.6298.028; Tue, 11 Apr 2023 18:02:27 +0000 From: Vladimir Oltean To: netdev@vger.kernel.org Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , 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: [PATCH v5 net-next 4/9] net/sched: mqprio: add an extack message to mqprio_parse_opt() Date: Tue, 11 Apr 2023 21:01:52 +0300 Message-Id: <20230411180157.1850527-5-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230411180157.1850527-1-vladimir.oltean@nxp.com> References: <20230411180157.1850527-1-vladimir.oltean@nxp.com> X-ClientProxiedBy: FR2P281CA0186.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:9f::20) To AM0PR04MB6452.eurprd04.prod.outlook.com (2603:10a6:208:16d::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM0PR04MB6452:EE_|AS8PR04MB7829:EE_ X-MS-Office365-Filtering-Correlation-Id: 46d81490-c833-4382-f807-08db3ab6e8e6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Ig41anPhV12x3SqvHrZfPlccNhy4Qly5skzgsRxVId32p7+u5GxsdLfRgp0LrGQ2PlkrG7qesqdFj66ho04qhRcIFJB6Z6/LZfNltKnZCcX5OV/sgXJzBaNYnox7MZOQ+i/T68r8on8sf3fYvuP5tiX4FHUNgOicoshWqzP3ZSsz5FKSncmQmyGTDvP4dunoRxAza78BG3Ht6zc7P1g1MfWmHMmfkFSTun3pdwKWnfIrRAaIXSmRzE92IDzs1fJCWa8awOkSQ38sXUaR4majlWXzBDrAm3r85hWk18b0rbn4uRRArIdtiklbGES3PglzGPo8h1iyFLb5guAsDGnlTIt0X/yWBQqekfDl3qkCVD6kKxeGaxmHxBUz2yT+Kt02Rwd4Zqh81DCnzMF+B/cf5GmNh65AZmkpKoYXaVcFFBdSuBDppbhdaj4w9byOSnnmeFNMFqHZd7W1ZozfGzotj1wwyWss4Sb5NO1bkUDc3+epG01IWbp/DKOEHWKIe4azUBu9FA70nQp9bvEwwZi87Zts4U8a+GHDvfiFM5LPaHbUmdyONg7ALp+B+pZvxzZLMopY6kB2pth4kQGgGFr4tpdy8SCUMCEfLtU7TATX97I= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM0PR04MB6452.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(366004)(136003)(346002)(39860400002)(376002)(451199021)(41300700001)(478600001)(86362001)(316002)(54906003)(8676002)(52116002)(6916009)(66946007)(66556008)(4326008)(66476007)(8936002)(966005)(6486002)(5660300002)(7416002)(44832011)(2616005)(186003)(36756003)(38100700002)(38350700002)(26005)(6506007)(6512007)(1076003)(83380400001)(2906002)(6666004)(15650500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: uZcQVDisoF1fmFkqtMRr5YtIEh1RzzPBauO1tmCz4wkDZouydwyfGq7l1JJAm/ZWdaaczZN9HLrHjFjyiaK072XHeu5gPg2ExlByHPZQy1a5RIYL4z/0geNh0J3ZtrTP2AUuhJlJw8jC3eyD4I4sn5Q7ReEFOUtBijEOU5Rgxd/OaUv/N237zrmV1bQBZ03j6sZm4jIMQBWyJ+RiUXCGJnUTxedJlxyLj2JOpxK7nsBN0TG33CRKI8fDVYkMy1pkDessvqb1CJvbqGLDNZoo/hpC7ST0fFcXLG1WXr4UlX2C6G+rtW9yDarmHPUcf2lj3G/tAwJ4olISLoK2zTGdEiNHRRUhFWCYkcuLn64rZhVpRUB/oV/j+R4UjcPvThOxk4lpT9+0dAUR3TQ6bD2bGh/+xowngODbd2R1Slar+OrA48p0mlCfNdCP5PYXX2+gz5CWtp08DmnsV5Xidi79vP5M1S4v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P2XRluUU4ztOjl86kCZ6w8+oVtonWv09TUgeqRx1qCGIpCwsxH2aiCygTe0E4fprFSUfyQ== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 46d81490-c833-4382-f807-08db3ab6e8e6 X-MS-Exchange-CrossTenant-AuthSource: AM0PR04MB6452.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Apr 2023 18:02:27.0999 (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: XxhCXOWfaZGeJdp6WPPEnJJKnJ6zAJz0d45mBkdHzqRNIIlhD4M2Y136mzEWPee0Ax6hAPmp/EPU3UlzlpENMA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB7829 X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_PASS,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762904017152706722?= X-GMAIL-MSGID: =?utf-8?q?1762904017152706722?= 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. The kernel was (and still is) rejecting this because iproute2 defaults to "hw 1" if this command line option is not specified. Link: https://lore.kernel.org/netdev/ede5e9a2f27bf83bfb86d3e8c4ca7b34093b99e2.camel@inf.elte.hu/ Signed-off-by: Vladimir Oltean Reviewed-by: Ferenc Fejes Reviewed-by: Simon Horman Acked-by: Jamal Hadi Salim --- v3->v5: none v2->v3: change link from patchwork to lore v1->v2: slightly reword last paragraph of commit message 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 8e8151ca8307..aae4d64dbf3f 100644 --- a/net/sched/sch_mqprio.c +++ b/net/sched/sch_mqprio.c @@ -133,8 +133,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; }