[v6,03/14] examples/l3fwd-graph: fix queue ID restriction

Message ID 20240321184721.69040-4-sivaprasad.tummala@amd.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers
Series fix lcore ID restriction |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Sivaprasad Tummala March 21, 2024, 6:47 p.m. UTC
  Currently application supports 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 queue IDs to support up to 65535.

Fixes: 08bd1a174461 ("examples/l3fwd-graph: add graph-based l3fwd skeleton")
Cc: ndabilpuram@marvell.com
Cc: stable@dpdk.org

Signed-off-by: Sivaprasad Tummala <sivaprasad.tummala@amd.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Ferruh Yigit <ferruh.yigit@amd.com>
---
 examples/l3fwd-graph/main.c | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)
  

Patch

diff --git a/examples/l3fwd-graph/main.c b/examples/l3fwd-graph/main.c
index 96cb1c81ff..c3a7b267e9 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,7 +110,7 @@  static struct lcore_conf lcore_conf[RTE_MAX_LCORE];
 
 struct lcore_params {
 	uint16_t port_id;
-	uint8_t queue_id;
+	uint16_t queue_id;
 	uint8_t lcore_id;
 } __rte_cache_aligned;
 
@@ -205,14 +205,14 @@  check_worker_model_params(void)
 static int
 check_lcore_params(void)
 {
-	uint8_t queue, lcore;
+	uint16_t queue, i;
 	int socketid;
-	uint16_t i;
+	uint8_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;
@@ -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,7 +275,7 @@  get_port_n_rx_queues(const uint16_t port)
 		}
 	}
 
-	return (uint8_t)(++queue);
+	return (uint16_t)(++queue);
 }
 
 static int
@@ -450,7 +450,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;
@@ -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;