From patchwork Tue Jan 16 18:23:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sivaprasad Tummala X-Patchwork-Id: 135891 X-Patchwork-Delegate: david.marchand@redhat.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6ECAB438E3; Tue, 16 Jan 2024 19:24:05 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6AD3D40A7D; Tue, 16 Jan 2024 19:23:54 +0100 (CET) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2072.outbound.protection.outlook.com [40.107.94.72]) by mails.dpdk.org (Postfix) with ESMTP id A875940A71; Tue, 16 Jan 2024 19:23:52 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SyVsCxa3SNwOeZLtj5U5UYIPpraLjlBNh/uIHl2gTFuz8dDeExYRg/N4UNAt3a/Q/d294gyewSLFIcbn2LwUkUbuK9DU0S+LC2EXcKvncn+zOBPoVmgUearGITFXCklp1/tjkHMx9ki+lXRwKk7vmIC/Z8H+ReFZgCDs1FSXh7nXRJT7rf/oPo3ob+7oeb9FeDPVfBZSJfsp/V+nHH4JnhawBqoObv7IgWOgyr5xK44KVTF1NbIxKD0h6v5db9P03tH2PaIsCq19pAzvBUinzuicyy+CP9QtAVhQrnIaRsBIdfPYmO1wYX8VHPvo3Hr8VCrGfNnwH/3OtklHb76pQA== 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=HstkCMFP7HyZ8JuAV6za6cBCLuuYbiYIg/ChaCjwWYJG2i/wdTetnU8sRuwARvCmh5RA/enMz8THjdxw9kp6/7bF8yum+U6qw5XJsOlavcgtGGo0q/+p2cKy1KHH7cor8+kviQfwv7TZZWEdQM3vVjfy/jiJi/YJab4qmpKmmidF7duS9GP3K2lAjrhMv6omDdfdy7BgpvWgOv+1c+7totC9BrEA++DACpavUeSKQbSg1WSa90FUOKrr7hzRizHVMbtEvj2BEWc4fXEFJW17dVmfJQKMFlZyQ3xN8oW3P/HYW/RqM34AsTXr7sRIWTY47BL4SuSdOkYn1Sb+5XJA7Q== 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=eGaP95B3pSP8U3o24iswhqZoYSf0ghD2HZbjGZ1MYauKFPciJY1FuLX+PCK4wW4QsJT3Mg7rTj+Z8ALLKNnjSOT5uHj+3XZFPI/jyTE5YIgbrEhE/M9uNRKSbr1GDDbxa+z5gj4idx3iiDwtmnZ3yGHhaPjyqEvtTiTGHIkaJAo= Received: from BYAPR07CA0019.namprd07.prod.outlook.com (2603:10b6:a02:bc::32) by DM6PR12MB4386.namprd12.prod.outlook.com (2603:10b6:5:28f::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7181.26; Tue, 16 Jan 2024 18:23:49 +0000 Received: from SJ1PEPF00001CDC.namprd05.prod.outlook.com (2603:10b6:a02:bc:cafe::bd) by BYAPR07CA0019.outlook.office365.com (2603:10b6:a02:bc::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7181.26 via Frontend Transport; Tue, 16 Jan 2024 18:23: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 SJ1PEPF00001CDC.mail.protection.outlook.com (10.167.242.4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7202.16 via Frontend Transport; Tue, 16 Jan 2024 18:23:49 +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; Tue, 16 Jan 2024 12:23:48 -0600 From: Sivaprasad Tummala To: , , , , , , , , CC: , , Subject: [PATCH v4 3/6] examples/l3fwd-graph: fix lcore ID restriction Date: Tue, 16 Jan 2024 18:23:28 +0000 Message-ID: <20240116182332.95537-4-sivaprasad.tummala@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240116182332.95537-1-sivaprasad.tummala@amd.com> References: <20231220064502.2830-1-sivaprasad.tummala@amd.com> <20240116182332.95537-1-sivaprasad.tummala@amd.com> MIME-Version: 1.0 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: SJ1PEPF00001CDC:EE_|DM6PR12MB4386:EE_ X-MS-Office365-Filtering-Correlation-Id: 97e23307-613e-46c7-3000-08dc16c0492c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: A6PC4ZrcefJDgRbSzroHvymlheX+tOQYH4L+AOcr9iv5MqASlBIuwkTgeNtmRoAAZhBxNCwv1g+xbFbRUZ9YL1cwnMo/HOL8Q+pGOtwW/gWh2l1EgOR+9Fm/vszx3YMqsh9DEKxx6axlY1M1aY/BEZO8+tNEpafybSAxtXRaanq9ajRT19X7sHhJqVmBGvx1FwDxqSOLx/Cbs/hIfYSb+U4SkD02OJKTyYsCVPeLa7Ag3b1K6hKayCpcAw6nJM0VSSZadwGUYSKwSHso2f54r6cw2lbl3uufWnqwcvEdXHbI4NiyCewr8V7dEr+83ugm5BWKctFUEEOocGQ4bqC/6qigkKYM4od1gbFSYf65CcYMi7w5JPbfPPhfQmc/0ufiYGpYA55ZkDpb5iBvNY3WNgIhYCd004XfkBTVfn3X4umwYII82sWMSJFPqTKcUzWa4X54kdjnAXCflwEBCxmaer9KUvNfD53Q6/akSIrexIqVfBaUjs1PvvEbj5D2TAIfgLIJdiDxkHxFOBYKkncEqlgUuONGrurKJtj4q78/iloGWlXKk9K31atLrJSgZu4bw9AL+eRjhASi3eGu0ATHwGpnYPPyyVIYPic4w+6b8IE9Q4eDak30UAmn/nUoHzYtyX/cRNys/BCLOi0GGy26GNq5YaZ4iIPV9qf88X8pRFLJqxGgZBWJyKjaKNhtfsUBy+hLS6oF7036VveQYrRUbmpMUDvqikWzsMMEiJZ36CmCwzM4hzsWaSeZ0ZJXaOh6Az28gqqlm0nPYPSUzGf60w9KLFzYeEnNANkKt50g3HBNKN+tt5G7DzIwClru8Es5 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)(346002)(396003)(376002)(136003)(39860400002)(230922051799003)(230273577357003)(230173577357003)(64100799003)(82310400011)(186009)(451199024)(1800799012)(40470700004)(46966006)(36840700001)(83380400001)(2906002)(426003)(16526019)(2616005)(26005)(336012)(1076003)(47076005)(82740400003)(478600001)(36860700001)(8676002)(44832011)(7696005)(7416002)(8936002)(110136005)(5660300002)(4326008)(54906003)(6666004)(316002)(356005)(81166007)(70586007)(70206006)(36756003)(41300700001)(86362001)(40480700001)(40460700003)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jan 2024 18:23:49.5838 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 97e23307-613e-46c7-3000-08dc16c0492c 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: SJ1PEPF00001CDC.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4386 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;