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 3F88F43CE8 for ; Mon, 18 Mar 2024 18:32:26 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EE70940A70; Mon, 18 Mar 2024 18:32:22 +0100 (CET) Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam02on2088.outbound.protection.outlook.com [40.107.95.88]) by mails.dpdk.org (Postfix) with ESMTP id 3547340693; Mon, 18 Mar 2024 18:32:21 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Sn92pYYCZ+Mrex9ZAs160Q5YMKkS93PPCgo0KJ0IUevDd6et8bk/B6QPQhOiYXCJbRg/m6eDR2NKyvfF+x6HkaoZH0pGcMeo0ioLaf+NZPcFnBY6uDU09bFVZLxangg9XqPowkOnD7ISNYo9odNC5yiFUbQUm0CHEIZNxe7EHAXVWFr/41tdOq81GMleleDmP4netT/g6JOnEt168zpYtZbUlqFdq7ldShsq6KZ25KgNwD0g/EUvkab2M+E2Yoq4mN4YZU/wIexVzvxWJzpTsFLOXJEsZVMDoqPiMHuDHUUBPob5MPdtaq7s/rpuNqiRJ+EfpF10VcxmDddn0AckBg== 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=ttgGWmfXzEL3Cc2MDL9R0dPsElFGd6uFJCaq88zgaPQ=; b=GDXclvuDzZqtJAGNzR0/i7DGtmmN3k7k6qN7QkvZAqk023rLT0D4QG5aiqRfaotYC5hZtaTtnaqvWkwdDeBgG/eUj9OE/JxDRWlROqHpGW+F3htQ4Bwe0FGJxIUo2VvjqSWoTXm2qfn8z2Bv+fIerum37sMGf5CBje/L++wnTc0dQVUB/kZyhuVAU83gdvtbhQN3JdVfTf2zff2qd3kgCk3MjWz1LBBb6zczIoedVA91PRBnIAIevFv3Pq3AMbtN3L2eqfnfGh6Gr1E9p0tt/xRxIhwIVFYgItdn92dAsd7tSs4RJSB7AQsv9NaJq5G0VEFsoLCZNtYg4sOUD9WTcA== 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=ttgGWmfXzEL3Cc2MDL9R0dPsElFGd6uFJCaq88zgaPQ=; b=gPFbTVzJt8VqWK5a/RgkIzTpIcYl1SgteMl3g6o2QGVEqXqjJtMJjG+lWTozKFr7LAMYuST3wvhJg0VHoKGLpN8ufkxNuTyE33+MdVJi1Gxse8S/Twc82qQku9o3EdHvfW31x6jO75qwLX8poexFbfA4P1DDScyPgdZRCmHbm58= Received: from DM6PR08CA0005.namprd08.prod.outlook.com (2603:10b6:5:80::18) by SA1PR12MB8743.namprd12.prod.outlook.com (2603:10b6:806:37c::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7386.26; Mon, 18 Mar 2024 17:32:19 +0000 Received: from CH1PEPF0000AD7A.namprd04.prod.outlook.com (2603:10b6:5:80:cafe::3a) by DM6PR08CA0005.outlook.office365.com (2603:10b6:5:80::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7386.27 via Frontend Transport; Mon, 18 Mar 2024 17:32: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 CH1PEPF0000AD7A.mail.protection.outlook.com (10.167.244.59) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7409.10 via Frontend Transport; Mon, 18 Mar 2024 17:32:19 +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; Mon, 18 Mar 2024 12:32:14 -0500 From: Sivaprasad Tummala To: , , , , , , , , , CC: , , Subject: [PATCH v5 3/6] examples/l3fwd-graph: fix lcore ID restriction Date: Mon, 18 Mar 2024 18:31:42 +0100 Message-ID: <20240318173146.24303-4-sivaprasad.tummala@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240318173146.24303-1-sivaprasad.tummala@amd.com> References: <20240116182332.95537-1-sivaprasad.tummala@amd.com> <20240318173146.24303-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: 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: CH1PEPF0000AD7A:EE_|SA1PR12MB8743:EE_ X-MS-Office365-Filtering-Correlation-Id: 47871088-e52d-4da0-a5b2-08dc47715ca5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: AnBJeLoUDqFUzGDhKco9+XeZyX/K4ioZJIDucbkm2XPaAPyTZMtqilBnYZ3zkbc+4QndN6M3zK6Y+iZ9D6iJolD7TtUgc9czsFIqrsCbHd650+fbn+jwHQD5mTIpB5HWrjzbEW2rvpufpk7O8BMODJpu4OSBXU8z8L9XeJJEcojKhPMeTYmP4CQLl2me4D6WSj94rSiEzDw9Wmsu8gEEcOZQ4zHASCGDioec/FyMh7LQVqHUFYRmAjQzxqz/QJdWrPpj7csjac/ZbADS1z9AujM142IUEPI7KORhPsSkgoNktDGnshRhh58oNY/lzwo4s2pxx3llwqUF+CT6oPNJRg6/IHMekGzbRC2Rv9As+Ag3JGwkqjc0cDc9Gea6NVxgTcEdSKfRnyvnKeGiBoaY+PACbjXazBU+iLkmdVvZcAIDyKn8ug1WUR24Yy0fFiBFcphWYvJtPI+PKOSpuN1KA0cRcjBidVrQlg2qCVavHplKoTkyCD7/AJqRYtx0bNFTbJgGuM2vQF9PKjdNEyahVw4yElr3j/gCVmU6CAKKly5boksGMktmB2JC0EvYj590o0h04IIu7VEYBV4+Sz7E3GKfC/LPhAe+VtMVfJOa5+J6g/veCmOXjmx2CplOqS7UTulumyc6H3D+SwKGf331STNSrHX7VTYE89j3/JG4wNoys3spNWYVuji5ApCDXsfmbFc0p5hrr5+7QZHdBTefNZulvnJ5QPmxh/wm+97Fa5Y4mBIB6qOTvcO/36km178iIaDkemftxfb08zu6jl5THw== 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)(376005)(1800799015)(7416005)(82310400014)(36860700004)(921011); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Mar 2024 17:32:19.0379 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 47871088-e52d-4da0-a5b2-08dc47715ca5 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: CH1PEPF0000AD7A.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB8743 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: 08bd1a174461 ("examples/l3fwd-graph: add graph-based l3fwd skeleton") Cc: ndabilpuram@marvell.com Cc: stable@dpdk.org Signed-off-by: Sivaprasad Tummala --- examples/l3fwd-graph/main.c | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/examples/l3fwd-graph/main.c b/examples/l3fwd-graph/main.c index 96cb1c81ff..557ac6d823 100644 --- a/examples/l3fwd-graph/main.c +++ b/examples/l3fwd-graph/main.c @@ -90,7 +90,7 @@ static int pcap_trace_enable; struct lcore_rx_queue { uint16_t port_id; - uint8_t queue_id; + uint16_t queue_id; char node_name[RTE_NODE_NAMESIZE]; }; @@ -110,8 +110,8 @@ static struct lcore_conf lcore_conf[RTE_MAX_LCORE]; struct lcore_params { uint16_t port_id; - uint8_t queue_id; - uint8_t lcore_id; + uint16_t queue_id; + uint32_t lcore_id; } __rte_cache_aligned; static struct lcore_params lcore_params_array[MAX_LCORE_PARAMS]; @@ -205,19 +205,19 @@ check_worker_model_params(void) static int check_lcore_params(void) { - uint8_t queue, lcore; + uint16_t queue, i; int socketid; - uint16_t i; + uint32_t lcore; for (i = 0; i < nb_lcore_params; ++i) { queue = lcore_params[i].queue_id; if (queue >= MAX_RX_QUEUE_PER_PORT) { - printf("Invalid queue number: %hhu\n", queue); + printf("Invalid queue number: %hu\n", queue); return -1; } lcore = lcore_params[i].lcore_id; if (!rte_lcore_is_enabled(lcore)) { - printf("Error: lcore %hhu is not enabled in lcore mask\n", + printf("Error: lcore %u is not enabled in lcore mask\n", lcore); return -1; } @@ -228,7 +228,7 @@ check_lcore_params(void) } socketid = rte_lcore_to_socket_id(lcore); if ((socketid != 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); } } @@ -257,7 +257,7 @@ check_port_config(void) return 0; } -static uint8_t +static uint16_t get_port_n_rx_queues(const uint16_t port) { int queue = -1; @@ -275,14 +275,14 @@ get_port_n_rx_queues(const uint16_t port) } } - return (uint8_t)(++queue); + return (uint16_t)(++queue); } 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; @@ -290,7 +290,7 @@ init_lcore_rx_queues(void) 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); + lcore); return -1; } @@ -448,11 +448,11 @@ parse_config(const char *q_arg) } lcore_params_array[nb_lcore_params].port_id = - (uint8_t)int_fld[FLD_PORT]; + (uint16_t)int_fld[FLD_PORT]; lcore_params_array[nb_lcore_params].queue_id = - (uint8_t)int_fld[FLD_QUEUE]; + (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; @@ -1011,7 +1011,8 @@ main(int argc, char **argv) "ethdev_tx-*", "pkt_drop", }; - uint8_t nb_rx_queue, queue, socketid; + uint8_t socketid; + uint16_t nb_rx_queue, queue; struct rte_graph_param graph_conf; struct rte_eth_dev_info dev_info; uint32_t nb_ports, nb_conf = 0; -- 2.25.1