From patchwork Sun Feb 19 13:52:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 13145872 X-Patchwork-Delegate: kuba@kernel.org 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 B1652C05027 for ; Sun, 19 Feb 2023 13:53:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230013AbjBSNxt (ORCPT ); Sun, 19 Feb 2023 08:53:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44004 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229763AbjBSNxp (ORCPT ); Sun, 19 Feb 2023 08:53:45 -0500 Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03on2052.outbound.protection.outlook.com [40.107.104.52]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B28A14C14; Sun, 19 Feb 2023 05:53:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CabmCGu5yaiRDsGl2gLbdvgHnoaJ0aiBm3ZpZ29HHfzInjbgGz40/OhoNfYyMnUMtdiydjM/OHDjQELR6GYHaZC2pB77oPNi08UFCv+OXpwbVKLWMZVLfS841HkLsNFWAAjnOjkR3dyq2PRrImaT+nlt5X/PWyNpRdEmSeIuUL41J7rjCdAcOSl02QavsIY20hcnc6N+MuHzSLi2QiZcHnZwc9mrRVqTSlRhZeEJD41/PxnGBOCqHuNXS3KEglfv8kIgAPnURy32J0a0DkfZA29FIsx2bKwbtJqJRpIp+mtrinqq9zTOziCYj8wOO6/FEgYPGSdf9cDbnoL9yhzFBQ== 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=QShS6cOparXs1wiRaUsAwSj4ujBrAQYnKHPoAdZu+Dk=; b=U05hpMD7XO6WuLtFQJ53AdUvUK9ByjOVvXv/y7wtuAlDgHlsnwfG4zyEhva7oOgR+9KsOnBtHWtnTD92A/1ff+rhej8aG8AA/V/YalFslVoueWxiN33Ogf3LXTAItKwmF6CJB+33IhvHQOCvXWnmBZG0mnmdVUMZVWC8si6KoyILpXnsL1CPfXesjcvkgBiGy+GHuf2KeYak4x4OjiTNXa+O6UC2YUku32FYkJWvmvuYfSIJgymeiSdEDxxFvcTRjM00I3/QewcSzCYYhAiz3CZFTrMaYn18x6BH/2Gwnx0L6Fl2kGa1zF0gREeW0ewP97HG8eBDr9Xq0O+v5B0gEg== 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=QShS6cOparXs1wiRaUsAwSj4ujBrAQYnKHPoAdZu+Dk=; b=aKqNoBbq5z7Z9ZzZgn2YXPDUzg9rfT2EsQm8tQWq0URuPPUZJGJEtr+TqOaTcOkJ9lmnl+/MrfNZw5E62rJtPuxNDkpnQ7rO8Tt3hiuVV3ItfNATZimGm4MsadG/EDDfdZwItDXCHfK/UxkMSdDb2voR+It0DvPGLMYLtLws77g= 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 PAXPR04MB8238.eurprd04.prod.outlook.com (2603:10a6:102:1bc::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6111.17; Sun, 19 Feb 2023 13:53:43 +0000 Received: from VI1PR04MB5136.eurprd04.prod.outlook.com ([fe80::3cfb:3ae7:1686:a68b]) by VI1PR04MB5136.eurprd04.prod.outlook.com ([fe80::3cfb:3ae7:1686:a68b%7]) with mapi id 15.20.6111.018; Sun, 19 Feb 2023 13:53:43 +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 , Claudiu Manoil , Alexandre Belloni , UNGLinuxDriver@microchip.com, Andrew Lunn , Florian Fainelli , Ferenc Fejes , Xiaoliang Yang , Roger Quadros , Pranavi Somisetty , Harini Katakam , linux-kernel@vger.kernel.org, Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , Wong Vee Khee , Michael Sit Wei Hong , Jacob Keller Subject: [PATCH v2 net-next 03/12] net: dsa: felix: act upon the mqprio qopt in taprio offload Date: Sun, 19 Feb 2023 15:52:59 +0200 Message-Id: <20230219135309.594188-4-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230219135309.594188-1-vladimir.oltean@nxp.com> References: <20230219135309.594188-1-vladimir.oltean@nxp.com> X-ClientProxiedBy: BE1P281CA0136.DEUP281.PROD.OUTLOOK.COM (2603:10a6:b10:7c::6) To VI1PR04MB5136.eurprd04.prod.outlook.com (2603:10a6:803:55::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VI1PR04MB5136:EE_|PAXPR04MB8238:EE_ X-MS-Office365-Filtering-Correlation-Id: 85939bc3-a162-4f9e-8243-08db1280b647 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Q29rSgzVDF5AwG19c3sMiOdqPwJ33h7qIJKQGzkyJrjeQEmP/LfC/LPGSoM48H10n43esePBHvATtpRM8j4oPTnpaYOVJVVVPg51ZGM7GxAMptGbS0ljksIgE0zaXBrF8tVqg/Q7rh0VeSE0geymDLkkSPYQ/nHbLihZVS5GCP7D1e8M1ukRBaOA05bT71E6qplahemlj0+DMnSDpfqNAdIF3XFCdq4hAbdBPsnN0wXHgFzHUHvt3NeXCRQYr+qBMWQV4PfQDMyByNqAcJ6632H4RdkDwlog8MKqrZ+rOu3kP2JzLcXennQ7EkpKxrTekF/dPKFJd7oriBwp1Nt0V+DL0iH6qm9h1WqHKfWTZ0yjdMrTo+ywKSEQaym8EJl4plEFOfixIlV5MOegYR3A92fUESPqoOtawSIEtf/kDWb+bt+xe63SdsXMJt6LfuvJ1wgkd+xIkE2e2OxcogVSDBLo2IHdelm7hIBOC1R76UIPLgEXA0uliFcus2B7z3/MzHMqxliSmfqzYlMZBMG4hbLEdovqIu6Ep+FCeBjtEbGB8PO7cn0uJZmjkjZfBKwpW6v+2Or6jwTbku3LZa3qsmowTyiaic+HPEiTnwi+NHr/WMjbNNt93O5j1hDNQPlF593f3zqtOXxE0V/L+bcw/8LKVUk/rOAbDYOqHFXr77BVtRYolyk5TiPwVj6CpNQ8YsdPfEL5bhR3HxWzxivKJg== 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)(396003)(346002)(136003)(39860400002)(366004)(376002)(451199018)(8676002)(66556008)(66946007)(66476007)(5660300002)(7416002)(4326008)(8936002)(41300700001)(6916009)(44832011)(86362001)(38100700002)(38350700002)(6512007)(6666004)(6506007)(186003)(26005)(2616005)(83380400001)(52116002)(6486002)(478600001)(1076003)(36756003)(316002)(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ovYBgU65XOarBidDO6u4+OUiIYKHG/3VJyQigkcw5JsiNfQGKd8UzhPQlV/Fc2HThikxU5O+5V/K7wbnjeCwqDztrsiYyBWsXBogKYMf/cQlupuSIzn2sgIg7ab5VRNQEfEAb0GsfShaGba95WvNrX/Wh2lNO/c9Kd/dtrReKl7uwGyG+YYNHpH1mTNOef/7FkX/AdLnSjT5M73mAUHvFNCT7C3B1IKxcdPoRDNQvyyJCe8m6ohQi+Mea2RX6ydVHNFZ9cIePoJvOVZzcRlb/bZjh0bgfhqEuYc1DJ0giu72rVbwoCGJC/jHAcaoSx+uATwuxBDWTshNjdczvQ5Bs7eHroqsMtMeSiuX85u/pLhbB35KmK4M0W2hSxkRZKGfCFAXvXzx5gtllY0xT3GsrzeMFehnBReamdcFnWc4hJo5mw5b+cHyWTm8nU7Fj7A5JW3ydxXlDdEkLbUF5jkPtVDsKpVKCH2JoajvrtslnzcEUHg8j1aV5aPjaSJ49jF1CgS3VKGpQnSs4VVOUc6YstKnYql9AElCOnHrVvxpfquVTqehQPPPuMeI8/oklIZmI1FlvYeNXx8bYGUx8z20aelOOb9ZKWO+6hGKgXXeUOJku6tw== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 85939bc3-a162-4f9e-8243-08db1280b647 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5136.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Feb 2023 13:53:42.9904 (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: DkQ/zt4M6dF0dQYgSVh0pV0dTv7jDxBns3qdKm48RlB1Yu/5sDPP4tRMo6oswf9IzKyLffj50QlfbgV6RREPbA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8238 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org The mqprio queue configuration can appear either through TC_SETUP_QDISC_MQPRIO or through TC_SETUP_QDISC_TAPRIO. Make sure both are treated in the same way. Code does nothing new for now. Signed-off-by: Vladimir Oltean --- v1->v2: none drivers/net/dsa/ocelot/felix_vsc9959.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/drivers/net/dsa/ocelot/felix_vsc9959.c b/drivers/net/dsa/ocelot/felix_vsc9959.c index 3df71444dde1..81fcdccacd8b 100644 --- a/drivers/net/dsa/ocelot/felix_vsc9959.c +++ b/drivers/net/dsa/ocelot/felix_vsc9959.c @@ -1424,6 +1424,7 @@ static int vsc9959_qos_port_tas_set(struct ocelot *ocelot, int port, mutex_lock(&ocelot->tas_lock); if (!taprio->enable) { + ocelot_port_mqprio(ocelot, port, &taprio->mqprio); ocelot_rmw_rix(ocelot, 0, QSYS_TAG_CONFIG_ENABLE, QSYS_TAG_CONFIG, port); @@ -1436,15 +1437,19 @@ static int vsc9959_qos_port_tas_set(struct ocelot *ocelot, int port, return 0; } + ret = ocelot_port_mqprio(ocelot, port, &taprio->mqprio); + if (ret) + goto err_unlock; + if (taprio->cycle_time > NSEC_PER_SEC || taprio->cycle_time_extension >= NSEC_PER_SEC) { ret = -EINVAL; - goto err; + goto err_reset_tc; } if (taprio->num_entries > VSC9959_TAS_GCL_ENTRY_MAX) { ret = -ERANGE; - goto err; + goto err_reset_tc; } /* Enable guard band. The switch will schedule frames without taking @@ -1468,7 +1473,7 @@ static int vsc9959_qos_port_tas_set(struct ocelot *ocelot, int port, val = ocelot_read(ocelot, QSYS_PARAM_STATUS_REG_8); if (val & QSYS_PARAM_STATUS_REG_8_CONFIG_PENDING) { ret = -EBUSY; - goto err; + goto err_reset_tc; } ocelot_rmw_rix(ocelot, @@ -1503,12 +1508,19 @@ static int vsc9959_qos_port_tas_set(struct ocelot *ocelot, int port, !(val & QSYS_TAS_PARAM_CFG_CTRL_CONFIG_CHANGE), 10, 100000); if (ret) - goto err; + goto err_reset_tc; ocelot_port->taprio = taprio_offload_get(taprio); vsc9959_tas_guard_bands_update(ocelot, port); -err: + mutex_unlock(&ocelot->tas_lock); + + return 0; + +err_reset_tc: + taprio->mqprio.qopt.num_tc = 0; + ocelot_port_mqprio(ocelot, port, &taprio->mqprio); +err_unlock: mutex_unlock(&ocelot->tas_lock); return ret;