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 AE9F84372E for ; Mon, 18 Dec 2023 08:49:25 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A5C4A40DFB; Mon, 18 Dec 2023 08:49:25 +0100 (CET) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2081.outbound.protection.outlook.com [40.107.244.81]) by mails.dpdk.org (Postfix) with ESMTP id AEA954026A; Mon, 18 Dec 2023 08:49:22 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PVpuJeajfPKt/3EOeBMPeX/A0WL3Mjci3Yw8a6q5aofsOdoEjxXjxF0y18JUSdXDBKs0XhwntG1oUMn8xhoblbIE3Fwy4Hh68eTyj3L8iR5EONFHEic9PL1I2+JJ9X5TYVZkaz7h7egxhjdhUcOcE50rILpmXxg+wLaIWa/x0N48YECDGFfCPYNXZgsiO8BJ5n+JJ5CIA/ZE1tdktUpjd6kqTVXx+lD7CgpjuiqDAg4BxnsR65pM1j0gFHC5AVamkEyFocwhTyJve0FFxubTVWmVLetwiBpzC4I8bdWD6NsEAnQHz+MYiTCsE14+5Nw377/uon0RlysGj5xee3RA3Q== 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=MM/KSMQrM10AAC4oFE2CJUjiDFsvQhkpubTGvhn6Gpo=; b=V3+U65SV912SPwSLNT7e/sGoMCqLE9BQWPz2wlbqHrBCO9ARhxBcNmXgUximXINugRbYkHY96LvAMSpS5mCr2d3I1NXeszpb1YO3/8SZvVkL2zMa1VOhwbCK4U61GsRXGLVEyEAHXi6R8cqZe+PQUwnRh8/SGypPXvcL/peytNyY8Maa0bW4dADEnd39lPU05BkTzuwJjKq+U0PLlN8nug9jK2sPxlshWxGGEGeOssZX/g8zQTb8LaIHPe+Y+073/ti8swowEk9z6cYP0+2OpjMLj6IR3VwEGa0pY2hwNiNOGTTppnkX7WKRwovJgtLQYIFRRplBG6tj+evPJQhDgA== 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=MM/KSMQrM10AAC4oFE2CJUjiDFsvQhkpubTGvhn6Gpo=; b=Gl3BeTs4Z5tRESZYDXHqgWBI4AhsyfU51pvLnlDyV/12/lfovMI28OMEwyA6qgXSD+YX7utF3KZtFqENC84kbP/6M1SnQF6HgqRUyWrE04oBDF2WHDwrs4u5JBh9SbJmcwToCqybZsbt3PYo5UuzUQ/qDJ+wB3qt0toWC1fzuTw= Received: from MW2PR16CA0023.namprd16.prod.outlook.com (2603:10b6:907::36) by MN2PR12MB4552.namprd12.prod.outlook.com (2603:10b6:208:24f::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7091.38; Mon, 18 Dec 2023 07:49:19 +0000 Received: from MWH0EPF000989EB.namprd02.prod.outlook.com (2603:10b6:907:0:cafe::3f) by MW2PR16CA0023.outlook.office365.com (2603:10b6:907::36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7091.37 via Frontend Transport; Mon, 18 Dec 2023 07:49:19 +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 MWH0EPF000989EB.mail.protection.outlook.com (10.167.241.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7113.14 via Frontend Transport; Mon, 18 Dec 2023 07:49:19 +0000 Received: from 7dbylenovo.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.34; Mon, 18 Dec 2023 01:49:17 -0600 From: Sivaprasad Tummala To: , , , , , , , CC: , Subject: [PATCH 1/6] examples/l3fwd: fix lcore ID restriction Date: Mon, 18 Dec 2023 07:49:00 +0000 Message-ID: <20231218074905.42749-1-sivaprasad.tummala@amd.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain 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: MWH0EPF000989EB:EE_|MN2PR12MB4552:EE_ X-MS-Office365-Filtering-Correlation-Id: 90c661b1-8210-4deb-1139-08dbff9dd79a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: JIdKBOkmv02W0l4pDXHp1URplzsfF8z8pNztwu/FRxoDDAgwrVg9J62SMUXuejpwjImZ6ZUeYO/wtiihnh9LhS8fuXKjzl1jru1y3SoCyQoSiqPQbbz4+350L9hkEycoUSomGhjSZeHm+w5Yov7tCH5tjxKH4h2LSFkc9YEvr1tj0pbKaRezbC+mf0l6cQaPEOU3PjY9nVefBOnKtiRa88dv+XQuXWD+R0eB1YDejEdH8l9XPUNsSK3HtQlpMWnlwcen+x8noYNY/SpUL+UM2iKLskTi0pTUDzFsjU6WKMH2xgUXUn2vhMhosiR3QU6En9Ed1aOv3urHe6nOaR/lLrujQ2jS6Waj9WjW8xNqHqvZ/ERoW+l48+GDCeKo2SGr4gcpkpBFRbdD06XBdcA7JpifFu76ueWZza6JrwFGYlUrV8cL0BAnCYMVRkdXslDcybQQMp3ksaz7Q8jE8YkR+JHQP2KAhxi28H7J/IUj9Ek1UkBYtbIvFhbchHhgwLw9joLzoUSDRXITN8O84T2zn+93erXvNDwD0lYwDUo0eb3aFb26zPRUJ3x3x/YMlivBPjHbOK5dK+4/wsTQhAGipVGpjmxJuMb3LmUVqcJg9S1EdEOcz9j1L8Jz208m+2Et1NoEOGEhCcv2ptZfDwCi6H9JY7+V8URy5iXxvXivNZOV1PHfkFCbEaCQFi78MumDAd4wrNwaZctz7M2cWNqWFHAhVTLWEeJ6db7qnBGMAHBKLlal/AZgaSHz+QOuuCxLKvwHwZQwZJdmr+sVWz9mUQ== 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)(4636009)(376002)(136003)(39860400002)(346002)(396003)(230922051799003)(82310400011)(64100799003)(186009)(451199024)(1800799012)(40470700004)(46966006)(36840700001)(40480700001)(40460700003)(110136005)(70586007)(356005)(81166007)(86362001)(82740400003)(36756003)(316002)(36860700001)(47076005)(83380400001)(336012)(426003)(16526019)(26005)(2616005)(1076003)(478600001)(2906002)(54906003)(70206006)(7696005)(6666004)(5660300002)(8936002)(8676002)(4326008)(41300700001)(44832011)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Dec 2023 07:49:19.3485 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 90c661b1-8210-4deb-1139-08dbff9dd79a 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: MWH0EPF000989EB.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4552 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 allows config options based on DPDK config. Fixes: af75078fece3 ("first public release") Cc: stable@dpdk.org Signed-off-by: Sivaprasad Tummala --- examples/l3fwd/main.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c index 3bf28aec0c..847ded0ad2 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; uint8_t queue_id; - uint8_t lcore_id; + uint16_t lcore_id; } __rte_cache_aligned; static struct lcore_params lcore_params_array[MAX_LCORE_PARAMS]; @@ -292,8 +292,8 @@ setup_l3fwd_lookup_tables(void) static int check_lcore_params(void) { - uint8_t queue, lcore; - uint16_t i; + uint8_t queue; + uint16_t i, lcore; int socketid; for (i = 0; i < nb_lcore_params; ++i) { @@ -359,7 +359,7 @@ static int init_lcore_rx_queues(void) { uint16_t i, nb_rx_queue; - uint8_t lcore; + uint16_t lcore; for (i = 0; i < nb_lcore_params; ++i) { lcore = lcore_params[i].lcore_id; @@ -500,6 +500,8 @@ parse_config(const char *q_arg) char *str_fld[_NUM_FLD]; int i; unsigned size; + unsigned int max_fld[_NUM_FLD] = {RTE_MAX_ETHPORTS, + 255, RTE_MAX_LCORE}; nb_lcore_params = 0; @@ -518,7 +520,8 @@ parse_config(const char *q_arg) for (i = 0; i < _NUM_FLD; i++){ errno = 0; int_fld[i] = strtoul(str_fld[i], &end, 0); - if (errno != 0 || end == str_fld[i] || int_fld[i] > 255) + if (errno != 0 || end == str_fld[i] || int_fld[i] > + max_fld[i]) return -1; } if (nb_lcore_params >= MAX_LCORE_PARAMS) { @@ -531,7 +534,7 @@ parse_config(const char *q_arg) lcore_params_array[nb_lcore_params].queue_id = (uint8_t)int_fld[FLD_QUEUE]; lcore_params_array[nb_lcore_params].lcore_id = - (uint8_t)int_fld[FLD_LCORE]; + (uint16_t)int_fld[FLD_LCORE]; ++nb_lcore_params; } lcore_params = lcore_params_array; -- 2.25.1