From patchwork Tue Mar 26 12:55:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sivaprasad Tummala X-Patchwork-Id: 138801 X-Patchwork-Delegate: thomas@monjalon.net 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 2C4BA43D51; Tue, 26 Mar 2024 13:57:01 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 45AD5410DD; Tue, 26 Mar 2024 13:56:51 +0100 (CET) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2059.outbound.protection.outlook.com [40.107.92.59]) by mails.dpdk.org (Postfix) with ESMTP id 6D48141060; Tue, 26 Mar 2024 13:56:48 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hCKg2D4nLOHuSzDp45d1O8N1lX3t53/DaHEdUy5d5Rikyb6KsYz4GCD9GBkzTyeKxkLvnwEBCwuhdZNFsk4dZHFGH6JBfRXpwbn6K97iTZtgUMu7XRO6fzjJSwX6i9/ZBt+jU5vXV0kOuHH3PDB1aE/exb5ozNvRdRBVUx7q5wdUnnQQczyQkR7MpCMQvKfliBYU0cUoM3FnMYt0hyUn2+bY8iHMa38HrITfEYvHG7hh1je6AMGCnL3JC4V3yhBSv1ajAiTGjf32/3NruyhXJjV3cHXo+aoAmwsJLv3oD+9c2fiQb+vfWihJEC9Qx5XNjDwcArnZKacMQfq+v1397w== 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=dZYT+1yB5efFXrSo0WXRJmDmDr/zqly3szx85WuWMhQ=; b=Aw9clJD1dW6K/BBh1duSTrn8EyRxOjHf4IqzTdv+gkEE4nznk4uxcYRv/dUa5WeevfsSpfA8E++JYuf9WdHleWCVtZlmBS2NThL1cM2fwlrdZMhDTmSiS+vyTipiOr/WIjuwwycvK1crLKlc9VKOxCiF/JrabcJQSBVsfJ/jy7XK12v328m2Zapdk+wr+Hnt9Me+ZcTz1SIwplQS7K6oVW8T0VCfxPbDom6hgMiwKZABC6ZbNENnqVz/pb7ozvoULxSfJ6CHF5VH/db5Lu0sF5dl61nfGL9LkMLk3idfDDMMNxuNS5y7wWIkRwc+bdJbF4BsHbdbswEd/56CLbW0wA== 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=dZYT+1yB5efFXrSo0WXRJmDmDr/zqly3szx85WuWMhQ=; b=qByhrm3obhHBbR98KGWDRib2g0v2V6dek7FLJaAKvoAChK03gcg2oGWXwvyFEdV0LBM6AC3ukXEw0KoCyDNXdN8vQIduc734XjFqgd0Ar6sKcixs6GyhFhPNxtj33VN9wO/9ooTwwMb+ZHURdE/TgOHnfz6o5z8PCUrqNMELhvY= Received: from BN1PR12CA0001.namprd12.prod.outlook.com (2603:10b6:408:e1::6) by CY8PR12MB8244.namprd12.prod.outlook.com (2603:10b6:930:72::7) 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:44 +0000 Received: from BN1PEPF0000468D.namprd05.prod.outlook.com (2603:10b6:408:e1:cafe::83) by BN1PR12CA0001.outlook.office365.com (2603:10b6:408:e1::6) 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:44 +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 BN1PEPF0000468D.mail.protection.outlook.com (10.167.243.138) 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:44 +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:39 -0500 From: Sivaprasad Tummala To: , , , , , , , , , , CC: , Subject: [PATCH v7 05/14] examples/l3fwd: fix lcore ID restriction Date: Tue, 26 Mar 2024 13:55:44 +0100 Message-ID: <20240326125554.138840-6-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 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: BN1PEPF0000468D:EE_|CY8PR12MB8244:EE_ X-MS-Office365-Filtering-Correlation-Id: 802ef878-05d6-45e1-d19a-08dc4d943077 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: rnb8tBN5KiDWTPqs5q4ZmXH/E1NDiwIR4PgnteKoQ23lOSMaXqJYoLFfsJtfjWuxXWrDLLsg9QRa2peTqbgm8TDG+6qgCipZO4E/BXST+uxsXv4GhpK5ZnTda4GifVA/K0ikLd0Ajf3HaROzDUY+Ql+PuW/Zcau0ReIkc/208qmGQFfDE2dyfiV7a1Au/H4yqur6ctjfX+VJ6MDR5280XgVXH57OLPJbLQhpmCrA/nmSwjZFOubYL2kvew+DlsdcvYjWoVDefYYPZ5GBPCX6+7g/ebkMqsIz8i6mQRm9kp679j3v8D5i0k6mbEQaTWs5IKB5gs6YVesxGi9FgEH4/dNmJi/z9j+LTXU3JZvZaZFrF+flHRlrVCduzNYIGNZ0fk3Pj9UxfAPfOwrdeFDNUthjXqmENAbuHeAHXpuyafJJlnI9SJTs3LXJElaS7dxPzjYlm2C5Bx9mNoQyDnJ5DA2mCsgH17XBrMS+sZ6f34ZkHkl6OwZfRU6hwboyPIxCHb3nvF/1ySdJcussD2rGFvziqeU+XZ12i/5HDWym8VBk0y4A2MtR9uk9e7nmk9Q1bc36eI1kqT/xUM0LlGn3qLAdzIZU/SHldxNosGrdB42gm4sbYehlKZcEtAnDDRx5x429Ut7Bac+oqs0Ba+ZnXirDCgqNXNP2ywZm6UQb8z8U8tdirLDU0gZK9p6D7tIP0bF2sIuhN/EWcUqxhEyFCS0UBT2B8l9VwP8z9WWmpLhME0rNuesNIx1fH7gJm+e0rKjXXEANf9OmwgxTyDmG3A== 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)(36860700004)(82310400014)(376005)(7416005)(1800799015)(921011); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Mar 2024 12:56:44.2956 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 802ef878-05d6-45e1-d19a-08dc4d943077 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: BN1PEPF0000468D.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB8244 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 fixes these constraints by allowing all lcore IDs up to RTE_MAX_LCORES. Fixes: af75078fece3 ("first public release") Cc: stable@dpdk.org Signed-off-by: Sivaprasad Tummala Acked-by: Konstantin Ananyev Acked-by: Morten Brørup Acked-by: Ferruh Yigit --- examples/l3fwd/main.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c index 039207b06c..47baf464e2 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; uint16_t queue_id; - uint8_t lcore_id; + uint32_t lcore_id; } __rte_cache_aligned; static struct lcore_params lcore_params_array[MAX_LCORE_PARAMS]; @@ -293,7 +293,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) { @@ -304,12 +304,12 @@ 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 mask\n", 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 off \n", + printf("warning: lcore %u is on socket %d with numa off\n", lcore, socketid); } } @@ -359,14 +359,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 = @@ -500,7 +500,11 @@ parse_config(const char *q_arg) char *str_fld[_NUM_FLD]; int i; unsigned size; - uint16_t max_fld[_NUM_FLD] = {255, RTE_MAX_QUEUES_PER_PORT, 255}; + uint16_t max_fld[_NUM_FLD] = { + 255, + RTE_MAX_QUEUES_PER_PORT, + RTE_MAX_LCORE + }; nb_lcore_params = 0; @@ -532,7 +536,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;