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 5251A43D51 for ; Tue, 26 Mar 2024 13:56:54 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E921341109; Tue, 26 Mar 2024 13:56:53 +0100 (CET) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2081.outbound.protection.outlook.com [40.107.92.81]) by mails.dpdk.org (Postfix) with ESMTP id B688F410E4; Tue, 26 Mar 2024 13:56:51 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LfelOaxlqT8f732gOBQ7nyJzvwsQPxRZyuQVqW84/fLqwn/kcM8mLN6CDKu4tt6D050KSQaJSfiBH3aUY8Ng/uW4E0f2gE9PEwk4zop+Iz8IRlYlg9PTjJqiAnRiQvapw4+XEoi0dCWNFGh4uzxMDOsVqBzmeygkks+ZVELq5TM25U8+TnlwqmKyoex0ZZz7R3RTNDA40uk2odwpkYJjQ8jRG5R+JktH97jjrTKqMeqUHQppqNfMkaCBc2FYFHiVrSIvbRlbfS2sZAxZys8d3gbbZsukWzEcfGQ3xBEGJ1a/GbtgACLOiUDjsIOIsoT+ofcMcTWhxRLzikYHhtO1QQ== 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=eWxD+OuPECvZ8Ex4gp4iRjJ+M5uJeOBkqsVtoYyd7Ec=; b=JtO133XrEWh9/LmvtnyAYOapr8mfKbjit29i379sOxp5IalXb1h/EDV8kJP7XDo/o2AzfuLqRkm/VtGkIqmAss+c7e1SP+Nt0FrTxtG5874u/1rOH6gIg0kBm6a9daJusGc1u1pDq2GmnLMkA1vy+fupCTGG3YFmEGoH8zmQvKwAIg6Y0tSwzgrvc4xNTdZ1X6p7OXLzaj3M95uKc5oVn7uV0HJWYbdFPN87LrFOqGanIXjknoAuQLp9ahJjfuBskvPduvkjT01FxSQ0S3920WrtRotasq2JMuTWFCFI6STuDx0h/zL2MfRvpJWY2N8a37xqmVJpEwpDNQcDNuI1BQ== 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=eWxD+OuPECvZ8Ex4gp4iRjJ+M5uJeOBkqsVtoYyd7Ec=; b=4xM1F1Uss2FoJ1eClZ0lu+WyqAzmlJ2J4JP0qVWNf3AIlKUraOTIW2s21ZjMHP0un2Q+eLf8RsG0qtj0zBwG9TNjSaYlYhBIo79Fh3JcaiulH6MFYUdeIGoXuv4tI1eJ/M5mcbbLsyIWEE1JUE+fqNkGqME6F1BPJ+WUG5eVjzk= Received: from BN8PR15CA0062.namprd15.prod.outlook.com (2603:10b6:408:80::39) by MW4PR12MB7465.namprd12.prod.outlook.com (2603:10b6:303:212::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.32; Tue, 26 Mar 2024 12:56:49 +0000 Received: from BN1PEPF00004687.namprd05.prod.outlook.com (2603:10b6:408:80:cafe::63) by BN8PR15CA0062.outlook.office365.com (2603:10b6:408:80::39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.13 via Frontend Transport; Tue, 26 Mar 2024 12:56:49 +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 BN1PEPF00004687.mail.protection.outlook.com (10.167.243.132) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7409.10 via Frontend Transport; Tue, 26 Mar 2024 12:56:49 +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; Tue, 26 Mar 2024 07:56:44 -0500 From: Sivaprasad Tummala To: , , , , , , , , , , CC: , Subject: [PATCH v7 06/14] examples/l3fwd-power: fix lcore ID restriction Date: Tue, 26 Mar 2024 13:55:45 +0100 Message-ID: <20240326125554.138840-7-sivaprasad.tummala@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240326125554.138840-1-sivaprasad.tummala@amd.com> References: <20240321184721.69040-1-sivaprasad.tummala@amd.com> <20240326125554.138840-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: 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: BN1PEPF00004687:EE_|MW4PR12MB7465:EE_ X-MS-Office365-Filtering-Correlation-Id: 26a2ed49-7024-4d55-ce56-08dc4d943366 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 8vHt8uIhyEb//X7yop69FcM/YYSy8DxFm/cKmMvJQ0V3CNKO3Dkcz18P954uwQbS7nUfZyjy91nP2Oc8vfVNky3mSexIpnRPU9d+4nxbY2r3rgzT6Kmkr/kvKV+ss1U2nMKOgQE9ddPfs56TP7sBGn72QzhLhFi/jiX38xBPuXq97W1NcdNSdNCbRG/wVkKxqZABea0dNYctxbpX1h7RQG2rVGBrpXmFxivNMPrRFIWhJq50LJy21k5Bou4G4SzrhR4jEYhKP65qf7IjolMT9lV+MamWrIvOuWrp4FdUpv9aEj37MYtbpdjx4Z6lVHUe6FA75jPPlhnlw0DKAug+6w7Ho44faRL4+zCP4z7+X8lDGe3VBsArc//AnDMaj4c5+yIhluwZDQ+81KTDj7rw8mGV5LMUI91C9StItsNutZBOxJHhOEX5sMBc6g4kQS87KoTos/F8lIMyshSXoCN5gRHvdPqgDcoo7f+dw98DpFJLs4SS7i4uQ0VOBWte774ZolttUWBrRZFqVTioujvKu/GFZ+bZ6j2m/FmwuyqFxyfj76VlMLFpkVrQkEoQFs1K27am9S6t2OkR1eBd3oX+224iMr37I3Iw0V1H2TtTQj1zWONIDQaOSqDSMZXnF/CQjzDHk7u7sw2Znc7YXIdUQqFxrTkcZQR/Nkp/1iZCZ7npkCuuslbYAabXK3UDzdHampCDxQsLw1ZLRd+TT4q9rn2YPRFrX1k23fhr7l3xQ+UkK4ZSO6Ebj4q+NZhjDhoYUpnG2whNsoGDinXyBG74rw== 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)(7416005)(36860700004)(82310400014)(376005)(921011); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Mar 2024 12:56:49.2173 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 26a2ed49-7024-4d55-ce56-08dc4d943366 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: BN1PEPF00004687.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB7465 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-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: f88e7c175a68 ("examples/l3fwd-power: add high/regular perf cores options") Cc: radu.nicolau@intel.com Cc: stable@dpdk.org Signed-off-by: Sivaprasad Tummala Acked-by: Morten Brørup Acked-by: Ferruh Yigit --- examples/l3fwd-power/main.c | 18 +++++++++++------- examples/l3fwd-power/main.h | 2 +- examples/l3fwd-power/perf_core.c | 11 ++++++++--- 3 files changed, 20 insertions(+), 11 deletions(-) diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c index 50aea99428..eac92ef875 100644 --- a/examples/l3fwd-power/main.c +++ b/examples/l3fwd-power/main.c @@ -1397,7 +1397,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) { @@ -1408,13 +1408,13 @@ 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 " + 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 " + printf("warning: lcore %u is on socket %d with numa " "off\n", lcore, socketid); } if (app_mode == APP_MODE_TELEMETRY && lcore == rte_lcore_id()) { @@ -1466,14 +1466,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)nb_rx_queue + 1, (unsigned)lcore); + (unsigned int)nb_rx_queue + 1, lcore); return -1; } else { lcore_conf[lcore].rx_queue_list[nb_rx_queue].port_id = @@ -1658,7 +1658,11 @@ parse_config(const char *q_arg) char *str_fld[_NUM_FLD]; int i; unsigned size; - unsigned int max_fld[_NUM_FLD] = {255, RTE_MAX_QUEUES_PER_PORT, 255}; + unsigned int max_fld[_NUM_FLD] = { + 255, + RTE_MAX_QUEUES_PER_PORT, + RTE_MAX_LCORE + }; nb_lcore_params = 0; @@ -1691,7 +1695,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; diff --git a/examples/l3fwd-power/main.h b/examples/l3fwd-power/main.h index 40b5194726..194bd82102 100644 --- a/examples/l3fwd-power/main.h +++ b/examples/l3fwd-power/main.h @@ -10,7 +10,7 @@ struct lcore_params { uint16_t port_id; uint16_t queue_id; - uint8_t lcore_id; + uint32_t lcore_id; } __rte_cache_aligned; extern struct lcore_params *lcore_params; diff --git a/examples/l3fwd-power/perf_core.c b/examples/l3fwd-power/perf_core.c index f34442b9d0..fbd7864cb9 100644 --- a/examples/l3fwd-power/perf_core.c +++ b/examples/l3fwd-power/perf_core.c @@ -24,7 +24,7 @@ struct perf_lcore_params { uint16_t port_id; uint16_t queue_id; uint8_t high_perf; - uint8_t lcore_idx; + uint32_t lcore_idx; } __rte_cache_aligned; static struct perf_lcore_params prf_lc_prms[MAX_LCORE_PARAMS]; @@ -132,7 +132,12 @@ parse_perf_config(const char *q_arg) char *str_fld[_NUM_FLD]; int i; unsigned int size; - unsigned int max_fld[_NUM_FLD] = {255, RTE_MAX_QUEUES_PER_PORT, 255, 255}; + unsigned int max_fld[_NUM_FLD] = { + 255, + RTE_MAX_QUEUES_PER_PORT, + 255, + RTE_MAX_LCORE + }; nb_prf_lc_prms = 0; @@ -169,7 +174,7 @@ parse_perf_config(const char *q_arg) prf_lc_prms[nb_prf_lc_prms].high_perf = !!(uint8_t)int_fld[FLD_LCORE_HP]; prf_lc_prms[nb_prf_lc_prms].lcore_idx = - (uint8_t)int_fld[FLD_LCORE_IDX]; + (uint32_t)int_fld[FLD_LCORE_IDX]; ++nb_prf_lc_prms; } -- 2.25.1