From patchwork Wed Jul 10 23:00:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 13729810 X-Patchwork-Delegate: kuba@kernel.org Received: from DUZPR83CU001.outbound.protection.outlook.com (mail-northeuropeazon11013028.outbound.protection.outlook.com [52.101.67.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6DA5E156F54; Wed, 10 Jul 2024 23:01:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.67.28 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720652509; cv=fail; b=QmNpKI5GlWKzE/51GaKC9228FJSQ3ZH8xLmHoOtno53YdhlXY1+ojoSrLN1DxidVuE758UQ3HlveoQ6EzERoERNOLj7Lfzh1D1ljTCBng2ARDL0vDbU1d3E1lQa03VeyAzV8BXCjz3ZJQJtfNmzLpTCdfqCLlI0IwcxhLtb7E5E= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720652509; c=relaxed/simple; bh=kMpSBs7ZtwwMYVsnVgx4LQJeIwotdegcwP97M8Od3pU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=iJDwhDz8wjML6u0xIh6yaZxwI++1W82CxP7iNsl8WXA1vDsoaq9bcrfXBjKb9zSXaNu5iXguSrzL8TRZIoESHk4NUIqVGL57Z+87/UvGDpWW/8NORrOkcqOO91pVEa4R1P3hZbQdRzX76Pf9ejVnxK0KVdUQXnLOC98tHRUuVi8= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b=bKwRYjnN; arc=fail smtp.client-ip=52.101.67.28 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="bKwRYjnN" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EKu9VSnqd8jtuKRGY+XC0aiv1f8E6ZzH2VlDjeRhQO+kFUgUTK7eLX55ItwaBRKRo3HjSCabhfBPtfLF1kxblN0uNqZkjM0xdOFHSGwhmaYl7YsYU92mc1Sc+Fr/LPpjEM3+dgXwAeC2j7Fe5RZ8H/ECYhb6HAZK+7nEhmwCooj82VY8cxLa5+PzgAkNYbosVA92LpEFJy5Hgka2iSrxzlPWTc6+ep0lltr1OROEHbxN7TxkSJcsnrBmU5qcjO0gcmxxGD2dTeI5023k6IJ0d+AkTqtNv7HuSqGgd0qxCfV9D7I+WBhrEMgAkeY4dy+6T+WWUG8POQEJrUOh8Iq1tQ== 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=YsWsdmHly93/rDvmdQVyP4SfyLHyblGCvZkBjs9fKGQ=; b=S1YFtDYWtr2BdSTTVt+HpIt4dTRo6iq5fCNmxkHrFkQCV6kqlz81LBWuhck80OEj+ejrg2J7KLlSU1pnWvarnHbUTR54Y13hEalOOPcEL8iETa829nFp3xu939zlQNOvvDGpwrFbTZikd8Df1FFgaFhzUA39LnegpgssFVAkhlDNGy+T1QpWHG9swXICbzsI/sglf6QDdyqCY5GHdDxyPmIWyRDsz7VgVzAWjtykEQgwOy4IYYf+yiQDQ8/FLfafQ4x4SoxuhrDOZ7vAfdHISigP9GTyG/bnBqy5gMpMfuVpeNKKBDMGy/u9mGNYSFNmvJEtjMUwsKJhkpLU2g35IA== 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=YsWsdmHly93/rDvmdQVyP4SfyLHyblGCvZkBjs9fKGQ=; b=bKwRYjnNI9fP6uY4Kd7QAHnA3mE1coaOrLkw4u3d1vtplGqz2VePPtdi5iWhMUSCjz7KknqhBrSFORHNJjXEYlfBavLzZQ4MXxC6FdObh7SPqTpc4eUUR8k+RDHJLtArFt8Z+XcnvUxEe1z8RlquQgkTxDdYamtAr+47mdIMYlE= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from DB7PR04MB4555.eurprd04.prod.outlook.com (2603:10a6:5:33::26) by AM8PR04MB7425.eurprd04.prod.outlook.com (2603:10a6:20b:1d6::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.20; Wed, 10 Jul 2024 23:01:37 +0000 Received: from DB7PR04MB4555.eurprd04.prod.outlook.com ([fe80::86ff:def:c14a:a72a]) by DB7PR04MB4555.eurprd04.prod.outlook.com ([fe80::86ff:def:c14a:a72a%4]) with mapi id 15.20.7741.017; Wed, 10 Jul 2024 23:01:37 +0000 From: Vladimir Oltean To: netdev@vger.kernel.org Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Breno Leitao , Herbert Xu , Madalin Bucur , linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH net-next 4/5] net: dpaa: no need to make sure all CPUs receive a corresponding Tx queue Date: Thu, 11 Jul 2024 02:00:24 +0300 Message-Id: <20240710230025.46487-5-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240710230025.46487-1-vladimir.oltean@nxp.com> References: <20240710230025.46487-1-vladimir.oltean@nxp.com> X-ClientProxiedBy: VI1PR0102CA0100.eurprd01.prod.exchangelabs.com (2603:10a6:803:15::41) To DB7PR04MB4555.eurprd04.prod.outlook.com (2603:10a6:5:33::26) Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB7PR04MB4555:EE_|AM8PR04MB7425:EE_ X-MS-Office365-Filtering-Correlation-Id: 24ca6036-6559-4553-3082-08dca13440b7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|376014|7416014|52116014|38350700014; X-Microsoft-Antispam-Message-Info: 0/sNvt2LEQO/egUOx4MTRfTqLkQ+12NghJxMik3epTXTcv/lqJ90XYkBD2Pr86qowvL3pTGQxLWcRwoysArhutjZhWz8DOWq7+aie/hScHQEkX+NvSMIkEqg7ji4jHzRdCPe6bSQ+gILjCh1Cmo+UDrn37d1HnFe6JBrgR3YWbu8DvF2fH8RcDbuWaQiS3PBQnaxZ0iGR0rzVa4vBqJwlZ85epuEek/smHKbZ1/xFbkk6Ny9pDST5XqFKz91r9bFr7lqt669k6n5fysspkmJD0Pyx/hRgYG6IsZdFSUU5wHD7J2/WEELcEjAM4CdeAs3mI/Mkl1+6diHFg8KdkZypdz+hQQnIm1xT3xIE2SM+DvooRbTpUsXMQXY4viTWIKhQ2PuHbYgabZCnw6gBXF7+0a/f7Uv4GpYhIr/DI7Za+Red0KeQSMrobrgmdAx7YacIAlNt7f3yywJSHalx7m84eCPsmhxs/32CalmVmW7FNtw8q0zQEFqrg5Hpl90+P/LKluKfuapCXXIyQt07Gu9dToujNimKNo9z5vyALsRG5wEv6lbb8e+y5cql4/0ywfQy9Tuyx4dgcJ58BOQyXTkjoaMJvtx/bfe5O0YBMc0QrxuNPwuQQWCX4CO8Jj6zmBKw9uOThnUWoltkKjmhXEtAAGQBH95iy17slMzgNYJ7LNV9vsNtrtay615h9VBwRbRs0dEoNucvd9+IR8/OHY0j7PmlD/oPXxICwfjdlcwAY/qEGGfTpM8wqnWn91PLPv+ZzRwCQ8E6Ff46RZ6Wnchk48To3wzfROVz2GHrT6n5W7t3nMxR8WmyZfFsJbiznnfIB3NTVmRWLqJfTyCkKfuFHK0cSLd46L9MHeKIZ6xzDZVg0y8xfSELPJRB0s0J0JDgL+CiqJDX/MM8RxzmfRmu3fwcQ01qxt0hcXyXM5Ir+OjtjotrkPTF+p/BYFuqGx4FhteMHLftDkOCAF1q6/cRsNQdHsuOHlPvaBfUWFDd8ozqNUXGsw42IW5ogQDS0hS2zsON2OV6bubnja+HLS7SUzEu9YbpkxwgEDkTDkPMJG6C0AHxassc+f+o85diKQUxlrpiwcLfXIBOfrGvj9akqmWwFoqALy2/dDrSb7AQ108MWClLlwPXn7qRMwbvEgEHb2fEVW8hE2mMhdZvF0blZ/n1vbrwl9NjItDh1uHURwoGX7zzMcQpLnwuiHekQSGETOExwRdKS4Po/q8aEPzgnSJiFsVWYBha3VW9tJQ/p4ZEk2fLZZnq0QfYxfB11t5odsQkkozxCvrcF9+P5ka+LYpzoL7M03P5SGplppt8Rxiqmpz5ViHKczm9xsHVAvrQeGG74TLSQPsXoOvfK/8wcGyQtTOd+35d+6jfQTDuDniFfxv3ITBDrGkZ2edqe/mRBFN3V5/yAoObjiPLRJCoQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB7PR04MB4555.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(376014)(7416014)(52116014)(38350700014);DIR:OUT;S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5SGmYs98+vudWoRow7eSLJI0XtYIs+M+vg3ZdrXAmbvFVmU4//8NQHZ+a8cFARNBkiVAH3evsd1oG1uNCyiNUqNnmVekMXfQMBztdWWRlZnL4fijpNEYn264h4fa5L2AaIcHW4bDpFYyOGLs4whYY0S6FzrbXdAvukJPQlFv6T8oYWncGLS+jMTv26xgYgfmf12Msfdjj1qPl8b8JMNbu/7ctuh9O5IVmTvs/ZT0kpGlDjb0tgIfNaDvnFqoeYDpROp3UbvaYuhltwOtrt3wp3Tfb5M+9stjp/o8uHY+svx7Y4nwM1Jtqr/w1e9wT5fbwYDQkPcM9xXsC1mcy8/ylCQEzEO2jBJwV9ZtwdeAhvx47RZrlNGYFGWnHslCSY+TxkU6WHbOEB9qCD5Dmsy4JOO7xvZWyn+wrgbq8M1vW/V268gwqKrEvMRf5Og6zjR8CisoOLV6qAaoYfVdwRKsCIuuOMGsdfhuh/3OMYMCSCfQxRFdugOZvpFHxeG7RBQLHU78muwga5XsZH/1s+QVpv3O1ZzCOLVqQzXiD0HnGROiGE6Vyht90Dr9khViO3AzmosXdfNsaiSZcL3X1fKFJw== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 24ca6036-6559-4553-3082-08dca13440b7 X-MS-Exchange-CrossTenant-AuthSource: DB7PR04MB4555.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jul 2024 23:01:37.7347 (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: ZRCV+CNfoCLqoswWIdoMq2mR6afoxXFtsyAWAnYDnV59+iUKsTTd8qVnTn0Fx2JCGOsBqV9niGD/Vj86ixcmPw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR04MB7425 X-Patchwork-Delegate: kuba@kernel.org dpaa_fq_setup() iterates through the &priv->dpaa_fq_list elements allocated by dpaa_alloc_all_fqs(). This includes a call to: if (!dpaa_fq_alloc(dev, 0, dpaa_max_num_txqs(), list, FQ_TYPE_TX)) goto fq_alloc_failed; which gives us dpaa_max_num_txqs() elements of FQ_TYPE_TX type. The code block which we are deleting runs after an earlier iteration through &priv->dpaa_fq_list. So at the end of this iteration (for which there is no early break), egress_cnt will be unconditionally equal to dpaa_max_num_txqs(). In other words, dpaa_alloc_all_fqs() has already allocated TX queues for all possible CPUs and the maximal number of traffic classes, and we've already iterated once through them all. The while() condition is dead code, remove it. Signed-off-by: Vladimir Oltean --- drivers/net/ethernet/freescale/dpaa/dpaa_eth.c | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c index e52f4cd95f97..9c0bac58a0da 100644 --- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c +++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c @@ -989,17 +989,6 @@ static int dpaa_fq_setup(struct dpaa_priv *priv, } } - /* Make sure all CPUs receive a corresponding Tx queue. */ - while (egress_cnt < dpaa_max_num_txqs()) { - list_for_each_entry(fq, &priv->dpaa_fq_list, list) { - if (fq->fq_type != FQ_TYPE_TX) - continue; - priv->egress_fqs[egress_cnt++] = &fq->fq_base; - if (egress_cnt == dpaa_max_num_txqs()) - break; - } - } - kfree(channels); return 0;