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 7DC0943D51; Tue, 26 Mar 2024 13:56:30 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6CDAA40E2D; Tue, 26 Mar 2024 13:56:28 +0100 (CET) Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam04on2072.outbound.protection.outlook.com [40.107.101.72]) by mails.dpdk.org (Postfix) with ESMTP id 5482140E09; Tue, 26 Mar 2024 13:56:26 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZKXHbNpg84A3sTo1NNjJCU6qA93ww77OHr8WbBtKxwrpFbKkxR81UMvIOA4c/T3/ZhCgaxMncx4nsxco5eL1M2stB+5RlRoFaZLQPmusr3gWQkfR+4maV/x0k9s9IQAcBbqs3gEvKrL+i1n3yGfHT509bdWtcPl0tON0Nw1UW/mp0eMJGSwLY5DFwoKr8tU6Vyn735i1tBJ4Ge8XFszJDgaGK8F5KoQeSl3pikoUQkXnVDAYp8Tboevvd0ItgS42m9l7cIDwMLShgH2fK5JdFK+1Umu+WOP/aaVcjy0R5+qGoNhckFAmkPjm5zkaKXclGz/TPLBUHXkEb2Ilm/T6Bw== 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=uDhya/5gQ0C5wd1sginTZcRRZJPcrqso2pgBtXeuJNo=; b=oMUYtVdZtsoELxXkoV+Msw5PGlcUg3qYEcKu6XKG7oX7aQSNzUhXa8E3OvOjP6XtnZGshuvFj1pBar2PUxRnZ99maEwWmkk7LUTPU+yBwlfyZK7uYPkYPSe5T01TRSn/HrU2KgptLr4OGUNqexE96Q8w38bT0l8hLapQAiemoCcy2DfBC4JLAFASBn1nAWEHwyTuE8xSeXW3f7l1bqvCt6Yd6xbgl8OsutuaQumFskg2fh4n68tYeSaBZMqKhU59CeCoijj6LZZrPvPYb5ML4j40bAArV41gLr5rLP9M0XsPhiff/1LErU8q2x6Qwy4qSbcnj1kGnSgrEajXuicxRg== 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=uDhya/5gQ0C5wd1sginTZcRRZJPcrqso2pgBtXeuJNo=; b=Vwk3COtyyvab2fSzo+llMagnrbs/kjpDiIDJAs3L7dHqMPmX6VOa1GM1NDj3iabwKlXnrXFdTWGUpeZ5fWbj+EhZCxbwBXHWSox28si6+BaSnmJQfHymn6bitsea9u8jQAnZ+JiQWWx8p5qcPXLOI9pOInsT69HiZ2npF0ra8Tc= Received: from BN9PR03CA0080.namprd03.prod.outlook.com (2603:10b6:408:fc::25) by IA1PR12MB6602.namprd12.prod.outlook.com (2603:10b6:208:3a2::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.31; Tue, 26 Mar 2024 12:56:23 +0000 Received: from BN1PEPF0000468A.namprd05.prod.outlook.com (2603:10b6:408:fc:cafe::d3) by BN9PR03CA0080.outlook.office365.com (2603:10b6:408:fc::25) 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:23 +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 BN1PEPF0000468A.mail.protection.outlook.com (10.167.243.135) 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:23 +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:18 -0500 From: Sivaprasad Tummala To: , , , , , , , , , , CC: , Subject: [PATCH v7 01/14] examples/l3fwd: fix queue ID restriction Date: Tue, 26 Mar 2024 13:55:40 +0100 Message-ID: <20240326125554.138840-2-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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit 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: BN1PEPF0000468A:EE_|IA1PR12MB6602:EE_ X-MS-Office365-Filtering-Correlation-Id: 6e649229-cc53-40e3-3d30-08dc4d94240e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Y8ULfOePalI7Dov8ba9X+9qIOQegWFHMC4c5HeiHotpiZ7O2PtUvtOZmG3ZQ8d984EtWn9FPdyKcm586Jv4DDPjDTXkmqTQTu37K8lCCCWvTRR68iN5FnrdpzjYj21Q5NsOBEqmkE3zFgnst6bQCTCYch4MGkPsTs8fokFU4yCSdL61I0lE4Qv6bDzGt9EgvkipdeEl6DF7+kCky8HEqIWBlyxYGY/NFZm6IxWofwFmS8tQ9wbc3VLzPPDoAUEK2H3ImAGTSt5w3xPwbMTwJpJgSeLEmNbjSm8UMmbdvKIufxlxG33EKzOeUq8c0v6WaI8tL8rLaeOHQ2ac6zMR406hS4Y7vsACXiXjks50JNQpGWUlQpCFiT8VWym6cfjj5szT+xKXqfNvPiQUpI91YxOMpaBS/I1U6o3RFOPEoGDD8Qiyu7RtG9EGbuY+nGfpRSJ7XBKj5Oy4JxlcHnGPSh5c79EJwJkFl6lv8QoG/i59QxGc471+sI7IWXBiNbC32lj6E5qFH2UUzO/uiCXKyq95CS9dhuDhpKXBp8GTriLbkzKPppdpIzXQS8LxbIdnch+sFfc5VDO03rroD19bekPbgH4NBAVxGyrGJlVC5P/FiLUCk6Q5KVd5Esf/h97JBn4V1rEJOX+nhqbMhKgE4rqrNUkKsdjqG6BJC6790YoAI5gWcZyXHSfipvBCQemMG+ggoj9gDqR+HkrBeWX0ZSzciUS8MFOhDdOrnDxlV24p/0p0psHoBal0xWjKgOaoFHIMlpdIJ/+ef+yR2MbYsfw== 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)(7416005)(1800799015)(376005)(36860700004)(82310400014)(921011); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Mar 2024 12:56:23.4710 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6e649229-cc53-40e3-3d30-08dc4d94240e 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: BN1PEPF0000468A.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB6602 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 application supports rx queue IDs up to 255 and max queues of 256 irrespective of device support. This limits the number of active lcores to 256. The patch fixes these constraints by increasing the rx queue IDs to support up to 65535. 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/l3fwd.h | 2 +- examples/l3fwd/l3fwd_acl.c | 4 ++-- examples/l3fwd/l3fwd_em.c | 4 ++-- examples/l3fwd/l3fwd_event.h | 2 +- examples/l3fwd/l3fwd_fib.c | 4 ++-- examples/l3fwd/l3fwd_lpm.c | 5 ++--- examples/l3fwd/main.c | 24 +++++++++++++----------- 7 files changed, 23 insertions(+), 22 deletions(-) diff --git a/examples/l3fwd/l3fwd.h b/examples/l3fwd/l3fwd.h index e7ae0e5834..12c264cb4c 100644 --- a/examples/l3fwd/l3fwd.h +++ b/examples/l3fwd/l3fwd.h @@ -74,7 +74,7 @@ struct mbuf_table { struct lcore_rx_queue { uint16_t port_id; - uint8_t queue_id; + uint16_t queue_id; } __rte_cache_aligned; struct lcore_conf { diff --git a/examples/l3fwd/l3fwd_acl.c b/examples/l3fwd/l3fwd_acl.c index 401692bcec..eec0361a3e 100644 --- a/examples/l3fwd/l3fwd_acl.c +++ b/examples/l3fwd/l3fwd_acl.c @@ -997,7 +997,7 @@ acl_main_loop(__rte_unused void *dummy) uint64_t prev_tsc, diff_tsc, cur_tsc; int i, nb_rx; uint16_t portid; - uint8_t queueid; + uint16_t queueid; struct lcore_conf *qconf; int socketid; const uint64_t drain_tsc = (rte_get_tsc_hz() + US_PER_S - 1) @@ -1020,7 +1020,7 @@ acl_main_loop(__rte_unused void *dummy) portid = qconf->rx_queue_list[i].port_id; queueid = qconf->rx_queue_list[i].queue_id; RTE_LOG(INFO, L3FWD, - " -- lcoreid=%u portid=%u rxqueueid=%hhu\n", + " -- lcoreid=%u portid=%u rxqueueid=%" PRIu16 "\n", lcore_id, portid, queueid); } diff --git a/examples/l3fwd/l3fwd_em.c b/examples/l3fwd/l3fwd_em.c index 40e102b38a..f18ac0048b 100644 --- a/examples/l3fwd/l3fwd_em.c +++ b/examples/l3fwd/l3fwd_em.c @@ -586,7 +586,7 @@ em_main_loop(__rte_unused void *dummy) unsigned lcore_id; uint64_t prev_tsc, diff_tsc, cur_tsc; int i, nb_rx; - uint8_t queueid; + uint16_t queueid; uint16_t portid; struct lcore_conf *qconf; const uint64_t drain_tsc = (rte_get_tsc_hz() + US_PER_S - 1) / @@ -609,7 +609,7 @@ em_main_loop(__rte_unused void *dummy) portid = qconf->rx_queue_list[i].port_id; queueid = qconf->rx_queue_list[i].queue_id; RTE_LOG(INFO, L3FWD, - " -- lcoreid=%u portid=%u rxqueueid=%hhu\n", + " -- lcoreid=%u portid=%u rxqueueid=%" PRIu16 "\n", lcore_id, portid, queueid); } diff --git a/examples/l3fwd/l3fwd_event.h b/examples/l3fwd/l3fwd_event.h index 9aad358003..c6a4a89127 100644 --- a/examples/l3fwd/l3fwd_event.h +++ b/examples/l3fwd/l3fwd_event.h @@ -78,8 +78,8 @@ struct l3fwd_event_resources { uint8_t deq_depth; uint8_t has_burst; uint8_t enabled; - uint8_t eth_rx_queues; uint8_t vector_enabled; + uint16_t eth_rx_queues; uint16_t vector_size; uint64_t vector_tmo_ns; }; diff --git a/examples/l3fwd/l3fwd_fib.c b/examples/l3fwd/l3fwd_fib.c index 6a21984415..f38b19af3f 100644 --- a/examples/l3fwd/l3fwd_fib.c +++ b/examples/l3fwd/l3fwd_fib.c @@ -186,7 +186,7 @@ fib_main_loop(__rte_unused void *dummy) uint64_t prev_tsc, diff_tsc, cur_tsc; int i, nb_rx; uint16_t portid; - uint8_t queueid; + uint16_t queueid; struct lcore_conf *qconf; const uint64_t drain_tsc = (rte_get_tsc_hz() + US_PER_S - 1) / US_PER_S * BURST_TX_DRAIN_US; @@ -208,7 +208,7 @@ fib_main_loop(__rte_unused void *dummy) portid = qconf->rx_queue_list[i].port_id; queueid = qconf->rx_queue_list[i].queue_id; RTE_LOG(INFO, L3FWD, - " -- lcoreid=%u portid=%u rxqueueid=%hhu\n", + " -- lcoreid=%u portid=%u rxqueueid=%" PRIu16 "\n", lcore_id, portid, queueid); } diff --git a/examples/l3fwd/l3fwd_lpm.c b/examples/l3fwd/l3fwd_lpm.c index a484a33089..e8fd95aae9 100644 --- a/examples/l3fwd/l3fwd_lpm.c +++ b/examples/l3fwd/l3fwd_lpm.c @@ -148,8 +148,7 @@ lpm_main_loop(__rte_unused void *dummy) unsigned lcore_id; uint64_t prev_tsc, diff_tsc, cur_tsc; int i, nb_rx; - uint16_t portid; - uint8_t queueid; + uint16_t portid, queueid; struct lcore_conf *qconf; const uint64_t drain_tsc = (rte_get_tsc_hz() + US_PER_S - 1) / US_PER_S * BURST_TX_DRAIN_US; @@ -171,7 +170,7 @@ lpm_main_loop(__rte_unused void *dummy) portid = qconf->rx_queue_list[i].port_id; queueid = qconf->rx_queue_list[i].queue_id; RTE_LOG(INFO, L3FWD, - " -- lcoreid=%u portid=%u rxqueueid=%hhu\n", + " -- lcoreid=%u portid=%u rxqueueid=%" PRIu16 "\n", lcore_id, portid, queueid); } diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c index 8d32ae1dd5..039207b06c 100644 --- a/examples/l3fwd/main.c +++ b/examples/l3fwd/main.c @@ -98,7 +98,7 @@ struct parm_cfg parm_config; struct lcore_params { uint16_t port_id; - uint8_t queue_id; + uint16_t queue_id; uint8_t lcore_id; } __rte_cache_aligned; @@ -292,14 +292,14 @@ setup_l3fwd_lookup_tables(void) static int check_lcore_params(void) { - uint8_t queue, lcore; - uint16_t i; + uint16_t queue, i; + uint8_t lcore; int socketid; 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: %" PRIu16 "\n", queue); return -1; } lcore = lcore_params[i].lcore_id; @@ -336,7 +336,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; @@ -352,7 +352,7 @@ get_port_n_rx_queues(const uint16_t port) lcore_params[i].port_id); } } - return (uint8_t)(++queue); + return (uint16_t)(++queue); } static int @@ -500,6 +500,7 @@ 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}; nb_lcore_params = 0; @@ -518,7 +519,7 @@ 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) { @@ -529,7 +530,7 @@ parse_config(const char *q_arg) lcore_params_array[nb_lcore_params].port_id = (uint8_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]; ++nb_lcore_params; @@ -630,7 +631,7 @@ parse_event_eth_rx_queues(const char *eth_rx_queues) { struct l3fwd_event_resources *evt_rsrc = l3fwd_get_eventdev_rsrc(); char *end = NULL; - uint8_t num_eth_rx_queues; + uint16_t num_eth_rx_queues; /* parse decimal string */ num_eth_rx_queues = strtoul(eth_rx_queues, &end, 10); @@ -1211,7 +1212,8 @@ config_port_max_pkt_len(struct rte_eth_conf *conf, static void l3fwd_poll_resource_setup(void) { - uint8_t nb_rx_queue, queue, socketid; + uint8_t socketid; + uint16_t nb_rx_queue, queue; struct rte_eth_dev_info dev_info; uint32_t n_tx_queue, nb_lcores; struct rte_eth_txconf *txconf; @@ -1535,7 +1537,7 @@ main(int argc, char **argv) struct lcore_conf *qconf; uint16_t queueid, portid; unsigned int lcore_id; - uint8_t queue; + uint16_t queue; int ret; /* init EAL */ -- 2.25.1