From patchwork Mon Jan 30 17:31:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 13121478 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 2C2FBC54EAA for ; Mon, 30 Jan 2023 17:33:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237166AbjA3Rcm (ORCPT ); Mon, 30 Jan 2023 12:32:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235968AbjA3Rcb (ORCPT ); Mon, 30 Jan 2023 12:32:31 -0500 Received: from EUR02-VI1-obe.outbound.protection.outlook.com (mail-vi1eur02on2079.outbound.protection.outlook.com [40.107.241.79]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0E041EB50 for ; Mon, 30 Jan 2023 09:32:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TOstu4lVl48rwRKErn1LikTeea0uOB2hq81fAQxvlDLvmy0To/WVHsUBKtZV5rtdqC4hwHCo6QcZMd1W+zjEcbUF3KmCXjSOjgLrW8D0CNDXzYf5jpahpMMBAuLVd+4orXSfFYdRm77BQIBX19Zn6xDIWXxKVTd9+iLqflq/WMWEAwTMV/cpLYeHBYIitBd5eUX86vYxUAd5sRNekaGdbdUgTpY7zxh4srt0D5hqETNKbaKD4UC/1yDATG2GD+0mq2Nm0k5EQbiExG2PxruZK9ciCA6IFKLtcPZIArMicFZKyyNv9vdFqRdYd683VE254TGnV3Oji8pIst6T5HmVnA== 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=8amqR4J5yiw+YzqwyMjewmZANeV4ZhPQhmdsluEI+qo=; b=IQxcVkLe0ILZCQgw5r5oClFJCLjxnQJxg+NcrRUuAWCHedWIatT7T1oaBgezAaX7ZNQ94XDvj7leHbOdsSVQJfwy9fbL1y7+ntIAk12LA0zCfNY54D6VYctwoMwa8LUBR2YfaKj1Rne4HZHOS7yD4EbbTBXj24b4lzXB0tfBM82uloujEvV0mMWtoCuUgaTmqYDXobW5OpMFk7oMiePdeREB1MAkxUEbVLoExH3DVTUV/ZjuZXA0/0mVZiqFf19ifIEVYEBxWBb16vnjoZAYAMUzGaolWt1rrUHI4hMtu0sLoAsm4O0QyHhmHio+4tpi9O24HtreX+SSZ0oqc1ljrQ== 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=8amqR4J5yiw+YzqwyMjewmZANeV4ZhPQhmdsluEI+qo=; b=JJSd6WWERtGIrF3S/mh/VzKnOBbUvyhUBEtSIV3KcKH7x2wwvT22OaiAfT4721AreNULv/EJQYcylHP+RRN0CApy74v6SNG/2n16TP1T4YYb+SxFueTGRamk+HDcMJOEZesrRkDp9cKI6Fi+5yIJzNw7f22hnXEEB69NbKac4D4= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM0PR04MB5121.eurprd04.prod.outlook.com (2603:10a6:208:c1::16) by AS8PR04MB8547.eurprd04.prod.outlook.com (2603:10a6:20b:422::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.36; Mon, 30 Jan 2023 17:32:05 +0000 Received: from AM0PR04MB5121.eurprd04.prod.outlook.com ([fe80::4c1:95d7:30fc:d730]) by AM0PR04MB5121.eurprd04.prod.outlook.com ([fe80::4c1:95d7:30fc:d730%4]) with mapi id 15.20.6043.036; Mon, 30 Jan 2023 17:32:05 +0000 From: Vladimir Oltean To: netdev@vger.kernel.org Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Claudiu Manoil , Vinicius Costa Gomes , Kurt Kanzenbach , Jacob Keller , Jamal Hadi Salim , Cong Wang , Jiri Pirko , Igor Russkikh , Yisen Zhuang , Salil Mehta , Jesse Brandeburg , Tony Nguyen , Thomas Petazzoni , Saeed Mahameed , Leon Romanovsky , Horatiu Vultur , Lars Povlsen , Steen Hegelund , Daniel Machon , UNGLinuxDriver@microchip.com, Gerhard Engleder , Siddharth Vadapalli , Roger Quadros Subject: [PATCH v4 net-next 00/15] ENETC mqprio/taprio cleanup Date: Mon, 30 Jan 2023 19:31:30 +0200 Message-Id: <20230130173145.475943-1-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.34.1 X-ClientProxiedBy: BE1P281CA0186.DEUP281.PROD.OUTLOOK.COM (2603:10a6:b10:8d::10) To AM0PR04MB5121.eurprd04.prod.outlook.com (2603:10a6:208:c1::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM0PR04MB5121:EE_|AS8PR04MB8547:EE_ X-MS-Office365-Filtering-Correlation-Id: 2a3670be-ec44-4140-1734-08db02e7e7ae X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: nd5pBdyA9yi6taUbTarBTgUpLRYGRjqx5bGlkREHwWf3z1FW5jVKQfc0xhApayiRcQ6rV7ve+98YUgNATqZnpnFOzLxPg/1p5tRi0h88S2ibqAYhbxYu3icMMlBmornNPnQxLTbtWkBrJ90pOVB6TVgKHk+37Ijt7W+xy3hn5cljNBJX1h4S1DM9cY0CGhElW/QVWbv24FcTNloqYPOsjimFqLtx1qWJMo7k8DOGPdmTHXtfTf0Ychof6S4NewMCXYAZJHRFoD8D4wMdu1MH5iaG72B+C4+38NdBtFisdSxNlkQ5PGNOt+lLPiZTZ0wOeCYfal3CEHEUA74rQjNqJyaEC8cwZzLXIq5nxXvRv70XyAOZF88QI/xpjm42F1sT0wipb+yYRVQhHeNwWDcSFugHcjtVKsdQCb5epsWfvCpwIy/dJN4f+6VuXCY+XNNljwZf+UMmLQTPdbNasM6DUeDYqJyB1AXRsBPGeePBNfnDWVqQZVT0IzRCHQKnoLDXUVVFMFKYCf5k7wd2rWVvVqLmp3Dit8f/Mjo/h+VmRmXK1PDlsijTIOCOoLn539GLLUVFBnUWvLf84SOeioL9mPKq94uXTEcmHxDWRRERXCfLkFucJVMOw+LpbUNyVbJ8I68a8TS4noNl+bvWeh7n0QhT/iIfEbcPb79B+Ad291x8dpJUWu1K+wyBxCxh6PxqjWs2gWf1MzV/edUCp/nkBL6gTskzPlzW6qNJu7UgASn1lasLdOAc/Ttwg8UVA4hg8P4SJ6D6yWhUVPObJ8z8CQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM0PR04MB5121.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(366004)(346002)(376002)(39860400002)(136003)(396003)(451199018)(44832011)(5660300002)(7416002)(36756003)(38100700002)(38350700002)(2906002)(86362001)(478600001)(52116002)(966005)(6486002)(2616005)(6512007)(6506007)(26005)(186003)(54906003)(83380400001)(66476007)(6916009)(66946007)(6666004)(1076003)(4326008)(66556008)(316002)(8676002)(41300700001)(8936002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-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qmNMKL/4v4ZrmVpsZPXN67BtQgjaPyc7QNoS7xjiHbBotGM7zJd+ZBC9R9Wc1+7q1IVW07eaJKdJx9yqKvCvj8T2yS3OCkAxSXSWmg7/QD+mT11odAShXfuN+9mvIci8m/8cd+DV4iAOukt2qSEsch2ECLmYvjh7rG7wYE7GTTbOhFHlnSnTR2u61wO3g6hkJyoO8wI5h+yDlQ7JOJd8WfReduDSh/O2aW+N+C9HDFYhaM2ESQkkv9v0c4smfixkWLViikobIB30UK+f/j1KZwsY3MaJe4qyrTtKjyfM/QwAEjxNdor+X8hNrgbRx/FZwakyD4D0mfpvQLGms6uRK84adOv9to60SJN1EM2ZawGReNOcV/XnD5ClYMY+jcF507xaSV3VxRvJSH8jY4+pMRGt8f32r6vD/V+W6Ab1xXyp2swQIuXaJ22MXTk1SQ2Hh65/kdqXDjtA9HpBAu+R3H9GCnvfbXMVhsh/CtwVn6L/2RXtkEF/YxoIGP8IcpdCujlLH/NEVv3kiKji/TOmTy5jqBfegXTcmxpMG9l5vjwQ== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2a3670be-ec44-4140-1734-08db02e7e7ae X-MS-Exchange-CrossTenant-AuthSource: AM0PR04MB5121.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jan 2023 17:32:05.6172 (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: vwMVrL+yFLB3JgxwE8dMydJm6tl6shOPuMSOkaqZVBo3SGSuQO0a3MJFlFTw59x7QYO5/d4/G91E+D5hXBLdIA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB8547 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Please excuse the spam, I had failed to compile-test CONFIG_TI_CPSW with the previous version. Not deleting an #include is the only delta between v3 and v4. v3->v4: - adjusted patch 07/15 to not remove "#include " from ti cpsw https://patchwork.kernel.org/project/netdevbpf/cover/20230127001516.592984-1-vladimir.oltean@nxp.com/ v2->v3: - move min_num_stack_tx_queues definition so it doesn't conflict with the ethtool mm patches I haven't submitted yet for enetc (and also to make use of a 4 byte hole) - warn and mask off excess TCs in gate mask instead of failing - finally CC qdisc maintainers v2 at: https://patchwork.kernel.org/project/netdevbpf/patch/20230126125308.1199404-16-vladimir.oltean@nxp.com/ v1->v2: - patches 1->4 are new - update some header inclusions in drivers - fix typo (said "taprio" instead of "mqprio") - better enetc mqprio error handling - dynamically reconstruct mqprio configuration in taprio offload - also let stmmac and tsnep use per-TXQ gate_mask v1 (RFC) at: https://patchwork.kernel.org/project/netdevbpf/cover/20230120141537.1350744-1-vladimir.oltean@nxp.com/ The main goal of this patch set is to make taprio pass the mqprio queue configuration structure down to ndo_setup_tc() - patch 12/15. But mqprio itself is not in the best shape currently, so there are some consolidation patches on that as well. Next, there are some consolidation patches in the enetc's driver handling of TX queues and their traffic class assignment. Then, there is a consolidation between the TX queue configuration for mqprio and taprio. Finally, there is a change in the meaning of the gate_mask passed by taprio through ndo_setup_tc(). We introduce a capability through which drivers can request the gate mask to be per TXQ. The default is changed so that it is per TC. Cc: Igor Russkikh Cc: Yisen Zhuang Cc: Salil Mehta Cc: Jesse Brandeburg Cc: Tony Nguyen Cc: Thomas Petazzoni Cc: Saeed Mahameed Cc: Leon Romanovsky Cc: Horatiu Vultur Cc: Lars Povlsen Cc: Steen Hegelund Cc: Daniel Machon Cc: UNGLinuxDriver@microchip.com Cc: Gerhard Engleder Cc: Siddharth Vadapalli Cc: Roger Quadros Vladimir Oltean (15): net: enetc: simplify enetc_num_stack_tx_queues() net: enetc: allow the enetc_reconfigure() callback to fail net: enetc: recalculate num_real_tx_queues when XDP program attaches net: enetc: ensure we always have a minimum number of TXQs for stack net/sched: mqprio: refactor nlattr parsing to a separate function net/sched: mqprio: refactor offloading and unoffloading to dedicated functions net/sched: move struct tc_mqprio_qopt_offload from pkt_cls.h to pkt_sched.h net/sched: mqprio: allow offloading drivers to request queue count validation net/sched: mqprio: add extack messages for queue count validation net: enetc: request mqprio to validate the queue counts net: enetc: act upon the requested mqprio queue configuration net/sched: taprio: pass mqprio queue configuration to ndo_setup_tc() net: enetc: act upon mqprio queue config in taprio offload net/sched: taprio: mask off bits in gate mask that exceed number of TCs net/sched: taprio: only calculate gate mask per TXQ for igc, stmmac and tsnep .../net/ethernet/aquantia/atlantic/aq_main.c | 1 + .../ethernet/chelsio/cxgb4/cxgb4_tc_mqprio.h | 2 +- drivers/net/ethernet/engleder/tsnep_tc.c | 21 ++ drivers/net/ethernet/freescale/enetc/enetc.c | 174 ++++++---- drivers/net/ethernet/freescale/enetc/enetc.h | 3 + .../net/ethernet/freescale/enetc/enetc_qos.c | 27 +- drivers/net/ethernet/hisilicon/hns3/hnae3.h | 1 + .../net/ethernet/hisilicon/hns3/hns3_enet.c | 1 + drivers/net/ethernet/intel/i40e/i40e.h | 1 + drivers/net/ethernet/intel/iavf/iavf.h | 1 + drivers/net/ethernet/intel/ice/ice.h | 1 + drivers/net/ethernet/intel/igc/igc_main.c | 23 ++ drivers/net/ethernet/marvell/mvneta.c | 2 +- .../net/ethernet/mellanox/mlx5/core/en_main.c | 1 + .../ethernet/microchip/lan966x/lan966x_tc.c | 1 + .../net/ethernet/microchip/sparx5/sparx5_tc.c | 1 + drivers/net/ethernet/stmicro/stmmac/hwif.h | 5 + .../net/ethernet/stmicro/stmmac/stmmac_main.c | 2 + .../net/ethernet/stmicro/stmmac/stmmac_tc.c | 20 ++ drivers/net/ethernet/ti/cpsw_priv.c | 1 + include/net/pkt_cls.h | 10 - include/net/pkt_sched.h | 16 + net/sched/sch_mqprio.c | 298 +++++++++++------- net/sched/sch_taprio.c | 77 +++-- 24 files changed, 473 insertions(+), 217 deletions(-)