From patchwork Sat Jul 13 22:53:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 13732548 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 204C1C3DA42 for ; Sat, 13 Jul 2024 22:56:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version:Content-Type: Content-Transfer-Encoding:References:In-Reply-To:Message-Id:Date:Subject:Cc: To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=reBbLus/L/Mbwc1d66xSxhKpCm6GzyD+hP95eLSu8ak=; b=er+AOnpYHotmiG9blGm/YjVmH2 koxivxXSwrgUjhaQ8Yi88fdjjj8age/K5lXDPIFeQJCiRxnTgcHyRCo4Svwr7Kh6WTECsY2NPXjy0 zlgFMRGTo+EHt42zH6G8YvST5Tqtj/LzsrntabbPxhBYir7rLkKZtFYGhPPrWHe9FuVg91c4+X3hX gzq12ItEMKbqwNmCeUajPzRgDoZclrrgAb9UUFQZjm2EW8IIzFPyBQQxTqjMR7VoOT9mpPYeMhCiz LtxT03AQGX7eWsHZ6id8oKnw8SDWoKvABLbANGWPS98nrMowNh/xm8ySPps9YYWIUrWd+2xzcJrPI cG/hq2xQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sSlef-00000003LkY-49d2; Sat, 13 Jul 2024 22:55:50 +0000 Received: from mail-westeuropeazlp170110003.outbound.protection.outlook.com ([2a01:111:f403:c201::3] helo=AS8PR04CU009.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sSld6-00000003L3e-07JB for linux-arm-kernel@lists.infradead.org; Sat, 13 Jul 2024 22:54:13 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=IioCFRpZL/OEJRz0074hSDJ7O9Qwqy8dqodf+XFlB4t5C614KrNEYsNfQYTrpwX0JuZJdsjV77wqZxO6WnLWQnYId8ivY5Z0ETxkjqtqXCrnqVbwrgbFD1eo9A4Oq+/jBFichScVTKuJQt7+igG6YWRUuj0dX2JRmcZV9JxJfNMzPBI40Ky3sxZKPPAen9+933wy5KXr5GskIzLaeja7BgIvy9MO3NPpVEqJ9AmVSdXN/rBxIZV/pgh5Pk4i0/ryqLx1YiAlrI/UTUvx1L+zbDS4SlF0xJ744pyzL+oig87tBcuGc3mX4fBEt3bsWMUfZEZa/xcGCdzWTUEARl8BKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=reBbLus/L/Mbwc1d66xSxhKpCm6GzyD+hP95eLSu8ak=; b=cJUFT9TI9aORNF4o/etEt5FpKqI78+yWC9h5rFDTob3pQwxc3TV+eoSJetVt6BdLPHMuimwj4OgVrwRqfaAZbRrPLPPTwZuPsBCsVVCdbB8RJejNa69qJubcjQhxSmN4WpotSVen2Ze8bAm2b1mqpFVLinguJp/6rJ7Zwz02AlALcUD63sAhHRNXk8d+cg95LkBqbyDkY9blUw++20VoGBDGUynQDYs902CQRGjvTPrvq5o1TfW4TTnef+NhloN9dW5dc4WCgNRbHSdZ8LGEd9mN3Jh8nrohwR+hWTTR3amqcjIyQfDgU/H6riCzqcLqfW48Sj8dM0P+S4aqgm9TsA== 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=reBbLus/L/Mbwc1d66xSxhKpCm6GzyD+hP95eLSu8ak=; b=S7aX0WzyHHbHmd/WZO7H99X30Jb/GCalaDLXuLHI2k+/j90wUbEjNOv366UT4kI7EXTYkH76oxeiISTc7Qx4sjrWhLFPFF2N+NQNYSHXZVstZtig4II5IgyPicKY2PGpDihT007WGko6FIs6hHkPKl+b+66czJnCWUdA5rNA57U= 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 PAWPR04MB9911.eurprd04.prod.outlook.com (2603:10a6:102:38b::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.24; Sat, 13 Jul 2024 22:54:01 +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; Sat, 13 Jul 2024 22:54:01 +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, Madalin Bucur Subject: [PATCH v2 net-next 4/5] net: dpaa: no need to make sure all CPUs receive a corresponding Tx queue Date: Sun, 14 Jul 2024 01:53:35 +0300 Message-Id: <20240713225336.1746343-5-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240713225336.1746343-1-vladimir.oltean@nxp.com> References: <20240713225336.1746343-1-vladimir.oltean@nxp.com> X-ClientProxiedBy: VI1PR07CA0127.eurprd07.prod.outlook.com (2603:10a6:802:16::14) To DB7PR04MB4555.eurprd04.prod.outlook.com (2603:10a6:5:33::26) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB7PR04MB4555:EE_|PAWPR04MB9911:EE_ X-MS-Office365-Filtering-Correlation-Id: a9d28a43-f95b-4964-8ef8-08dca38eb033 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|7416014|52116014|366016|1800799024|38350700014; X-Microsoft-Antispam-Message-Info: BZsqmrS2IlfGN8yC1WRC9W99XZbJCoEAOcSchjO8hnR5XvwU8Kp/rgFulnvDFDTwqfY+nAyz78KRLScdLh5RNj2NqwFM/5p2h5O3UYHCVsa1Wh+3p7Ac8D3bMdQHBcvpsya20QGZymYISNy2f1FDZsJGQsHzB1BEhknzDFwb1YPJCLzGMYbokk/GciY7m2toGZINk1yLUrg1a8dD4veFEIk4iat6MJ0cnMjoU6ogzSljPD8HaZrj6hojXusqusjxNUzYHtY8liSmTfj/9TBIoxt9UuoLrfHkhIwS7xOC1a8nuT424uKfw+lJv3V//++k+euXE60qDbhKCDikDIk5ofAHxt47BtB2qFWldIylQzf7cTYfZhhmWg55GHQhqV6MoSY2uN8QffiZ2VXGs5u8vc3HSaKx3xMKOYAQmDPTP8EpcBNKRn7OvqqQ46roLVPR1QrRt+eNJrhndNptXnFxTJkuCyZFkE+BCm1y67aUyAI2pK0nXv7jH8btj9ib+u6zS8WzfYUoQpRVqtM0CGTbpkLF8HTr4d6SE+h/VdI4G/uSrwJjhT+XwgOLyUKybn3Gahj8yk0QP62SAMO1oeACCa0xqqhRcG04JAxyP4bitAQupEUFZNV9BWkxbY+Jt32O5pXX3it0OHFguIOZ9V2dgtgH9Gi0dLdg487Rq23SeIjoqn1kAhLGD9GR1XX+PYtumQPzHBUg3nfX7qeSpZV5IW4Sv1cNh6r36xdlDarb0bTt4FR+pDmF/L8dLFYJq5dfppULmObQaKKrMzJRU2OEXLMrPN6I+Q46nQQqQH83egqNHQWxGsa6fjlGCgICJnrJT/P6b4Du8K6hZraV014/cvv5wnL4L/AHZzF5LOHG4GudREcWaT42u1Vk7riGKUXmvQDOpqP6G4tEVEeFuL7/lqvel0FaKOp7m6a3SkM5UzwWUVQFkomGIqFbFmpl+okf9RVZAjhsq76i0DnY+R1oyF6FQRg216rg/T5x1mvcQkom/7srX/XTq8qku6QPCCoV2DtrMO8sD6gZPzesqmKZgMhv3AloAS7jPfwIDWR/gDqfPJAXK3Lr/u0sHztg0MnjbNEyXfYwvUc7J+ESTbfp74hjEnGWA1bTndOmJX6zX+14xUHKRhynOO3h6hJ9KoI0Iedosz72zYUgtlQOE5dUfbbSDK8LFWIgaqoRVwpMscMMd1fenvYwGZnFd7Z1wQUjRUZ4hcPqPP9P5GUOyox/0MWjoc6UWsEWqHO4z4EQGVnGeOFRQQHs98VMuKl0Y6MhY2h/vqCGeuACcxbHSty8nddZ0v48/s91waLMgxAU85U3edd+Cjd374LifB5HsNwg3ErG15BV9zXVvnfISP5rwrcRJtRqw4jR/x6wICJauG1CmTV8WzCIECMmOgzSwAvLQ7zTc/17cm7ZZziVoX0U9w== 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)(376014)(7416014)(52116014)(366016)(1800799024)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSp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W1ui5DBzkcJGJno6xiWQCjqaUkoJT9kYtADcpLCVHEOdmZT7CltXD7uRM2Dg9BCSs23MrZV36Sg3JJB6wo/1boR2pi/jiDwUIOjHmX5dlgRMrt5RI/kgF8Nlzw12zSL+BCtQ1jgOE0mzSBTsKP7rbsb8JtSRL4tppkGwUwAijrG3edFWKq1IZh5nFj68pCq49itoZYHeE0KlBgPIR7n0YQ7LnsffQxJTj+eJF9Bi7F/gxB9BP4y0KZJn/MijUaVkTh8lKogSIudOqSZZ16kfayd9BJ4TzfqBvl/IZ8PSQvQf3jVXKYTPtYpm/DrCNWAK0KpTd9F6JFq6UxPrc3N4r9j5yKdXFHn8r7RmyfYNfVsQW6tjuuUGczuhROwZS8Ruu+wn9SDRr6AX9/2huKD5VIZfxKjdruml6TETotJhz+ZG+CVCIPZpt7JUNM46KmyLfsCnCEYHTdeaXOBEJoe4CaV/ljv4OoiQjjD0bnKneKWWJukRNCWrw9al7rwW5qOraB1Z08mfQQLPmK X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: a9d28a43-f95b-4964-8ef8-08dca38eb033 X-MS-Exchange-CrossTenant-AuthSource: DB7PR04MB4555.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jul 2024 22:54:01.8077 (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: aFBn9Psauk6yjs0FFSTuYMxq+JHdxHaVEfWc7MnUmgnMB9so637o7freRV6v8vCOAH/5DT/0wn/Nx7rnyKCbKg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAWPR04MB9911 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240713_155412_095622_6C8DAA65 X-CRM114-Status: GOOD ( 10.41 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 Acked-by: Madalin Bucur --- v1->v2: none 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 f844c9261571..cfe6b57b1da0 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;