From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 755A443E6F; Tue, 16 Apr 2024 11:56:25 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 40441402AE; Tue, 16 Apr 2024 11:56:25 +0200 (CEST) Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam04on2066.outbound.protection.outlook.com [40.107.102.66]) by mails.dpdk.org (Postfix) with ESMTP id 2526F4029E; Tue, 16 Apr 2024 11:56:24 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=H9A3IvMjwOzbb6/Xt2ZD61udEuwJX/G18k3CfuQd3MCIdiY4gB4TDp+HzmCh71PYoy3tGPznRtRelOU/vNN25YuN69Kh9SrrwmoCU4fEso2DLQDOV4249b/DgCMkzADjjYSehK8RQT92z8wcuT6HT+L8jAuPkk5nhIpE7yqHY17Y6b5497BW/vtvOEd+5PFPycgxezB0V+7gNYoI2TRN5Ulr+IEyjMkjBWczoF0eSimb/nqzhY8rQSVOUO+CmFl5vQarnLoRQKIc/UmC3M2M2YMX/ziwlTGih63PlTuKtrIZaDi6vM/aMpO/Gqxo1lEWNCrWt/zb698D7sDYVBJrgw== 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=cT6ACL8iZ1amWeMoBn8KWfjml2ktiDt5OXrGB2yzUUk=; b=iel7rukPAqVPeTQRfrBZfdIBrqrayl4VBINdh58ygkrGzEezQ8f+EgIW3qT53rCDbiVz1Y3xHZlEskfgMzZ8dhJxwEKgHirTdcGM5CYtuPQZm38/o2ltTzoIvqtTWdGrqRr2q/wR1RiUF8gmp5Ij/x+OY4tSbos1E1aU+z+HhAjTfRE2D9ICQomYXSI10hvTIN7g1wAjkAUyeNv5S61piteeNO1KdDgkiFmM9A0fpiE8U1Iqtdg9955x3DxvJcnJ1CHOSbjB26eL2aM+ZsWAjn3KEWLme78o0/Z/zSg5IJApLt2dAWOpMb77Y3QFFoLgs47cQLb3u6AqITOKpWThRw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=redhat.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=cT6ACL8iZ1amWeMoBn8KWfjml2ktiDt5OXrGB2yzUUk=; b=l6KeBns95sJKkFDd/uoDit+M7CNpVPxlum63cNpTbQGjxhNCjTuu5R9twifq4NyfJKV5kDlQrAyxLK1lASXDPQUKLUViOJShjQ8TVHfZlDUy5fVfHYTfkCfJ14gP+X2EbB6g3RlGIUJLK06qzk4kzTUNLlvWW2dOYi9jkNqGezE= Received: from DM6PR07CA0072.namprd07.prod.outlook.com (2603:10b6:5:74::49) by DS0PR12MB6584.namprd12.prod.outlook.com (2603:10b6:8:d0::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7452.50; Tue, 16 Apr 2024 09:56:22 +0000 Received: from CY4PEPF0000E9DB.namprd05.prod.outlook.com (2603:10b6:5:74:cafe::eb) by DM6PR07CA0072.outlook.office365.com (2603:10b6:5:74::49) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7472.34 via Frontend Transport; Tue, 16 Apr 2024 09:56:22 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by CY4PEPF0000E9DB.mail.protection.outlook.com (10.167.241.74) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7452.22 via Frontend Transport; Tue, 16 Apr 2024 09:56:21 +0000 Received: from jfw9ny3-os.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Tue, 16 Apr 2024 04:56:17 -0500 From: Sivaprasad Tummala To: , , , CC: , Subject: [PATCH v2] app/testpmd: fix lcore ID restriction Date: Tue, 16 Apr 2024 09:55:56 +0000 Message-ID: <20240416095556.173787-1-sivaprasad.tummala@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240415194631.124343-1-sivaprasad.tummala@amd.com> References: <20240415194631.124343-1-sivaprasad.tummala@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000E9DB:EE_|DS0PR12MB6584:EE_ X-MS-Office365-Filtering-Correlation-Id: e2f060f1-53fb-4304-18dc-08dc5dfb7879 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: DfWh0+F7aX+p/nkH4PMUPdTYwdbZy1xilkugBtYaFSGdgHPnW4GVK8c6gjRilZHC12lGGGJd2hYaZHhGKWDtSFAAFju3ao7a0t2cdTmgW/7/6pobdUHEXd45/q6GpXlA4CAYWRdUhdexkb5YQpmPa4UmXOaNbdRtOKbxF5BYHuf2QaCcgqDyKrm6FthP357JQBonToP4VbkfohsUwxC6e9fNH+xOu1BmktwepOBt+b6Bsd1Tf2jZ1VmDuYU4D1Vh4FdT3S/o6DxxSJisUGLFPq24PML/CfWIgaIzqrNUTA6txHf6o94KXVCSOf7RBI6/OhnvIfIiLvEPmCHNfLOkJ6hDX4yIrtQndgFqLHOYzCaGmEqZ9u951Gs/v+zS04LX7wldy1XZYiShol3HUq3976OjaEZqBbDcTUy0pLxSiBzY1y53T81P4XGTRqDsPfAm03k0j8oJ038LncK/bpwETkarK4qdkGdpG36LLllklRKma9kv+CXpDan1JphNyQjTcrcZ+QFvZ/pzuUT14O5rruzagSXJwuezgbL3wtC3UM3tR0s2fN+Ui6dr3gZ5M1eZX+uLPQje18dTCEzi2xifhtaoHQgEcwa702Rx/Olok8Q9Xa3b33wMe5kcwFRwmljGKNByXIXuyrwuTu/UYm70xaSvDQ/ZoP61xqeopqBg3yorNGyMJZChnzwFx4s/A/eHfEvoPI4oRhxp+Jg29KSq789YRkUBWLKorf6C8csDc5KW2eqTaQL4F5ptDFARuf8E X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230031)(1800799015)(82310400014)(376005)(36860700004); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Apr 2024 09:56:21.8050 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e2f060f1-53fb-4304-18dc-08dc5dfb7879 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CY4PEPF0000E9DB.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB6584 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org With modern CPUs, it is possible to have higher CPU count thus we can have higher RTE_MAX_LCORES. In testpmd application, the current config forwarding cores option "--nb-cores" is hard limited to 255. The patch fixes this constraint and also adjusts the lcore data structure to 32-bit to align with rte lcore APIs. Fixes: af75078fece3 ("first public release") Cc: stable@dpdk.org Signed-off-by: Sivaprasad Tummala --- v2: * Fixed type mistmatch in comparison * Fixed incorrect format specifier --- app/test-pmd/config.c | 6 +++--- app/test-pmd/parameters.c | 4 ++-- app/test-pmd/testpmd.h | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index ba1007ace6..6b28c22c96 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -4785,9 +4785,9 @@ fwd_stream_on_other_lcores(uint16_t domain_id, lcoreid_t src_lc, continue; printf("Shared Rx queue group %u queue %hu can't be scheduled on different cores:\n", share_group, share_rxq); - printf(" lcore %hhu Port %hu queue %hu\n", + printf(" lcore %u Port %hu queue %hu\n", src_lc, src_port, src_rxq); - printf(" lcore %hhu Port %hu queue %hu\n", + printf(" lcore %u Port %hu queue %hu\n", lc_id, fs->rx_port, fs->rx_queue); printf("Please use --nb-cores=%hu to limit number of forwarding cores\n", nb_rxq); @@ -5159,7 +5159,7 @@ icmp_echo_config_setup(void) lcoreid_t lc_id; uint16_t sm_id; - if ((nb_txq * nb_fwd_ports) < nb_fwd_lcores) + if ((lcoreid_t)(nb_txq * nb_fwd_ports) < nb_fwd_lcores) cur_fwd_config.nb_fwd_lcores = (lcoreid_t) (nb_txq * nb_fwd_ports); else diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c index c13f7564bf..22364e09ab 100644 --- a/app/test-pmd/parameters.c +++ b/app/test-pmd/parameters.c @@ -1071,8 +1071,8 @@ launch_args_parse(int argc, char** argv) break; case TESTPMD_OPT_NB_CORES_NUM: n = atoi(optarg); - if (n > 0 && n <= nb_lcores) - nb_fwd_lcores = (uint8_t) n; + if (n > 0 && (lcoreid_t)n <= nb_lcores) + nb_fwd_lcores = (lcoreid_t) n; else rte_exit(EXIT_FAILURE, "nb-cores should be > 0 and <= %d\n", diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h index 0afae7d771..9facd7f281 100644 --- a/app/test-pmd/testpmd.h +++ b/app/test-pmd/testpmd.h @@ -84,7 +84,7 @@ extern volatile uint8_t f_quit; /* Maximum number of pools supported per Rx queue */ #define MAX_MEMPOOL 8 -typedef uint8_t lcoreid_t; +typedef uint32_t lcoreid_t; typedef uint16_t portid_t; typedef uint16_t queueid_t; typedef uint16_t streamid_t; -- 2.34.1