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 43ABA4372F; Wed, 20 Dec 2023 07:45:51 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B91E342E7F; Wed, 20 Dec 2023 07:45:43 +0100 (CET) Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam02on2083.outbound.protection.outlook.com [40.107.95.83]) by mails.dpdk.org (Postfix) with ESMTP id 3B47242E6D; Wed, 20 Dec 2023 07:45:41 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=F9eEQnnWxxjy5WPUCKSUODzU8R+kN8NNnjzhfq/Iil4dwX0mJykbAvjJoxC46R8NZfs9elKWlbAawJrFnGbd4TwUjiDe/+VYp3iCQ3UdQBGOOBDQVzc5cXbZJYhWSRkFhsWBllvwmTLixeACfG+s6gmd3Wmy29FU6jAkHT/pDdArpF1K++XS/u4WepZxRVxwqNXJNrCQC/mOtrNfK+QlVELTxKvylD8TM8My6Z12G8/M8rayKpW1nnKme7ioefqwi7KPR4gcvx24FBUGAmpIJnTVJ/OpxBwFMLa5TjekG1iSEOxGPT7t8MBJ2SCtpidIuMVd6KOGVRPG1egGxGCB+Q== 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=oXN2k0uJ8zsf6DSYzvSHhpA7H4yCRiJKvI7trI36LpE=; b=N0J68uh8NRHifQoAFauVNH1GHA4DWSxQppsHxzHEcxkc8N/G2U1nP+H/bNL7IcXMXMGhqqyHUX/cAATHtaSW2A86UdBImtc8Xt6qXVv07B3WPzfvx34myj2z7V8SaqMsFj/5ZqeOarjkUlFb/+PVtp3EzjFJNblfifXMYBw8ajb0pxPnQ6DZ9FwrAdQWoj5zFlLdJGdtv8TP92nS4vlPNDMGCY1MCqKl+FH0xb6DM4njWX644kZfyCpStS1eRmUHnfOxArYSn9zo/klTSEFHhqcWiORcdqDPQFVEymtwI5kmCF3PoVl+BtBhOj+CZCRjqlE78qebplv0XiZIRFQOPg== 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=oXN2k0uJ8zsf6DSYzvSHhpA7H4yCRiJKvI7trI36LpE=; b=CofMmQvFiX4B5yim6OxV2JMKQzlH7db0Yh+kY2tRs+a1P3x6Doqe+Xg365v/nZpobtfDwsMpjkTmqZcp6EXPu0iP2+FH+ZxazwBjpS0J38B1+0EO2ETMji3yJcAccO+6tHpkYgWzBltw7XJpTrXEKDSs8HJiznumwoWnV3Nc6xw= Received: from BL1P223CA0025.NAMP223.PROD.OUTLOOK.COM (2603:10b6:208:2c4::30) by CH3PR12MB8459.namprd12.prod.outlook.com (2603:10b6:610:139::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7113.18; Wed, 20 Dec 2023 06:45:37 +0000 Received: from BL6PEPF0001AB4B.namprd04.prod.outlook.com (2603:10b6:208:2c4:cafe::bb) by BL1P223CA0025.outlook.office365.com (2603:10b6:208:2c4::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7113.18 via Frontend Transport; Wed, 20 Dec 2023 06:45:37 +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 BL6PEPF0001AB4B.mail.protection.outlook.com (10.167.242.69) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7113.14 via Frontend Transport; Wed, 20 Dec 2023 06:45:37 +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.34; Wed, 20 Dec 2023 00:45:30 -0600 From: Sivaprasad Tummala To: , , , , , , , CC: , , Subject: [PATCH v3 3/6] examples/l3fwd-graph: fix lcore ID restriction Date: Wed, 20 Dec 2023 07:44:58 +0100 Message-ID: <20231220064502.2830-4-sivaprasad.tummala@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231220064502.2830-1-sivaprasad.tummala@amd.com> References: <20231219032826.4814-1-sivaprasad.tummala@amd.com> <20231220064502.2830-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: BL6PEPF0001AB4B:EE_|CH3PR12MB8459:EE_ X-MS-Office365-Filtering-Correlation-Id: 20537235-b6e2-49de-b812-08dc01274654 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Xo4y7yRGIU1xkgewbA0UzDP86jm0/0oNr06neMKlXPbz2fzCfGD1HaoefW1QnUMYBRGYXjLl3zZGdunHqO/dMMKfQWDPHw8z8XDb5fBLg14H7gyIJvlXaXuaSjz03WxLd6Zm+dPoVN8t3OC6x5r33rphytPUjo3mEKefeIVVCCgDR27Pd91XNAHP5mGvJ9S1njenYaOe4Mhbrjmv4ItQSLgp0RzP0lNrRVJUyL6If5uisIUoKQOUfk3FKXK0axtZzsiMG9bKmeHXViwTukiDO1O8qULOonuaSIvPcX/tWq1FEGYyjCLEc0aZImrq9yKU1U23UKIG+hk25IHRn1nxAAXqgLVPtVUEsBAUEYSc1dT5bMRb1J03xUCw3qVL8HZ+YiqBdQeSqlBiNLgigOhXqgp2dIxvbZ5yRhpCyy/JBjYqwVNn8xUie7Chby5Xt1BDkU32L978y5VIkqOqzDeOdsO9LGxkth0W5kjsTxhNtmN3ZZfCz+JAHnz5YoO77XyEDRssVLqdQGLwd15EUvg2AxAJVxakT3fgQwZ7wqIAadeAwQr+NJ2SUooK96nRo3jcFuvUrh+jVbi4vfJwJ8vf0uImPbWZh8EbY4S9z+LJvdwGmtNQ7ReHE00sOMWJgc8vIxKd8bM3qIRjLNFTkRlYUQKDnJMVlB9GFk1inl3Vz2NbKqrplA+VrEXgz5TNrmukHw0UnDYHcYZjepY2u+bMy8ixvtGkIucfavzhgMaiwzT85aCzdS5X+GpL+4Uuu3/zd/KBCO/eOgRgtR89P1VCR+xpy+u4oa2mgd4I9cj0ePBdbPwwyXPaFmkFWVkgRc7m 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)(136003)(396003)(376002)(39860400002)(346002)(230922051799003)(230273577357003)(230173577357003)(451199024)(1800799012)(64100799003)(82310400011)(186009)(46966006)(40470700004)(36840700001)(8676002)(8936002)(47076005)(4326008)(36756003)(82740400003)(81166007)(356005)(41300700001)(86362001)(2906002)(36860700001)(44832011)(5660300002)(7416002)(16526019)(26005)(2616005)(1076003)(40480700001)(6666004)(478600001)(110136005)(70206006)(70586007)(54906003)(40460700003)(83380400001)(316002)(426003)(336012)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Dec 2023 06:45:37.4608 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 20537235-b6e2-49de-b812-08dc01274654 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: BL6PEPF0001AB4B.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB8459 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 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 | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/examples/l3fwd-graph/main.c b/examples/l3fwd-graph/main.c index 96cb1c81ff..ffb6900fee 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; + uint16_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; int socketid; - uint16_t i; + uint16_t i, 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 %hu 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 %hu 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; + uint16_t lcore; for (i = 0; i < nb_lcore_params; ++i) { lcore = lcore_params[i].lcore_id; @@ -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]; + (uint16_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