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 5456643D0F; Thu, 21 Mar 2024 19:48:42 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8E47642E74; Thu, 21 Mar 2024 19:48:36 +0100 (CET) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2087.outbound.protection.outlook.com [40.107.223.87]) by mails.dpdk.org (Postfix) with ESMTP id DB57742E5B; Thu, 21 Mar 2024 19:48:34 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jIzN04Sv/wLqicSkZMEEvJob+TCcD4Ts13WnBhQF7w5kd6rVy4TjGNkhGxt8abFqqIQGWoBInz7WVhc6Fh0eVPFQk1lhBhHFar5FGndCW38U5wyqyVIY7t8O7w2wIujtZhmrFRlToMo+yNmqDZECv/o8BUBm2QdLMV4cYr293xgWn2I3UjvphoboAXaTcvLnE9aZRmxhTh1z+NQGMUcYQMPa193jv44ojngrW6CPIMgRALuVnmgtrOh8SKiyXHLmc1X/bezz4C+pqRC5aQhKHEUOM3Sj28CT80ERqvGPxvSz8gT2+LmkhZgrtsUWObVm/sl5jhDC+T+XEPtPlL0vXA== 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=2cIPxJ6WoP0UR009QDMIhlifdalowhoqiBAnVYhkh/Q=; b=Fmw/Xr4WNUg0ysIs/EhQg6qgRPas/VqLtYlhjL7+d3MU6x434YQtGeBvMfFJAJqVO1a9UhcbDbzpMolIRllCTD1LLq04fxLRkAR+SQlhp/vFto2Fkk0qpMUFQk9Sbyd3ajviOdjU9Tqc9aWz24eTdZUAg7RSP8990SMQNHbMzM0QFOkqDaBb9YHSC9coHWBU4dHJWWdmkQL84F4gkMZvHq+NRwdvcfOYPhKVIXMghy84qEqcyqvqncrq32C45h8+2ieFS1vRPgSnuqTapdIew274QUn6TnI64cNudQHqAxE3/EfdPxno4uYZh/EzLNLEp26XeUSlWFrVhmVoFEU9YQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=intel.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=2cIPxJ6WoP0UR009QDMIhlifdalowhoqiBAnVYhkh/Q=; b=VQCKUHmjUnmvq4v81OK2Ka0L7SudyF3MpEqBm4P7hgDfgORweU7eo/+1gTDjE8F00DkQOfx6erlCkLEG8CmJcV/IVS/QAll3PWqC0z4lHRtdtl/cajsswzFBv1EZS0WTOo+8Q74A9v1+NeJ7tMNLfJ2m6vlpK21o4VyKUygLDRk= Received: from BLAPR03CA0032.namprd03.prod.outlook.com (2603:10b6:208:32d::7) by LV2PR12MB5917.namprd12.prod.outlook.com (2603:10b6:408:175::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.15; Thu, 21 Mar 2024 18:48:32 +0000 Received: from BL6PEPF0001AB76.namprd02.prod.outlook.com (2603:10b6:208:32d:cafe::bf) by BLAPR03CA0032.outlook.office365.com (2603:10b6:208:32d::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7386.28 via Frontend Transport; Thu, 21 Mar 2024 18:48:32 +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 BL6PEPF0001AB76.mail.protection.outlook.com (10.167.242.169) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7409.10 via Frontend Transport; Thu, 21 Mar 2024 18:48:32 +0000 Received: from ubuntu2004.linuxvmimages.local (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; Thu, 21 Mar 2024 13:48:28 -0500 From: Sivaprasad Tummala To: , , , , , , , , , , CC: , Subject: [PATCH v6 05/14] examples/l3fwd: fix lcore ID restriction Date: Thu, 21 Mar 2024 19:47:11 +0100 Message-ID: <20240321184721.69040-6-sivaprasad.tummala@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240321184721.69040-1-sivaprasad.tummala@amd.com> References: <20240318173146.24303-1-sivaprasad.tummala@amd.com> <20240321184721.69040-1-sivaprasad.tummala@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL6PEPF0001AB76:EE_|LV2PR12MB5917:EE_ X-MS-Office365-Filtering-Correlation-Id: 952ecda8-ad2a-44c1-178f-08dc49d781ec X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: RcmlMQDrg/4P+3NF31n+dSZ2Ti1GWfCxfPsXRQrIZVqGF+jk0bHTutqzR87mQ28vYxp97b54h4inHk1WgZhTzqkRRqP5m7n7lQnv2bg+7tA1Lzb9dd+Rq72u2+WiZf92t6hyIhHtVzy9hGlAJHfbe0TXkAo9gq2M5tQqAY+az5SN6SLPGdA9m8FfwTjrmXh5SP5vF3CcPnRg0HbxF0ZVprfx0QdG0FPKhYTmem8LkjNykOMywOgUqJJalE0aHBwpyFTBNMBU7Dc+iqgD1D2JNFMZw+3p80yZnUaECjOS2xQiRw7fMIfYufqoCCZdPib3P1bhjt3gma8tENylXmbadiXCo0do9UpZGITbiSXnm/neywUFXbyWz7aKduhCYo1o+iPhQeqkPb+cNkRoKFHAysHQBqvxIlsHda71mxe9xjuV1lRaQN0be9ZXH0QH4t4l/S3exJWRMZdYk4NNmw4XyU50TtTf/mT7KXPPOatJY8Nm9xkDepGmvdTAUZQ4fhbKp5y+Ua/gFaAJfWuCojnB8b4CduXIBUdMsLVer+3XlARkt0J2esVpTvmrlfyCr1XtgBw3nfRiAll5dGzYi6D4P3Z6yABY4V96uvXY1rrzV1nVViOcq6LmUV/BXwRhCKz2yhhmYEVIgREr7hXVh813g2DpOn6uUMU4rFwrCFPCaMpXZGomlnWovlL/vz34V8hV7FpSp/4RUUYb+jsTnR5rnQEK/3AQ8DkcRH6rhKCjXhA7PoAqzUHh4h+95hRGc9oorcnOqLbjBvMr/smJJMQU0Q== 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)(7416005)(36860700004)(921011); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Mar 2024 18:48:32.5203 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 952ecda8-ad2a-44c1-178f-08dc49d781ec 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: BL6PEPF0001AB76.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV2PR12MB5917 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 Currently the config option allows lcore IDs up to 255, irrespective of RTE_MAX_LCORES and needs to be fixed. The patch fixes these constraints by allowing all lcore IDs up to RTE_MAX_LCORES. Fixes: af75078fece3 ("first public release") Cc: stable@dpdk.org Signed-off-by: Sivaprasad Tummala Acked-by: Konstantin Ananyev Acked-by: Morten Brørup Acked-by: Ferruh Yigit --- examples/l3fwd/main.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c index 4d4738b92b..9fb4fe97d4 100644 --- a/examples/l3fwd/main.c +++ b/examples/l3fwd/main.c @@ -99,7 +99,7 @@ struct parm_cfg parm_config; struct lcore_params { uint16_t port_id; uint16_t queue_id; - uint8_t lcore_id; + uint32_t lcore_id; } __rte_cache_aligned; static struct lcore_params lcore_params_array[MAX_LCORE_PARAMS]; @@ -293,7 +293,7 @@ static int check_lcore_params(void) { uint16_t queue, i; - uint8_t lcore; + uint32_t lcore; int socketid; for (i = 0; i < nb_lcore_params; ++i) { @@ -304,12 +304,12 @@ check_lcore_params(void) } lcore = lcore_params[i].lcore_id; if (!rte_lcore_is_enabled(lcore)) { - printf("error: lcore %hhu is not enabled in lcore mask\n", lcore); + printf("error: lcore %u is not enabled in lcore mask\n", lcore); return -1; } if ((socketid = rte_lcore_to_socket_id(lcore) != 0) && (numa_on == 0)) { - printf("warning: lcore %hhu is on socket %d with numa off \n", + printf("warning: lcore %u is on socket %d with numa off\n", lcore, socketid); } } @@ -359,14 +359,14 @@ static int init_lcore_rx_queues(void) { uint16_t i, nb_rx_queue; - uint8_t lcore; + uint32_t lcore; for (i = 0; i < nb_lcore_params; ++i) { lcore = lcore_params[i].lcore_id; nb_rx_queue = lcore_conf[lcore].n_rx_queue; if (nb_rx_queue >= MAX_RX_QUEUE_PER_LCORE) { printf("error: too many queues (%u) for lcore: %u\n", - (unsigned int)nb_rx_queue + 1, (unsigned int)lcore); + (unsigned int)nb_rx_queue + 1, lcore); return -1; } else { lcore_conf[lcore].rx_queue_list[nb_rx_queue].port_id = @@ -500,8 +500,8 @@ parse_config(const char *q_arg) char *str_fld[_NUM_FLD]; int i; unsigned size; - uint16_t max_fld[_NUM_FLD] = {USHRT_MAX, - USHRT_MAX, UCHAR_MAX}; + uint32_t max_fld[_NUM_FLD] = {USHRT_MAX, + USHRT_MAX, RTE_MAX_LCORE}; nb_lcore_params = 0; @@ -534,7 +534,7 @@ parse_config(const char *q_arg) lcore_params_array[nb_lcore_params].queue_id = (uint16_t)int_fld[FLD_QUEUE]; lcore_params_array[nb_lcore_params].lcore_id = - (uint8_t)int_fld[FLD_LCORE]; + (uint32_t)int_fld[FLD_LCORE]; ++nb_lcore_params; } lcore_params = lcore_params_array; -- 2.34.1