From patchwork Sat Jul 13 22:53:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 13732544 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 443D1C3DA42 for ; Sat, 13 Jul 2024 22:54:50 +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=l7dK76Tr8COdd1ECnEbBHmfZQR0iA70vm5dbcSZyz8o=; b=4tdXSguY5uhr04gSP/d5qLY0xe 7TA+82EO8HsPSlNgFPW5dtgjA0wWOuEPNtfsFalT7nwNQgAW1tDzpEIBAjO2y6G9DfoJ7+5oeQAGE XCMw7DV++VzW7k8iro29UhJbTcRWxBQMTZAFEcCgVMGIjuOuOsvI0McC54lzM4LeL4gKdu2f6J/7c foNyDN1hyYorq+7CiBbMIc3hm+S75ccYafxoLeTJ7R9a4ws0NkEE218PHb6tcHuFFw0seXagX2qAG U/ffalg1ZtC17uglUvnYVnvO+/8siR9SyzXI9+BiBOaWQN+YrxZ9r0t95jsISxMC+ULXRZJw2ClrK 5pTKtJXg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sSldY-00000003LEf-2KLZ; Sat, 13 Jul 2024 22:54:40 +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 1sSld0-00000003L3e-3veG for linux-arm-kernel@lists.infradead.org; Sat, 13 Jul 2024 22:54:08 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=xADbt9XNZiQdVWOJty964W03pBxMkzZRiQF/9f0SwIXB2uCFx47RhCHhryBfgQq3hwao36vzP5yYFbky9pTn7uelK1Zye2LdEBNSHfkgx0jkboZWMQiVjaVi8Ail0aTWXoJIGk4fKOfVIlbZ+FF9zcpJRB3cCCXfLywN2imsznStlWx2Ba4OlovkgFi/Ru8MoFwNw1RxiluSyvIO2HY58w2+eAXE3NmGPEz/VQxNwGqeGqzOX4wcJ8plhoVUI+VWLJu6b/4xbxyn4YQesQTv4sAsR0WEO37P1JYtGstlnIknX6U6prVaQBiCjwwieFsPvKzfYofRLUhzFXVjrymsdg== 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=l7dK76Tr8COdd1ECnEbBHmfZQR0iA70vm5dbcSZyz8o=; b=GSlIrUWPk/EnBKuXVfl6vSJvjBWTyaws3V+IblALmeglQufFjwvF6ZGBsJ0vGGbjSG3X56KZ6iiBTX2csIZrXgFKIBtGiYfclarYaG9b25UVF1GqqkJGHVZouFBx0dFqlbwaaOj/DqCk1fVajnQirvexoXKQSU0YnYvVLXRV8ushgGEofwTRjEAFsRnMWSDP97y00OSRi580gl5nmfZOgm9y1Ymy7TTwwcWednpmxigQKY3Z1Wd3ICJMcu4X8TYmHn5AYvn/esfsFZsJSaFvNN/m7gC+cHBNVnVR9xsQvdh9Fz0DkBQqYkBIG4uLRJb56YEKR4SQpbi/TeFSNJsOrA== 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=l7dK76Tr8COdd1ECnEbBHmfZQR0iA70vm5dbcSZyz8o=; b=RqzJCq64f9bsFb6qSVTFjUNJ5kcSgDYs6rINyEA8BQqGFPOoRPPd7jHVO/anoD407SRfwjRNz4K6Zd1r5ANrgyJQsnDYlW3F8+6ymuiRwd0Z6W7yC/M6zdl6MiHGo3XWX/8AWLMl0WfbzPbDsTbti/VaRxDT8MjWzpVsVJ+1iS8= 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:53:58 +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:53:58 +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 1/5] net: dpaa: avoid on-stack arrays of NR_CPUS elements Date: Sun, 14 Jul 2024 01:53:32 +0300 Message-Id: <20240713225336.1746343-2-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: f7b49fb1-9534-4dd2-ddf7-08dca38eae0e 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: kDb0474Xu7aduoE/91A5DyPvaWLzXkDAU8n9j+RMceIZfzP76fuPmoQGvcA+pwolegkmGMDSsh7vRBgYWt6TCx5l9S+WZQo21zuGBfc66OWwqY8Xzy0odLVvvmbJyecCckSjyzUCZxQnPHsbSn2rOnd/q8DwSSzBEfV4NLCCmiifqYUk8yMF1aNoj/O+ohTzCq4YjNylgAXbmCeD/T1O7ACciB4URorcSzdMXB7P19hXeD+wKLVV/BttZ4rbr0iv1sIzMkOyefWj4sEHuV5T1eAjqKxZhuiINsKnQHsAuGNXmmTdt4enF4mcO6nIHXHiizyVOvx2LEAdLYKh2dxLycLYljbCGKNjaa4fuKl1hs7U+g+6ZypSUioGFxNKb/yFt+UDx1EwgCPnepoLjg/u4njLkyCdLnV2SnluptU3fm6IHF5df2Bvc5X9Lqu1aFmGkpN094CCw0YQSlXxgyo7MoDkg2pZMxhej8kKwwrNDM5d9zpnX+4LdiryLfqvTxOBQkrGYdU4HBIEbfqVgPKvw+3rGlj6H5fNVMxYV2HElT4uVJ6UZeUrtbzLvP4F9dDDcGXDA1hsxUM/hv/ckjB2go6jHRWUMZGUVXY7j/QpEMq3RRt+kDLlmZzhGx3GY59W0ac4SEurmvNbgTlr8CsVpfJWRTZlZ9bIa8Cj6w6fAboV8T7onDCxIoGza1/RYTMIBbvBEEkwvD0zhwty7DzKp9BWu0O4c+95oPyl7fwpb7b/vcY5CCMneK+JuF1Fn4Om5mrDXuOk8ePSe4rqkiJSSAxMfFE6ljF+EYdPJvi3AhgZuy61dnOQoWUGeZApp/EI0+wOxi2OJjWmRs0BDxORuCQJVkSaCVb8Ekjw3FvSRcZcq2qMkLxSUQ1y7zDJXDBDuYyH5DDP9GJGdrmpV6cUAv49a8XZkUjEFu/AiOhFvseWdJmsmuv9xEDNeJOUxNEIxRMejKIcrsqkXBvvot7dX8Vdp6TpcuMldDCU28e9tbSfKLApVsYXHMLj1z90npmYBhSKCmvgfRVdOxregJTylyolSRyHZxFjvtus6dj/jAhMAa5XbHaXV8uMK155bWOc4z4IoMFE5ddKXsd2W5S322s7LaezP3rTRUgXm5/EIDjqZaiBcxzK6mwRHuEBC5pHfb0Pz2N0foIv2D8eW0NWwikf0naHkfI2OxwOhsPUrOwxHx6IIYxfX+D94WZvcFCf2OTz/3UvF9ZjAwfbPO8SyVtH8+eJshCRIVZ4e4XE39WuaRg7t7G3W49FV6A2u02NsINjLP492ZJ9bOTLQcinrsqMpSLBOq3J6BUErpKAwL47xEORFut2HUGzxP8YQzQlUUgDFZypEJFw4KBotp4kzY2wgUVrPqHGOZsYMq3lE+Y= 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-AntiSpam-MessageData-0: B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p25QlgyzlUwz9S8LJ/P4JvNEnHY5ZZ3/E/0wdQRWnvN6RWf+YVCe49bY+M+LZVU1vMpk0pkx6tQEL1cjximZpxaW/SeYNGgjEgXjrnR0683FryMNoOn2jjiMNPPGjfst5a9PWmsh8Nk7trxAKKYzBhpWDkBQHgw4UzTQEzausu9i+blicZcMU817oV3DamGcA9kHBg4sWhLqNGP5XVgpLV/84hXqCJV/B0l0jvApCHgw1Fg3QR26vUM6smPvm5MdatIzBrev3QZ/bh9ZjU9DUYbokFC8iAXccTpwRXP9z0kmbmMGUfOrWBdBjeh+Ua+N+cXZ+NwP5PCldesLF2KHXme2q8eMA3Z4X5vY6phy/cZ7T8OlwtYQktC0ynRVdnu2KkCF8Iv8AHZ9zOemlqcODl0zhxTuviUCeOYXtqWNHNVeMne1lMkzEwbRHICZF5AmKT548lk6MYrGDa/18H3Hw0J8TQmQqN4JStt4cmTIVgy6A7KkOVeOT4QPFbAwcGmA0sR4S5DWx6hJfJiE7ZAYdeEex5hU7xvGNtqng== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: f7b49fb1-9534-4dd2-ddf7-08dca38eae0e 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:53:58.2138 (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: 1z6nr5x0Zflr/Wpxxf8BA4/0ebG4YO4u+qU3+zdPOAqtkT/lGHPXomZvlU8hZ07lMb2XT5zmas+wX2Rsj4BVIQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAWPR04MB9911 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240713_155407_005986_D83F3F19 X-CRM114-Status: GOOD ( 17.59 ) 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 The dpaa-eth driver is written for PowerPC and Arm SoCs which have 1-24 CPUs. It depends on CONFIG_NR_CPUS having a reasonably small value in Kconfig. Otherwise, there are 2 functions which allocate on-stack arrays of NR_CPUS elements, and these can quickly explode in size, leading to warnings such as: drivers/net/ethernet/freescale/dpaa/dpaa_eth.c:3280:12: warning: stack frame size (16664) exceeds limit (2048) in 'dpaa_eth_probe' [-Wframe-larger-than] The problem is twofold: - Reducing the array size to the boot-time num_possible_cpus() (rather than the compile-time NR_CPUS) creates a variable-length array, which should be avoided in the Linux kernel. - Using NR_CPUS as an array size makes the driver blow up in stack consumption with generic, as opposed to hand-crafted, .config files. A simple solution is to use dynamic allocation for num_possible_cpus() elements (aka a small number determined at runtime). Link: https://lore.kernel.org/all/202406261920.l5pzM1rj-lkp@intel.com/ Signed-off-by: Vladimir Oltean Reviewed-by: Breno Leitao Acked-by: Madalin Bucur --- v1->v2: none .../net/ethernet/freescale/dpaa/dpaa_eth.c | 20 ++++++++++++++----- .../ethernet/freescale/dpaa/dpaa_ethtool.c | 10 +++++++++- 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c index baa0b3c2ce6f..946c3d3b69d9 100644 --- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c +++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c @@ -931,14 +931,18 @@ static inline void dpaa_setup_egress(const struct dpaa_priv *priv, } } -static void dpaa_fq_setup(struct dpaa_priv *priv, - const struct dpaa_fq_cbs *fq_cbs, - struct fman_port *tx_port) +static int dpaa_fq_setup(struct dpaa_priv *priv, + const struct dpaa_fq_cbs *fq_cbs, + struct fman_port *tx_port) { int egress_cnt = 0, conf_cnt = 0, num_portals = 0, portal_cnt = 0, cpu; const cpumask_t *affine_cpus = qman_affine_cpus(); - u16 channels[NR_CPUS]; struct dpaa_fq *fq; + u16 *channels; + + channels = kcalloc(num_possible_cpus(), sizeof(u16), GFP_KERNEL); + if (!channels) + return -ENOMEM; for_each_cpu_and(cpu, affine_cpus, cpu_online_mask) channels[num_portals++] = qman_affine_channel(cpu); @@ -997,6 +1001,10 @@ static void dpaa_fq_setup(struct dpaa_priv *priv, break; } } + + kfree(channels); + + return 0; } static inline int dpaa_tx_fq_to_id(const struct dpaa_priv *priv, @@ -3416,7 +3424,9 @@ static int dpaa_eth_probe(struct platform_device *pdev) */ dpaa_eth_add_channel(priv->channel, &pdev->dev); - dpaa_fq_setup(priv, &dpaa_fq_cbs, priv->mac_dev->port[TX]); + err = dpaa_fq_setup(priv, &dpaa_fq_cbs, priv->mac_dev->port[TX]); + if (err) + goto free_dpaa_bps; /* Create a congestion group for this netdev, with * dynamically-allocated CGR ID. diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_ethtool.c b/drivers/net/ethernet/freescale/dpaa/dpaa_ethtool.c index 5bd0b36d1feb..3f8cd4a7d845 100644 --- a/drivers/net/ethernet/freescale/dpaa/dpaa_ethtool.c +++ b/drivers/net/ethernet/freescale/dpaa/dpaa_ethtool.c @@ -457,12 +457,16 @@ static int dpaa_set_coalesce(struct net_device *dev, struct netlink_ext_ack *extack) { const cpumask_t *cpus = qman_affine_cpus(); - bool needs_revert[NR_CPUS] = {false}; struct qman_portal *portal; u32 period, prev_period; u8 thresh, prev_thresh; + bool *needs_revert; int cpu, res; + needs_revert = kcalloc(num_possible_cpus(), sizeof(bool), GFP_KERNEL); + if (!needs_revert) + return -ENOMEM; + period = c->rx_coalesce_usecs; thresh = c->rx_max_coalesced_frames; @@ -485,6 +489,8 @@ static int dpaa_set_coalesce(struct net_device *dev, needs_revert[cpu] = true; } + kfree(needs_revert); + return 0; revert_values: @@ -498,6 +504,8 @@ static int dpaa_set_coalesce(struct net_device *dev, qman_dqrr_set_ithresh(portal, prev_thresh); } + kfree(needs_revert); + return res; } From patchwork Sat Jul 13 22:53:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 13732545 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 C8DA1C41513 for ; Sat, 13 Jul 2024 22:55:10 +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=cWpEZlDOAvjqFmicNvjYhzYnxtBGTi/p8qJbBUJitZM=; b=d5sQLUKjfxuQXQESVN8cW8OxdO 3nENREZTv1lXfDUIqV3mOQhrp2Crbb98u/WW20qj0JxJAWYMOu4jU0dcLMVsenOhgfMgjDHd9sM2F ZU8ufXRVigfls1GENsSR8bH8fHDxR47C17FqiJSipGKPvkB/rwYk9ZF0QkFyogWIoMmlBlPyF60Xb /T/yMEV8i1SLOg74j8YH1wuQPB/67dWDfumcHoWAqbplNvskvNQO453x+JmD+qO2H0+M9Utvx/sgn JUUTPuy4xsWa+15E13sKVybxslwjUYjuVKLZBr42jenfWeJXRy33oTyNL1Z2/MPNsDFVH9zFKs5GI 88fIAKvw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sSldp-00000003LMm-2ybV; Sat, 13 Jul 2024 22:54:57 +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 1sSld2-00000003L3e-2spD for linux-arm-kernel@lists.infradead.org; Sat, 13 Jul 2024 22:54:10 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=GnlWmpT6FpARsycIoEADTfWx/Rgx0S0E9WsSwrCIe3beYvvDj3X5pMP1phsu03GpVmPcAAUXsFAYJT6SUzINBdKyrK9lx1YokL692fKXkvmca9pZcEMldsTV6mfg/1On8AWvZ3yLay8LLQBQFbzL5R5g4eMhVmZ7RGiMUUDHVRY9PdScYgETzKOPHfWWKwgeLOeFNf9CvIKu8xlsI+Gb/1tTqfwS/FDnOklJaEaTZu2gscp90nLwgsm83rXnvaA5c4gdnqSxzgy4l6MbSO/WlA/esFktFnuCFNVq0e4y5olRlVhnz5rr80qBtbZ0ZWW75ZwHcHCtlXI9ikwVLrQ4Dw== 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=cWpEZlDOAvjqFmicNvjYhzYnxtBGTi/p8qJbBUJitZM=; b=VLiIevaoDrggviRQhNoXvBxQoSZRGSkbNycXsxJiYk3iUD/TIYvbCYyr6ZtXfACddbJwAvWGFw9rg+K6teZ7g74kuS88PPAdWeWr684mj/2R2k1WfY6ULMWhpj2oi0CXAcO0N9NEEyoLN7eUz7P/zh/zOUZ6dzlGG6KvfH6L8cF6uT/smLtIPmyUds2gpwlIssKiceASPYqDaQI63ZZ5xzXv13EpnVvoZYfXM5p5vkVjHdypd/8hGDip1ij3rbEGY9i4/HMeULni46ycbQflwZmtqmzF5gaBGy2s67n5+x9P0cgJGmqZtEE0SaH9d1L1lKc9j3sNQLnZv8gOQqvw5Q== 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=cWpEZlDOAvjqFmicNvjYhzYnxtBGTi/p8qJbBUJitZM=; b=HMv0EKb+JutvCdVS3gepw+T7pIJF1lLkFjUBSwFrekE7r3mg8iiOluFraqgT4PjbRoA+3yOzo+Vi8qg4bvjzhpCtXF1wArTwuV1FfHb0uQyXZ+4S4c9vdKkFtMX1s6DjG5IGEq1GZCJEA9zU7Vb76pjzcVxWGdACs/mOw8Bv+a4= 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:53:59 +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:53:59 +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 2/5] net: dpaa: eliminate NR_CPUS dependency in egress_fqs[] and conf_fqs[] Date: Sun, 14 Jul 2024 01:53:33 +0300 Message-Id: <20240713225336.1746343-3-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: 59f13133-9e65-4850-b2e2-08dca38eaec5 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: oSdmOpOuQ3ow31CbexvUhd7xW2xRqu10ACaelwLts/KIEGCY01oUtd9KcmfDvPwXbM7gLANn8CjiZEvKC9mKzloANsvFOFQZHoV16Ow4472dmo21T4yEEzPQ/bL8wlcayVo7d/a83VhzT1GNHJIOQyqBc+3RwOKAHoNndP2Pduq5c2JrlOLSpU6+VNA28dFd/h2OnzggfWsZETrJFCE6m9gkHt6VEOxDMAS2qkQ9asihqCnFAGcyHUh74Kd2wc1A4lgl/gDG/xnYW/x9e1TpxrRxEAmgN8lK4SwWu0T4UhC8ws8GaPTReSxn+XdtmEA6Y3dTUoVnoWYM2Uvpc2Q8cN9GwLrhqAEc+sdPosfuJ07M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.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-AntiSpam-MessageData-0: MsD7xH7oAhZh/TGmhybhmESH4QDCWy+t+ktk3gKY3DuUG/Ilolq9js/3UWrDeuJHojvjuISf474KWRmXMuAhhRN1dCaXu5b3slXFzr5Ni9pjJsvwLbp5/BgLS0wJ7pkbWsJ8wxSQv3DefgfZ/gUlYFN8ws5U3LwXQ73ct0hs/+Favj/lyS+4kTnFWdIq3P1T6w2PIIqJ9ocjTo1yDxc+KlKkoi1Y22OQABzv8tTqLcInrC7Nektg8DdDwuK8ObeWzWfdQftJjWxAm2Md+pqbVzuhv0aPR2I8LXLcyq4XwTapIITW/MUDosFS0iQHtnmjAfzQaxhHlrKSpzVN4gcTJtMkQwK+Ou0X2AwRRiuWxrhXoWDoWD3f4PuRRsie2gjOFN4YTkc71AObQtYbtO+p2yINfIfO3husrUXpTk/0COcfKALTPU46EWybRHijxXQgKZej3NMUQIAfBjwqfwdSy+r2ScB2CdMSVuHFeNdHrQdAo5TBcjnB0cMIwBbo8SHgluXMgKBOhX5CVm113dD7L0m1ZtmUrSuP8pjU7rJeAJy1xFjHDvDN3h3ho9suTPUWQ6dxXGaWmd8hV3PgC8nSlwaSuMG6s3XXa98tphBWZ0QDN9kcYIlAxAnJMLj361+ItQN6BZBdoAzz27WmDVTsdbGHPktO0xscE3NnSdMsBTvBIhrDosvtyneZTyXdb63XwbBu/rUi5gAWSIC9QSxmVjzxunq70RRIwxe6KAeIwjPowA3jc3rV43t4o1uU0QqmoP/9QFV2dkUieHkB+jn+8mY/qRBJqS2kLRKr3FdlD+U0d4RJAf4sWxcw+0cqbkzGPJWtGpiHU5pETFWmqZpfXdcT4b2tQ0Ecj3W9lTY3Ru5EhNTb1VoqyLemzGrE9axjxHNhq0zJOmBKD28eEhu17saw5wDZElgnk58ED+U3n6T2JVpDjW9H3k0RPdbb82FaFtYgJpKPGEZbM1FGF0GjkvvNb70H6Gzv83MzbILAq3RTEVhHisW9O/YFLq2qsQUcwKnrrFyxCntKhPqHO9CHpD91xJPBcLMB7jKC0Mbz1W4Mz0m9hSVR0qwmOgYfFl6IhGQ86YWAADG0sh0byDmdeLTKFbVsKybBwezlO8EGKAMrWzlYuu86opViNl4CclK8Ugtg3PWFVWxAvaq1LKJRWcPx+fmgIBdXGWGowyatZ15sS4GvCo8gsA2fiKCQTmzbOLSeTRX79W1nLXvSISF5ccgIq6AVCyMwgToJtvb+TN2KQwwG9zo9SENB0VnOHQaaLVKJrr/9X+tHDQNyITPTs2YliAoUaGzhDY7EMB+I6Nj8VEcU15ZFbnnBIKrQq7v7MrpR5Vy5kkyRKzIMkdICIvUe2Pb27oEy1w5hVW7uER4sTh/cpGmh6d+wbqepFjlEyd9r7folbXfroR5ZHUywhrtkq/J6gTBCVAtbHweUOkBeNkGIdzPnQ14aXpfLa/VKPEiP9sRIw4lY+jyAfz85gJtKpCk1P+tYo/z9Fzg+zzgcX8tIT0r9zQmfqOKvcuxRZWP0TQqVtT9Ruxt1TTWWcDNA3Z2ANoL3XoUktKBfFhH+lCOi6D5x6/TyW58TLamgEO8GWPYp/DWtaqlb3b2BQg== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 59f13133-9e65-4850-b2e2-08dca38eaec5 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:53:59.3957 (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: e7dcpnzp6k+s6d63YNtGEGHH1MkMDcBgoaBl+KSJuStAyl2W7AGEAvsTwggYwWTahFKpoB42QlAnxYkASFWwrA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAWPR04MB9911 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240713_155408_906773_55502C37 X-CRM114-Status: GOOD ( 23.38 ) 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 The driver uses the DPAA_TC_TXQ_NUM and DPAA_ETH_TXQ_NUM macros for TX queue handling, and they depend on CONFIG_NR_CPUS. In generic .config files, these can go to very large (8096 CPUs) values for the systems that DPAA1 is integrated in (1-24 CPUs). We allocate a lot of resources that will never be used. Those are: - system memory - QMan FQIDs as managed by qman_alloc_fqid_range(). This is especially painful since currently, when booting with CONFIG_NR_CPUS=8096, a LS1046A-RDB system will only manage to probe 3 of its 6 interfaces. The rest will run out of FQD ("/reserved-memory/qman-fqd" in the device tree) and fail at the qman_create_fq() stage of the probing process. - netdev queues as alloc_etherdev_mq() argument. The high queue indices are simply hidden from the network stack after the call to netif_set_real_num_tx_queues(). With just a tiny bit more effort, we can replace the NR_CPUS compile-time constant with the num_possible_cpus() run-time constant, and dynamically allocate the egress_fqs[] and conf_fqs[] arrays. Even on a system with a high CONFIG_NR_CPUS, num_possible_cpus() will remain equal to the number of available cores on the SoC. The replacement is as follows: - DPAA_TC_TXQ_NUM -> dpaa_num_txqs_per_tc() - DPAA_ETH_TXQ_NUM -> dpaa_max_num_txqs() Signed-off-by: Vladimir Oltean Acked-by: Madalin Bucur --- v1->v2: properly return -ENOMEM in probe() function .../net/ethernet/freescale/dpaa/dpaa_eth.c | 47 +++++++++++++------ .../net/ethernet/freescale/dpaa/dpaa_eth.h | 20 +++++--- 2 files changed, 47 insertions(+), 20 deletions(-) diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c index 946c3d3b69d9..ea1fcee77f9b 100644 --- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c +++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c @@ -371,6 +371,7 @@ static int dpaa_setup_tc(struct net_device *net_dev, enum tc_setup_type type, void *type_data) { struct dpaa_priv *priv = netdev_priv(net_dev); + int num_txqs_per_tc = dpaa_num_txqs_per_tc(); struct tc_mqprio_qopt *mqprio = type_data; u8 num_tc; int i; @@ -398,12 +399,12 @@ static int dpaa_setup_tc(struct net_device *net_dev, enum tc_setup_type type, netdev_set_num_tc(net_dev, num_tc); for (i = 0; i < num_tc; i++) - netdev_set_tc_queue(net_dev, i, DPAA_TC_TXQ_NUM, - i * DPAA_TC_TXQ_NUM); + netdev_set_tc_queue(net_dev, i, num_txqs_per_tc, + i * num_txqs_per_tc); out: priv->num_tc = num_tc ? : 1; - netif_set_real_num_tx_queues(net_dev, priv->num_tc * DPAA_TC_TXQ_NUM); + netif_set_real_num_tx_queues(net_dev, priv->num_tc * num_txqs_per_tc); return 0; } @@ -649,7 +650,7 @@ static inline void dpaa_assign_wq(struct dpaa_fq *fq, int idx) fq->wq = 6; break; case FQ_TYPE_TX: - switch (idx / DPAA_TC_TXQ_NUM) { + switch (idx / dpaa_num_txqs_per_tc()) { case 0: /* Low priority (best effort) */ fq->wq = 6; @@ -667,8 +668,8 @@ static inline void dpaa_assign_wq(struct dpaa_fq *fq, int idx) fq->wq = 0; break; default: - WARN(1, "Too many TX FQs: more than %d!\n", - DPAA_ETH_TXQ_NUM); + WARN(1, "Too many TX FQs: more than %zu!\n", + dpaa_max_num_txqs()); } break; default: @@ -740,7 +741,8 @@ static int dpaa_alloc_all_fqs(struct device *dev, struct list_head *list, port_fqs->rx_pcdq = &dpaa_fq[0]; - if (!dpaa_fq_alloc(dev, 0, DPAA_ETH_TXQ_NUM, list, FQ_TYPE_TX_CONF_MQ)) + if (!dpaa_fq_alloc(dev, 0, dpaa_max_num_txqs(), list, + FQ_TYPE_TX_CONF_MQ)) goto fq_alloc_failed; dpaa_fq = dpaa_fq_alloc(dev, 0, 1, list, FQ_TYPE_TX_ERROR); @@ -755,7 +757,7 @@ static int dpaa_alloc_all_fqs(struct device *dev, struct list_head *list, port_fqs->tx_defq = &dpaa_fq[0]; - if (!dpaa_fq_alloc(dev, 0, DPAA_ETH_TXQ_NUM, list, FQ_TYPE_TX)) + if (!dpaa_fq_alloc(dev, 0, dpaa_max_num_txqs(), list, FQ_TYPE_TX)) goto fq_alloc_failed; return 0; @@ -972,7 +974,7 @@ static int dpaa_fq_setup(struct dpaa_priv *priv, /* If we have more Tx queues than the number of cores, * just ignore the extra ones. */ - if (egress_cnt < DPAA_ETH_TXQ_NUM) + if (egress_cnt < dpaa_max_num_txqs()) priv->egress_fqs[egress_cnt++] = &fq->fq_base; break; case FQ_TYPE_TX_CONF_MQ: @@ -992,12 +994,12 @@ static int dpaa_fq_setup(struct dpaa_priv *priv, } /* Make sure all CPUs receive a corresponding Tx queue. */ - while (egress_cnt < DPAA_ETH_TXQ_NUM) { + 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_ETH_TXQ_NUM) + if (egress_cnt == dpaa_max_num_txqs()) break; } } @@ -1012,7 +1014,7 @@ static inline int dpaa_tx_fq_to_id(const struct dpaa_priv *priv, { int i; - for (i = 0; i < DPAA_ETH_TXQ_NUM; i++) + for (i = 0; i < dpaa_max_num_txqs(); i++) if (priv->egress_fqs[i] == tx_fq) return i; @@ -3332,7 +3334,7 @@ static int dpaa_eth_probe(struct platform_device *pdev) /* Allocate this early, so we can store relevant information in * the private area */ - net_dev = alloc_etherdev_mq(sizeof(*priv), DPAA_ETH_TXQ_NUM); + net_dev = alloc_etherdev_mq(sizeof(*priv), dpaa_max_num_txqs()); if (!net_dev) { dev_err(dev, "alloc_etherdev_mq() failed\n"); return -ENOMEM; @@ -3347,6 +3349,22 @@ static int dpaa_eth_probe(struct platform_device *pdev) priv->msg_enable = netif_msg_init(debug, DPAA_MSG_DEFAULT); + priv->egress_fqs = devm_kcalloc(dev, dpaa_max_num_txqs(), + sizeof(*priv->egress_fqs), + GFP_KERNEL); + if (!priv->egress_fqs) { + err = -ENOMEM; + goto free_netdev; + } + + priv->conf_fqs = devm_kcalloc(dev, dpaa_max_num_txqs(), + sizeof(*priv->conf_fqs), + GFP_KERNEL); + if (!priv->conf_fqs) { + err = -ENOMEM; + goto free_netdev; + } + mac_dev = dpaa_mac_dev_get(pdev); if (IS_ERR(mac_dev)) { netdev_err(net_dev, "dpaa_mac_dev_get() failed\n"); @@ -3472,7 +3490,8 @@ static int dpaa_eth_probe(struct platform_device *pdev) } priv->num_tc = 1; - netif_set_real_num_tx_queues(net_dev, priv->num_tc * DPAA_TC_TXQ_NUM); + netif_set_real_num_tx_queues(net_dev, + priv->num_tc * dpaa_num_txqs_per_tc()); /* Initialize NAPI */ err = dpaa_napi_add(net_dev); diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.h b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.h index ac3c8ed57bbe..7ed659eb08de 100644 --- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.h +++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.h @@ -18,10 +18,6 @@ /* Number of prioritised traffic classes */ #define DPAA_TC_NUM 4 -/* Number of Tx queues per traffic class */ -#define DPAA_TC_TXQ_NUM NR_CPUS -/* Total number of Tx queues */ -#define DPAA_ETH_TXQ_NUM (DPAA_TC_NUM * DPAA_TC_TXQ_NUM) /* More detailed FQ types - used for fine-grained WQ assignments */ enum dpaa_fq_type { @@ -142,8 +138,8 @@ struct dpaa_priv { struct mac_device *mac_dev; struct device *rx_dma_dev; struct device *tx_dma_dev; - struct qman_fq *egress_fqs[DPAA_ETH_TXQ_NUM]; - struct qman_fq *conf_fqs[DPAA_ETH_TXQ_NUM]; + struct qman_fq **egress_fqs; + struct qman_fq **conf_fqs; u16 channel; struct list_head dpaa_fq_list; @@ -185,4 +181,16 @@ extern const struct ethtool_ops dpaa_ethtool_ops; /* from dpaa_eth_sysfs.c */ void dpaa_eth_sysfs_remove(struct device *dev); void dpaa_eth_sysfs_init(struct device *dev); + +static inline size_t dpaa_num_txqs_per_tc(void) +{ + return num_possible_cpus(); +} + +/* Total number of Tx queues */ +static inline size_t dpaa_max_num_txqs(void) +{ + return DPAA_TC_NUM * dpaa_num_txqs_per_tc(); +} + #endif /* __DPAA_H */ From patchwork Sat Jul 13 22:53:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 13732547 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 EB83CC3DA42 for ; Sat, 13 Jul 2024 22:55:44 +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=9v4et4kqf6akDULpyb97OeL3zo9BKzIfcLnB6xgqBAI=; b=BY4qpdfsdaIpKdNXIDtdUTRz1Y oVqrFDb85FxxsW6EIt1/w0//jcx/c7EMBuV6yGMHvbPAcDmfBavE1uCg9GYdTkFSQ4gMnYPmuT7J7 EZ0bqshZKEnMNmgvcpw81u4E07nO8/VbAi6wA05mfAHW/xGOwUX2PLj2RsHz97LuRbySqLBq4vwdw 0dI2WbnFYPXNY8tMebQasUX3P3XtfffGvSXHJGfJZvy5eJ6gE8dmX7QFvBvpk1dGTr6kNMo4hivh2 rGSBbsVIZL7XWXcLJOBVsMbUNXd8C5o84YY8nR5oUgz7vQA3TQVVhhqttX4UGHj1gXJVSDdbTowS8 qzETc8zA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sSleP-00000003LdT-32V8; Sat, 13 Jul 2024 22:55:33 +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 1sSld4-00000003L3e-1l3c for linux-arm-kernel@lists.infradead.org; Sat, 13 Jul 2024 22:54:11 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=wrCvwcpJiFwcwxFxhQsjSGANK85aNwEcAXuMAT+hyyIcQMck+qSYoVsxXveQBuoek4Ca7aGsswL/q4OySO/IAd/8/lG4KFr419JXrxTiCbaxmR5N5U+9kmBLjAa+LDQE3hbGy24Dpo3dP/CtA2PioXGnFs/gY6SppxlAR/u8ViIreyf+vDKARVkJcwOH5HQ1rz2NsE7AZPXnBUoWNieE/JG8vSTulk2zcSmYusKnMC0b24U7/PY9NXL4Gv3rhK8wf7eQuYUMiqZSCSzNYrPFOFHmMZsp3MxyaM6k7jQvlFN21pV+S/NrxP7YSMpugGfiSGM3ivpAGGZqCdwYS7MOVg== 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=9v4et4kqf6akDULpyb97OeL3zo9BKzIfcLnB6xgqBAI=; b=wABSfb8WYQjcpvPIlykBaTXODRZeXFPEP2mRqgZEcb+VXx3l+qFsGcEjtVE/qF+7yhrpkASOFPvBL7zZPykX6ukOlCSKUwfDIT7eBTWkDjXwOQ2l4df8uREq8Run+5//lebx2/XEm8L+/9Pbw1DyPx6TELndgsWu0biTuwoV0WBPkTDBZCPZLuYAmFbSohw/BkDFH0HTFE40IomcZ+Y0JSyHKijOjeP6KU8RP0CvJy+bUFbAa1xbsm51Lbve3iDl46JAJO9PXzkUQtotf7JU8XNjIbqV6QtiY7D3aNP0nGO9rA9L9AlJTmc5XbQKkbuw/im58qpGIndYus30ICnSCw== 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=9v4et4kqf6akDULpyb97OeL3zo9BKzIfcLnB6xgqBAI=; b=P+ZSQlVF3sWBrlo3u26u1gKn63vLwpx0NI62h0mWHq4FcZEka8u0a5HEjHJnGz4Zq7pM4PjPsLuaoHLr+oRVsIFNWShJS0TPqYTAms+gFQhQOu/5QUOgiHZF8tazzDtHujFzLf0e857mghjad/AEl04faJHz77KEz0KLKkYA9s8= 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:00 +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:00 +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 3/5] net: dpaa: stop ignoring TX queues past the number of CPUs Date: Sun, 14 Jul 2024 01:53:34 +0300 Message-Id: <20240713225336.1746343-4-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: dadc02d1-e00c-42eb-ab04-08dca38eaf7b 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: uzxs2KYSgqbqQei/KAwA9DOAf4+Zfu2h4LAvVp1FxmsU1yNqpTBZIKA7YnoWf2WpG++LAegQEx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tYOQdpuEeBuj17mBLg2jLyrFBOEfJUJpyg4ovxyVjqt8L9WXF5Mp1grIAEdabiBfNZ+nQdXp+y0gTjrhdJozz0j56yHkWpRAyLjM9VpEOEx5JVj4J0tXz8hhGPNYEGIfvlJvlH83XAf3ApwDBS6U2McDOqlFRlXS6YKGDS/+jj/SDsYzQ48VA3QXZrW+XXnzjYt4SNspqBuRP6JckvYKdaaUyMBQDVbZaHpsLRNojTNF2Ep2JWoLJjz9Fbf4Oz/6jbs9jl7nuozVEWdwQ== 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-AntiSpam-MessageData-0: 0vUavGvIqfF1aCuaND2ANR3Vg650NbHvIc6N2/mlA9b3bkbRuKZT2KhOKJC8JPPGnQWKRWXqQngeybZzi2nMTRyP0jREQNWmzjxsdu5a6ZQhciObhYGLDT68g1zK0LfVzixklzsjwHSvGYpbFft3sFqgr/0q6h+DsLw7ZADR+gUj36IqkmZvEoEDoRBk+biVikRNw6/rcV0eB1XAsOmebFWY8E3UDqCypCP2X6aoxIsZ/oiRUEWwx+XuYfjkL/CpYZ/ef+CX5tFGIS24WXOZZwnluBkh2DSFzCnHSOcD+w9WbKQAc/6AU7weZYQ2Y0WGxlsigFffxgzUHTDTIWotDd8wzHpG90kZ8iAGFVKwotNGZWeoes3uXWCzc6vVByLYUtVo4T8fJVhakRw0WxhFqVtj0AdA3QtImB3jm0YN8/toaJgb+HIVk4gqVx4MfI4QjQAn+TbiMbaUU/eIxcQq6zYxslGuwYwBizYAt8qimrTs3lCQwuLJ2mop7aXzJQiW4F0jPhrAiyWmVJuOj0IzLb5WVvuWmBd4zS3lr/y6bmZQIJQeRuE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rossTenant-Network-Message-Id: dadc02d1-e00c-42eb-ab04-08dca38eaf7b 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:00.6214 (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: zjcaMi43707Fqx9RcPNN5LQar6lMEC4ouvuHOylgJM8KWHPH7b165EYyYcGvyMgVY3vBzxNB/Rebw3ki+4OCDA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAWPR04MB9911 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240713_155410_482437_54868B3D X-CRM114-Status: GOOD ( 12.13 ) 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 queues allocated by dpaa_alloc_all_fqs() and saved in &priv->dpaa_fq_list. The allocation for FQ_TYPE_TX looks as follows: if (!dpaa_fq_alloc(dev, 0, dpaa_max_num_txqs(), list, FQ_TYPE_TX)) goto fq_alloc_failed; Thus, iterating again through FQ_TYPE_TX queues in dpaa_fq_setup() and counting them will never yield an egress_cnt larger than the allocated size, dpaa_max_num_txqs(). The comparison serves no purpose since it is always true; remove it. Signed-off-by: Vladimir Oltean Acked-by: Madalin Bucur --- v1->v2: none drivers/net/ethernet/freescale/dpaa/dpaa_eth.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c index ea1fcee77f9b..f844c9261571 100644 --- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c +++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c @@ -971,11 +971,7 @@ static int dpaa_fq_setup(struct dpaa_priv *priv, case FQ_TYPE_TX: dpaa_setup_egress(priv, fq, tx_port, &fq_cbs->egress_ern); - /* If we have more Tx queues than the number of cores, - * just ignore the extra ones. - */ - if (egress_cnt < dpaa_max_num_txqs()) - priv->egress_fqs[egress_cnt++] = &fq->fq_base; + priv->egress_fqs[egress_cnt++] = &fq->fq_base; break; case FQ_TYPE_TX_CONF_MQ: priv->conf_fqs[conf_cnt++] = &fq->fq_base; 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+3p7Ac8D3bMdQHBcvpsya20Q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P9P5GUOyox/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-AntiSpam-MessageData-0: cNF8xoaLgEObU2/mUtGe1+asWhcGopARRFar8nzCZvZMebwT9fRFANmP+7tiqAjW8SOsysgWI6zjAlCnv1B7q2/aVTK/nYOmOXgMldyWElhNrzsrPBl8yl3xTAdIz4rfsz7glXwVsKYftTrB9xXyuBcYXWlCdsFNgT4HSJC+d9E66qtUJwNpY5ZRJGtQrPeEIibEH+v4cNg2zCk6iYyqlS9VoLHW8WHfZeHSepqgDlmEOxptAEk5LDCcleY2QAMhn94+SRt2C8J30hrvZaXe/UAXij3o8p3FnBYP2usVuwa9v0CnluCK2Shnk0G7C8v/sP+vFF9/4yx8jwMusMqyJ/Kqwi7XNqvRX585UsXIxC24gmqMws7ouWaAsBofkSD8CiwiRqZZhl47xW+iPZQWVLfOQT15Rk/NnMGU02rb/la1prEwLKXNTGO6/S5NoHD257NYHZ1XEayxc5MV3LA/de9RzEOQvSjcn/v4aP8j5QlaMvxpeeU4F62J4b1AWPnZh2Dc8StcVliidPRL0gsQsUfnGrtDTeG0fhkRWTW0M19nJ5k1iNSNBuOovvluZ4Du0P5imJ9oxAcs/h1K4IkaIj3ORxPpelxAYr8lnQaiIieVA02oNQN424OkBVcyzsGf5BRxiNwkIlraeFeJ/YM6ef/xziRWhgC2jwd8Ematt6vu22nb/4furFtKsyEzD92mzpdSoMb4L1/5d/7rpKIntrjCoTo0HwsQl8ghzxJAmA7A/bAvvyFN/cXlWw4JYOp4zewfC18kVeTllNn/tNmgLVhCJRBZoW/bgojM+ZsTPoMSE4tvO5RquPpbqyjTUwnLWtUsQdkValsrj6PxjcA+ajbwV5tcSJcjaASAlj0eE8i8BttTIvdtMZ4C1qJ+qxuR+y1Eh0q/8MV+TlCB3GCeyfzuF+hImsExJUeGd3pcJC17p5DEzXnCyYQ+a3ZIp/qBctU1VJwzf28tF1B2edYOyfzzSQUpZtMZlZXXNDMi+y1cfgOKqXDxubEPJhZH8ZLAtD1rl/0shi4FpTJ2ha61a0qRhDXaz7J/4QW8pi/Oux3rigUAeeW1ui5DBzkcJGJno6xiWQCjqaUkoJT9kYtADcpLCVHEOdmZT7CltXD7uRM2Dg9BCSs23MrZV36Sg3JJB6wo/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; From patchwork Sat Jul 13 22:53:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 13732546 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 3956FC3DA42 for ; Sat, 13 Jul 2024 22:55:26 +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=DSqDaO5YbDleAdPYqgDMjjDvO9vm4MKyVo1hOfZkX8A=; b=lUXak6eCXGGzFLo+yuPmLAyRgM AyD/23LPP27B3dt3W7KKrFMuPZTHeHEgGuuqJBC4OCmVgRRAlEk32Bd6D3SB7t+/hrsHHgrXV8y4a msSJGTtQ2IvZqvIhFt6BCmfOn8rOkR+I/gtDgZZcEaFRqBXBvSE28zgkGYKZu1d/5C2STtYT2uJJc RGuZ4gw8lVkovBAi/plNsXGtDFGwc26X4yPzWWw7XXUMxTVVVifXtsNzYJYG08RE8RYFdpygnKN3f u5WMJAXnQMWO02UjDZwc2R7EaBGsvd8cp1VkHXURs1lY/qx5+UHyOJBvXKeaFEydLradEEE9bJkuw /C427BIg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sSle7-00000003LU6-0unA; Sat, 13 Jul 2024 22:55:15 +0000 Received: from [2a01:111:f403:c200::1] (helo=DB3PR0202CU003.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sSld4-00000003L4V-1Lt5 for linux-arm-kernel@lists.infradead.org; Sat, 13 Jul 2024 22:54:11 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=TJqAnLVyovDFNi65pvxZIuDZRgwoOgMMcMwkp29qfqQ6ypvKRcFsDCaDuHZKIPlBbM0Wx5wkkejptwVwe7Qpd1bT64Egi9QvUEKjRLvO5UY7NGs9Z7GmDcWJWf6JN4NCgliGogzbnS+4vUwws9EpJ64yALnjafRmP+OwYvTp8QdJFS8fAVpSpUzLZaeb7mN4syuC26Qs/rYS4ctFjmxnOnXWSdzUCG4JuntuxfIFbyQx1zNeznJzooiR+eTx2E8tSMSx/Op3A/V8co7tyWPUJJ0Fb56H9VJnz/UowgObciOOWIHAeqqcIqS9Jeu+zrvn8hktWXSg2SoEK4CUt3cw6Q== 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=DSqDaO5YbDleAdPYqgDMjjDvO9vm4MKyVo1hOfZkX8A=; b=ZVTDhGZW3K6tkrf8QOy8OhXlmXXXYIRcoeozkX5cF6wEj5C4bg2RcJ6Ufh2RGi56Po0cdu1JDWurk/WgcVYh3+43HMCssIwYL9vovQ3HbQSJvUr2up/k+3zYgODTRD8u1IC0xH/qT/2wPnODdiRnon3vW2BZp5URvjg/Zn1v4wyXfxUaVK4d7dfRpq3TOIgD5ylQygCdYj2FmMIBmq2E/Whp4XaRGZodSTh6NdlaAGJCuIStsZ3Ik+Id6kT2A9/4oFwDcU/cYsgjR2AvpQHk7ncaqgMGN4iXtdNdT9Euqz66Po3sg13gSdEN4AngQ2i9f5wn/WUZMu6kklBECzTuUA== 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=DSqDaO5YbDleAdPYqgDMjjDvO9vm4MKyVo1hOfZkX8A=; b=W6kfWeT/Iy+I1Fwb3N4HbeNm3WJ2HctAWZb5NUS/64y4aAfioVqzgBFUJApNKS4pNnnpp8KHKX0Sp6BvHBsV1c2ZzLwd0ypuJ0z/eBr6DCFE3SpJVih3pRE/VRkREXJq/XBUFKoJdoI1xBTAMBhhZZTzILA4F6UuGEha5trQNHk= 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 GVXPR04MB10873.eurprd04.prod.outlook.com (2603:10a6:150:224::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.27; Sat, 13 Jul 2024 22:54:03 +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:03 +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 5/5] soc: fsl: qbman: FSL_DPAA depends on COMPILE_TEST Date: Sun, 14 Jul 2024 01:53:36 +0300 Message-Id: <20240713225336.1746343-6-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_|GVXPR04MB10873:EE_ X-MS-Office365-Filtering-Correlation-Id: 67461694-2c33-4320-7e2b-08dca38eb0e9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|52116014|7416014|1800799024|366016|38350700014; X-Microsoft-Antispam-Message-Info: Z7o7lS182c9ppPDNmx5mLMfxVWpYfDKFIajknRYuWLIxrov0ZKIV4kxPKWghFvP/dQa9z+Q82kSfwb9BfelcPh+MHtVSEyf5H8kbmMr4tjWmgqhB9eGIwMVG/uWW3yh1wzwsfxgDEkvtITEg1+49lHafIR0LjWCJl/1dUvlmJd2cLL6AM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4NPtk+SoqK5S1zVZ4vvw3OCqjbhaPf4/36tZG67L0mRHPfvT+vldPyK0TKoKkc34lAFWCzTeBNuhQoCXi/I+T3WSvoEeEzliKb5P2kPI+ROrvBy9CW2eYBXHXZ61U3qyyRN4QAl4kKMJW5Q1XFfqQIXXDc63D6jeSA== 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)(52116014)(7416014)(1800799024)(366016)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: +f2R7khxdWG1rWpZL7Hd4Av0pABSJ425BbMUEreODumipuWLoWluxaR8DHXJJmDuPSq2YP2e/dZrt2Ak8kTMqDSHCudcF8ZZh761D3RmUJ1CDGsofP342vnAAWtnouPCM33774dDd33dICuXPP2inRmsOgvp/YsjXUz7PrZ4bMpWPc/yRUxMXb0RSBNAbu8O3b3E8ucUgydCBKde1f/l8lqOWg6t5BqbOZY+ifI+DOMD747GE85B5l36p+wjYomDwRd+ZvKFJdbMYYs50cW+Hj6Uk2GVH5Buf4mNbpzC7fzEz4//kYMokBhaqfVZ2pJroxceo9O49sPda9tzWXvXnZsnmosv3CvR2bvXcGYvRpPzgW9enW9vNQBMsVxyYRiyhNa+IuYjvHaJt/2/p3kDih/kAEG9Iubic8hTL+a+tNkSA/0pJj1lk3IlJMLmILj7XvAZbx0wri4Pq+u5LoR1uVSYBMbgTwYiv+flkgKeE162GTjzluz25mvQBqH7/e+jzMKUZNg99M/mxdEUY4axFnOsoeM4QKonCx+Nov+4l20pcfB+MUiYBPPYI8r/fo2OqGC6pSAKW9DsYGMnxVse+fKg3kzbzsheRgEs/AEjy7HuBisWS+y9HquZZKMbsudD2p+wga4WQ7TulGUw8LyIXLDQb7wECmQ5wLsfRuhPaVk5A9necGn9aYunjUDuU3Qtba8vHhYMeo+izEaKl6jHYz7/96pzBG+ZHCBlLtIoeFlQ+iry9s5W4gd1ZjP9jsvQcV4ZmYLl5YvUu2iV1gZQpnJiIYWEk6RdlIJCCMyk47a6Nm3s06rii9GLAoEYfCvLDMWSMN3jYmVmbM74/xlku9L6pgTnQNw/j3tn0pGkDDTm8k8z2WlAAg8P56MpYNn0sput13vfOjCoJxEQgkY4CbFGNzhSxGj+dJrh/RNPBytKYJvdmOrD6o78MEIy5VkxPwxsAzKFY2tjjrgs/8lXV6Qvc5fP3ETIpXdUHkibcBPMhmNaPOEpCgmM/da2KZ8ZldaBl2kK0dKcMDvMn73/wrbReeQquZUDQuYS1+bqZXjDU3q1CRsSKRcVilk8rDy9tCoglZP+GW4oIbyXgoXWA1VFhf8YEtRHISbiyWGPzxLjcwwLVFlwokTcvC+XP4B2SD/J+LQfKdD6r0eSs10ms2hFIgqHhzT9RuRimMLSAHvrjVWyilBBRdCPKAGLEKgQ//9HnRio0j0Ra3/NsdLutcHKc4b5K1daTDFPyX0ua6yTeHOo29jiLqZ7TTF6cgohF+GNTk0QFmsbEqVNgDSiKFIMIOywK3eCE6SlujY37Mf9i6IasIDQ/h45jT/vIzRuoDrJczfnMK+sr5VWEgu1DFj4BTjuXbD3Tprc6qyx3FayyiI2c5tVlluholUBHh/4vKOKDhscZJV8jzqZQERMkJd4T0vWrWiGTCyrTc3N/3/XUpzf6om8DFwdANFsgaTN+XFS1BTNbeyxvNm+qaxt4edLYzqzwH5H6jt/7Wv5SFmMifzgzrzmo3KEjmxvWwk3MyY0liBpjmZk5wiuSYRSP1//u2EnvLXKw5p8omYS79QzpZEkrCbEv0LjCgbbYNpFsQ68k1HNpvEZHqmlE03zyw== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 67461694-2c33-4320-7e2b-08dca38eb0e9 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:03.0336 (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: Vvc1K6CVVsXUHegNH+3CjSGGCREMHBcETRtNWoDHHwngbTnEHZ5JqGVE5gV8bnTMamHfBDPuLppeaRsFYASQQQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: GVXPR04MB10873 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240713_155410_391257_CE611AE4 X-CRM114-Status: GOOD ( 11.44 ) 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 From: Breno Leitao As most of the drivers that depend on ARCH_LAYERSCAPE, make FSL_DPAA depend on COMPILE_TEST for compilation and testing. # grep -r depends.\*ARCH_LAYERSCAPE.\*COMPILE_TEST | wc -l 29 Signed-off-by: Breno Leitao Signed-off-by: Vladimir Oltean Acked-by: Madalin Bucur --- v1->v2: none drivers/soc/fsl/qbman/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/soc/fsl/qbman/Kconfig b/drivers/soc/fsl/qbman/Kconfig index bdecb86bb656..27774ec6ff90 100644 --- a/drivers/soc/fsl/qbman/Kconfig +++ b/drivers/soc/fsl/qbman/Kconfig @@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0-only menuconfig FSL_DPAA bool "QorIQ DPAA1 framework support" - depends on ((FSL_SOC_BOOKE || ARCH_LAYERSCAPE) && ARCH_DMA_ADDR_T_64BIT) + depends on ((FSL_SOC_BOOKE || ARCH_LAYERSCAPE || COMPILE_TEST) && ARCH_DMA_ADDR_T_64BIT) select GENERIC_ALLOCATOR help The Freescale Data Path Acceleration Architecture (DPAA) is a set of