DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH 1/2] examples/l3fwd: use single set of variables throughout the code
@ 2022-02-02  6:04 Honnappa Nagarahalli
  2022-02-02  6:04 ` [PATCH 2/2] examples/l3fwd: make RX and TX queue size configurable Honnappa Nagarahalli
                   ` (3 more replies)
  0 siblings, 4 replies; 16+ messages in thread
From: Honnappa Nagarahalli @ 2022-02-02  6:04 UTC (permalink / raw)
  To: dev, honnappa.nagarahalli, lijuan.tu, juraj.linkes, ohilyard,
	david.marchand, thomas, jerinj
  Cc: kathleen.capella, nd

nb_rxd and nb_txd are used in polling mode and event mode of
operation. nb_rxd and nb_txd are already global. Make them
visible to all parts of the application.

Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
DTS test cases require changing the RX and TX queue depths.
Currently, this is achieved by patching the DPDK code. This patch set
provides a mechanism to configure the queue depths while launching
the application. With this change DTS test cases do not need
to modify the DPDK code.

 examples/l3fwd/l3fwd.h       | 4 ++++
 examples/l3fwd/l3fwd_event.c | 2 --
 examples/l3fwd/main.c        | 5 ++---
 3 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/examples/l3fwd/l3fwd.h b/examples/l3fwd/l3fwd.h
index 38ca19133c..4ccdb28b4a 100644
--- a/examples/l3fwd/l3fwd.h
+++ b/examples/l3fwd/l3fwd.h
@@ -81,6 +81,10 @@ struct lcore_conf {
 
 extern volatile bool force_quit;
 
+/* RX and TX queue depths */
+extern uint16_t nb_rxd;
+extern uint16_t nb_txd;
+
 /* ethernet addresses of ports */
 extern uint64_t dest_eth_addr[RTE_MAX_ETHPORTS];
 extern struct rte_ether_addr ports_eth_addr[RTE_MAX_ETHPORTS];
diff --git a/examples/l3fwd/l3fwd_event.c b/examples/l3fwd/l3fwd_event.c
index dd9eafa9b9..7a401290f8 100644
--- a/examples/l3fwd/l3fwd_event.c
+++ b/examples/l3fwd/l3fwd_event.c
@@ -43,8 +43,6 @@ l3fwd_eth_dev_port_setup(struct rte_eth_conf *port_conf)
 {
 	struct l3fwd_event_resources *evt_rsrc = l3fwd_get_eventdev_rsrc();
 	uint16_t nb_ports = rte_eth_dev_count_avail();
-	uint16_t nb_rxd = RTE_TEST_RX_DESC_DEFAULT;
-	uint16_t nb_txd = RTE_TEST_TX_DESC_DEFAULT;
 	unsigned int nb_lcores = rte_lcore_count();
 	struct rte_eth_conf local_port_conf;
 	struct rte_eth_dev_info dev_info;
diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c
index eb68ffc5aa..acd186ab7d 100644
--- a/examples/l3fwd/main.c
+++ b/examples/l3fwd/main.c
@@ -53,9 +53,8 @@
 
 #define MAX_LCORE_PARAMS 1024
 
-/* Static global variables used within this file. */
-static uint16_t nb_rxd = RTE_TEST_RX_DESC_DEFAULT;
-static uint16_t nb_txd = RTE_TEST_TX_DESC_DEFAULT;
+uint16_t nb_rxd = RTE_TEST_RX_DESC_DEFAULT;
+uint16_t nb_txd = RTE_TEST_TX_DESC_DEFAULT;
 
 /**< Ports set in promiscuous mode off by default. */
 static int promiscuous_on;
-- 
2.25.1


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH 2/2] examples/l3fwd: make RX and TX queue size configurable
  2022-02-02  6:04 [PATCH 1/2] examples/l3fwd: use single set of variables throughout the code Honnappa Nagarahalli
@ 2022-02-02  6:04 ` Honnappa Nagarahalli
  2022-02-08  7:41   ` Ruifeng Wang
  2022-02-02  8:49 ` [PATCH 1/2] examples/l3fwd: use single set of variables throughout the code Bruce Richardson
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 16+ messages in thread
From: Honnappa Nagarahalli @ 2022-02-02  6:04 UTC (permalink / raw)
  To: dev, honnappa.nagarahalli, lijuan.tu, juraj.linkes, ohilyard,
	david.marchand, thomas, jerinj
  Cc: kathleen.capella, nd

Make RX and TX queue sizes configurable from the command line.
This helps DTS write better test cases.

Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
 examples/l3fwd/main.c | 56 ++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 55 insertions(+), 1 deletion(-)

diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c
index acd186ab7d..c9ed0d4c3d 100644
--- a/examples/l3fwd/main.c
+++ b/examples/l3fwd/main.c
@@ -341,6 +341,8 @@ print_usage(const char *prgname)
 		" [-P]"
 		" [--lookup]"
 		" --config (port,queue,lcore)[,(port,queue,lcore)]"
+		" [--rx-queue-size]"
+		" [--tx-queue-size]"
 		" [--eth-dest=X,MM:MM:MM:MM:MM:MM]"
 		" [--max-pkt-len PKTLEN]"
 		" [--no-numa]"
@@ -360,6 +362,10 @@ print_usage(const char *prgname)
 		"            Default: lpm\n"
 		"            Accepted: em (Exact Match), lpm (Longest Prefix Match), fib (Forwarding Information Base)\n"
 		"  --config (port,queue,lcore): Rx queue configuration\n"
+		"  --rx-queue-size: Rx queue size\n"
+		"            Default: %d\n"
+		"  --tx-queue-size: Tx queue size\n"
+		"            Default: %d\n"
 		"  --eth-dest=X,MM:MM:MM:MM:MM:MM: Ethernet destination for port X\n"
 		"  --max-pkt-len PKTLEN: maximum packet length in decimal (64-9600)\n"
 		"  --no-numa: Disable numa awareness\n"
@@ -381,7 +387,7 @@ print_usage(const char *prgname)
 		"  --event-vector-tmo: Max timeout to form vector in nanoseconds if event vectorization is enabled\n"
 		"  -E : Enable exact match, legacy flag please use --lookup=em instead\n"
 		"  -L : Enable longest prefix match, legacy flag please use --lookup=lpm instead\n\n",
-		prgname);
+		prgname, RTE_TEST_RX_DESC_DEFAULT, RTE_TEST_TX_DESC_DEFAULT);
 }
 
 static int
@@ -524,6 +530,40 @@ parse_mode(const char *optarg)
 		evt_rsrc->enabled = true;
 }
 
+static void
+parse_rx_queue_size(const char *rx_queue_size_arg)
+{
+	char *end = NULL;
+	uint32_t rx_queue_size;
+
+	/* parse decimal string */
+	rx_queue_size = strtoul(rx_queue_size_arg, &end, 10);
+	if ((rx_queue_size_arg[0] == '\0') || (end == NULL) || (*end != '\0'))
+		return;
+
+	if (rx_queue_size == 0)
+		return;
+
+	nb_rxd = rx_queue_size;
+}
+
+static void
+parse_tx_queue_size(const char *tx_queue_size_arg)
+{
+	char *end = NULL;
+	uint32_t tx_queue_size;
+
+	/* parse decimal string */
+	tx_queue_size = strtoul(tx_queue_size_arg, &end, 10);
+	if ((tx_queue_size_arg[0] == '\0') || (end == NULL) || (*end != '\0'))
+		return;
+
+	if (tx_queue_size == 0)
+		return;
+
+	nb_rxd = tx_queue_size;
+}
+
 static void
 parse_eventq_sched(const char *optarg)
 {
@@ -581,6 +621,8 @@ static const char short_options[] =
 	;
 
 #define CMD_LINE_OPT_CONFIG "config"
+#define CMD_LINE_OPT_RX_QUEUE_SIZE "rx-queue-size"
+#define CMD_LINE_OPT_TX_QUEUE_SIZE "tx-queue-size"
 #define CMD_LINE_OPT_ETH_DEST "eth-dest"
 #define CMD_LINE_OPT_NO_NUMA "no-numa"
 #define CMD_LINE_OPT_IPV6 "ipv6"
@@ -603,6 +645,8 @@ enum {
 	 * conflict with short options */
 	CMD_LINE_OPT_MIN_NUM = 256,
 	CMD_LINE_OPT_CONFIG_NUM,
+	CMD_LINE_OPT_RX_QUEUE_SIZE_NUM,
+	CMD_LINE_OPT_TX_QUEUE_SIZE_NUM,
 	CMD_LINE_OPT_ETH_DEST_NUM,
 	CMD_LINE_OPT_NO_NUMA_NUM,
 	CMD_LINE_OPT_IPV6_NUM,
@@ -621,6 +665,8 @@ enum {
 
 static const struct option lgopts[] = {
 	{CMD_LINE_OPT_CONFIG, 1, 0, CMD_LINE_OPT_CONFIG_NUM},
+	{CMD_LINE_OPT_RX_QUEUE_SIZE, 1, 0, CMD_LINE_OPT_RX_QUEUE_SIZE_NUM},
+	{CMD_LINE_OPT_TX_QUEUE_SIZE, 1, 0, CMD_LINE_OPT_TX_QUEUE_SIZE_NUM},
 	{CMD_LINE_OPT_ETH_DEST, 1, 0, CMD_LINE_OPT_ETH_DEST_NUM},
 	{CMD_LINE_OPT_NO_NUMA, 0, 0, CMD_LINE_OPT_NO_NUMA_NUM},
 	{CMD_LINE_OPT_IPV6, 0, 0, CMD_LINE_OPT_IPV6_NUM},
@@ -714,6 +760,14 @@ parse_args(int argc, char **argv)
 			lcore_params = 1;
 			break;
 
+		case CMD_LINE_OPT_RX_QUEUE_SIZE_NUM:
+			parse_rx_queue_size(optarg);
+			break;
+
+		case CMD_LINE_OPT_TX_QUEUE_SIZE_NUM:
+			parse_tx_queue_size(optarg);
+			break;
+
 		case CMD_LINE_OPT_ETH_DEST_NUM:
 			parse_eth_dest(optarg);
 			break;
-- 
2.25.1


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 1/2] examples/l3fwd: use single set of variables throughout the code
  2022-02-02  6:04 [PATCH 1/2] examples/l3fwd: use single set of variables throughout the code Honnappa Nagarahalli
  2022-02-02  6:04 ` [PATCH 2/2] examples/l3fwd: make RX and TX queue size configurable Honnappa Nagarahalli
@ 2022-02-02  8:49 ` Bruce Richardson
  2022-02-11  0:26 ` [PATCH v2 " Honnappa Nagarahalli
  2022-02-23  6:09 ` [PATCH v3 1/2] examples/l3fwd: use single set of variables throughout the code Honnappa Nagarahalli
  3 siblings, 0 replies; 16+ messages in thread
From: Bruce Richardson @ 2022-02-02  8:49 UTC (permalink / raw)
  To: Honnappa Nagarahalli
  Cc: dev, lijuan.tu, juraj.linkes, ohilyard, david.marchand, thomas,
	jerinj, kathleen.capella, nd

On Wed, Feb 02, 2022 at 06:04:02AM +0000, Honnappa Nagarahalli wrote:
> nb_rxd and nb_txd are used in polling mode and event mode of
> operation. nb_rxd and nb_txd are already global. Make them
> visible to all parts of the application.
> 
> Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
> ---
> DTS test cases require changing the RX and TX queue depths.
> Currently, this is achieved by patching the DPDK code. This patch set
> provides a mechanism to configure the queue depths while launching
> the application. With this change DTS test cases do not need
> to modify the DPDK code.
> 

Good change. DTS should not need to be patching DPDK code.

Series-Acked-by: Bruce Richardson <bruce.richardson@intel.com>

>  examples/l3fwd/l3fwd.h       | 4 ++++
>  examples/l3fwd/l3fwd_event.c | 2 --
>  examples/l3fwd/main.c        | 5 ++---
>  3 files changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/examples/l3fwd/l3fwd.h b/examples/l3fwd/l3fwd.h
> index 38ca19133c..4ccdb28b4a 100644
> --- a/examples/l3fwd/l3fwd.h
> +++ b/examples/l3fwd/l3fwd.h
> @@ -81,6 +81,10 @@ struct lcore_conf {
>  
>  extern volatile bool force_quit;
>  
> +/* RX and TX queue depths */
> +extern uint16_t nb_rxd;
> +extern uint16_t nb_txd;
> +
>  /* ethernet addresses of ports */
>  extern uint64_t dest_eth_addr[RTE_MAX_ETHPORTS];
>  extern struct rte_ether_addr ports_eth_addr[RTE_MAX_ETHPORTS];
> diff --git a/examples/l3fwd/l3fwd_event.c b/examples/l3fwd/l3fwd_event.c
> index dd9eafa9b9..7a401290f8 100644
> --- a/examples/l3fwd/l3fwd_event.c
> +++ b/examples/l3fwd/l3fwd_event.c
> @@ -43,8 +43,6 @@ l3fwd_eth_dev_port_setup(struct rte_eth_conf *port_conf)
>  {
>  	struct l3fwd_event_resources *evt_rsrc = l3fwd_get_eventdev_rsrc();
>  	uint16_t nb_ports = rte_eth_dev_count_avail();
> -	uint16_t nb_rxd = RTE_TEST_RX_DESC_DEFAULT;
> -	uint16_t nb_txd = RTE_TEST_TX_DESC_DEFAULT;
>  	unsigned int nb_lcores = rte_lcore_count();
>  	struct rte_eth_conf local_port_conf;
>  	struct rte_eth_dev_info dev_info;
> diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c
> index eb68ffc5aa..acd186ab7d 100644
> --- a/examples/l3fwd/main.c
> +++ b/examples/l3fwd/main.c
> @@ -53,9 +53,8 @@
>  
>  #define MAX_LCORE_PARAMS 1024
>  
> -/* Static global variables used within this file. */
> -static uint16_t nb_rxd = RTE_TEST_RX_DESC_DEFAULT;
> -static uint16_t nb_txd = RTE_TEST_TX_DESC_DEFAULT;
> +uint16_t nb_rxd = RTE_TEST_RX_DESC_DEFAULT;
> +uint16_t nb_txd = RTE_TEST_TX_DESC_DEFAULT;
>  
>  /**< Ports set in promiscuous mode off by default. */
>  static int promiscuous_on;
> -- 
> 2.25.1
> 

^ permalink raw reply	[flat|nested] 16+ messages in thread

* RE: [PATCH 2/2] examples/l3fwd: make RX and TX queue size configurable
  2022-02-02  6:04 ` [PATCH 2/2] examples/l3fwd: make RX and TX queue size configurable Honnappa Nagarahalli
@ 2022-02-08  7:41   ` Ruifeng Wang
  0 siblings, 0 replies; 16+ messages in thread
From: Ruifeng Wang @ 2022-02-08  7:41 UTC (permalink / raw)
  To: Honnappa Nagarahalli, dev, Honnappa Nagarahalli, lijuan.tu,
	juraj.linkes, ohilyard, david.marchand, thomas, jerinj
  Cc: Kathleen Capella, nd, nd

> -----Original Message-----
> From: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
> Sent: Wednesday, February 2, 2022 2:04 PM
> To: dev@dpdk.org; Honnappa Nagarahalli
> <Honnappa.Nagarahalli@arm.com>; lijuan.tu@intel.com;
> juraj.linkes@pantheon.tech; ohilyard@iol.unh.edu;
> david.marchand@redhat.com; thomas@monjalon.net; jerinj@marvell.com
> Cc: Kathleen Capella <Kathleen.Capella@arm.com>; nd <nd@arm.com>
> Subject: [PATCH 2/2] examples/l3fwd: make RX and TX queue size
> configurable
> 
> Make RX and TX queue sizes configurable from the command line.
> This helps DTS write better test cases.
> 
> Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
> ---
>  examples/l3fwd/main.c | 56
> ++++++++++++++++++++++++++++++++++++++++++-
>  1 file changed, 55 insertions(+), 1 deletion(-)
> 

<snip>
> 
> +static void
> +parse_rx_queue_size(const char *rx_queue_size_arg) {
> +	char *end = NULL;
> +	uint32_t rx_queue_size;
> +
> +	/* parse decimal string */
> +	rx_queue_size = strtoul(rx_queue_size_arg, &end, 10);
> +	if ((rx_queue_size_arg[0] == '\0') || (end == NULL) || (*end != '\0'))
> +		return;
> +
> +	if (rx_queue_size == 0)
> +		return;
> +
> +	nb_rxd = rx_queue_size;
> +}
> +
> +static void
> +parse_tx_queue_size(const char *tx_queue_size_arg) {
> +	char *end = NULL;
> +	uint32_t tx_queue_size;
> +
> +	/* parse decimal string */
> +	tx_queue_size = strtoul(tx_queue_size_arg, &end, 10);
> +	if ((tx_queue_size_arg[0] == '\0') || (end == NULL) || (*end != '\0'))
> +		return;
> +
> +	if (tx_queue_size == 0)
> +		return;
> +
> +	nb_rxd = tx_queue_size;

Typo. I assume here is 'nb_txd'.

> +}
> +
>  static void
>  parse_eventq_sched(const char *optarg)
>  {
> @@ -581,6 +621,8 @@ static const char short_options[] =
>  	;
> 
<snip>

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH v2 1/2] examples/l3fwd: use single set of variables throughout the code
  2022-02-02  6:04 [PATCH 1/2] examples/l3fwd: use single set of variables throughout the code Honnappa Nagarahalli
  2022-02-02  6:04 ` [PATCH 2/2] examples/l3fwd: make RX and TX queue size configurable Honnappa Nagarahalli
  2022-02-02  8:49 ` [PATCH 1/2] examples/l3fwd: use single set of variables throughout the code Bruce Richardson
@ 2022-02-11  0:26 ` Honnappa Nagarahalli
  2022-02-11  0:26   ` [PATCH v2 2/2] examples/l3fwd: make RX and TX queue size configurable Honnappa Nagarahalli
  2022-02-23  6:09 ` [PATCH v3 1/2] examples/l3fwd: use single set of variables throughout the code Honnappa Nagarahalli
  3 siblings, 1 reply; 16+ messages in thread
From: Honnappa Nagarahalli @ 2022-02-11  0:26 UTC (permalink / raw)
  To: dev, honnappa.nagarahalli, lijuan.tu, juraj.linkes, ohilyard,
	david.marchand, thomas, jerinj, bruce.richardson
  Cc: kathleen.capella, nd, Ruifeng Wang

nb_rxd and nb_txd are used in polling mode and event mode of
operation. nb_rxd and nb_txd are already global in polling mode
but are not visible to event mode code. Make them visible to all
parts of the application.

Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Kathleen Capella <kathleen.capella@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
DTS test cases require changing the RX and TX queue depths.
Currently, this is achieved by patching the DPDK code. This patch set
provides a mechanism to configure the queue depths while launching
the application. With this change DTS test cases do not need
to modify the DPDK code.

v2 - Fixed typo (Ruifeng) and adjusted the commit msg (Kathleen).

 examples/l3fwd/l3fwd.h       | 4 ++++
 examples/l3fwd/l3fwd_event.c | 2 --
 examples/l3fwd/main.c        | 5 ++---
 3 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/examples/l3fwd/l3fwd.h b/examples/l3fwd/l3fwd.h
index 38ca19133c..4ccdb28b4a 100644
--- a/examples/l3fwd/l3fwd.h
+++ b/examples/l3fwd/l3fwd.h
@@ -81,6 +81,10 @@ struct lcore_conf {
 
 extern volatile bool force_quit;
 
+/* RX and TX queue depths */
+extern uint16_t nb_rxd;
+extern uint16_t nb_txd;
+
 /* ethernet addresses of ports */
 extern uint64_t dest_eth_addr[RTE_MAX_ETHPORTS];
 extern struct rte_ether_addr ports_eth_addr[RTE_MAX_ETHPORTS];
diff --git a/examples/l3fwd/l3fwd_event.c b/examples/l3fwd/l3fwd_event.c
index dd9eafa9b9..7a401290f8 100644
--- a/examples/l3fwd/l3fwd_event.c
+++ b/examples/l3fwd/l3fwd_event.c
@@ -43,8 +43,6 @@ l3fwd_eth_dev_port_setup(struct rte_eth_conf *port_conf)
 {
 	struct l3fwd_event_resources *evt_rsrc = l3fwd_get_eventdev_rsrc();
 	uint16_t nb_ports = rte_eth_dev_count_avail();
-	uint16_t nb_rxd = RTE_TEST_RX_DESC_DEFAULT;
-	uint16_t nb_txd = RTE_TEST_TX_DESC_DEFAULT;
 	unsigned int nb_lcores = rte_lcore_count();
 	struct rte_eth_conf local_port_conf;
 	struct rte_eth_dev_info dev_info;
diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c
index eb68ffc5aa..acd186ab7d 100644
--- a/examples/l3fwd/main.c
+++ b/examples/l3fwd/main.c
@@ -53,9 +53,8 @@
 
 #define MAX_LCORE_PARAMS 1024
 
-/* Static global variables used within this file. */
-static uint16_t nb_rxd = RTE_TEST_RX_DESC_DEFAULT;
-static uint16_t nb_txd = RTE_TEST_TX_DESC_DEFAULT;
+uint16_t nb_rxd = RTE_TEST_RX_DESC_DEFAULT;
+uint16_t nb_txd = RTE_TEST_TX_DESC_DEFAULT;
 
 /**< Ports set in promiscuous mode off by default. */
 static int promiscuous_on;
-- 
2.25.1


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH v2 2/2] examples/l3fwd: make RX and TX queue size configurable
  2022-02-11  0:26 ` [PATCH v2 " Honnappa Nagarahalli
@ 2022-02-11  0:26   ` Honnappa Nagarahalli
  2022-02-11  0:53     ` Stephen Hemminger
  2022-02-11  1:01     ` Stephen Hemminger
  0 siblings, 2 replies; 16+ messages in thread
From: Honnappa Nagarahalli @ 2022-02-11  0:26 UTC (permalink / raw)
  To: dev, honnappa.nagarahalli, lijuan.tu, juraj.linkes, ohilyard,
	david.marchand, thomas, jerinj, bruce.richardson
  Cc: kathleen.capella, nd, Ruifeng Wang

Make RX and TX queue sizes configurable from the command line.
This helps DTS write better test cases.

Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Kathleen Capella <kathleen.capella@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
 examples/l3fwd/main.c | 56 ++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 55 insertions(+), 1 deletion(-)

diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c
index acd186ab7d..afe94cd1d7 100644
--- a/examples/l3fwd/main.c
+++ b/examples/l3fwd/main.c
@@ -341,6 +341,8 @@ print_usage(const char *prgname)
 		" [-P]"
 		" [--lookup]"
 		" --config (port,queue,lcore)[,(port,queue,lcore)]"
+		" [--rx-queue-size]"
+		" [--tx-queue-size]"
 		" [--eth-dest=X,MM:MM:MM:MM:MM:MM]"
 		" [--max-pkt-len PKTLEN]"
 		" [--no-numa]"
@@ -360,6 +362,10 @@ print_usage(const char *prgname)
 		"            Default: lpm\n"
 		"            Accepted: em (Exact Match), lpm (Longest Prefix Match), fib (Forwarding Information Base)\n"
 		"  --config (port,queue,lcore): Rx queue configuration\n"
+		"  --rx-queue-size: Rx queue size\n"
+		"            Default: %d\n"
+		"  --tx-queue-size: Tx queue size\n"
+		"            Default: %d\n"
 		"  --eth-dest=X,MM:MM:MM:MM:MM:MM: Ethernet destination for port X\n"
 		"  --max-pkt-len PKTLEN: maximum packet length in decimal (64-9600)\n"
 		"  --no-numa: Disable numa awareness\n"
@@ -381,7 +387,7 @@ print_usage(const char *prgname)
 		"  --event-vector-tmo: Max timeout to form vector in nanoseconds if event vectorization is enabled\n"
 		"  -E : Enable exact match, legacy flag please use --lookup=em instead\n"
 		"  -L : Enable longest prefix match, legacy flag please use --lookup=lpm instead\n\n",
-		prgname);
+		prgname, RTE_TEST_RX_DESC_DEFAULT, RTE_TEST_TX_DESC_DEFAULT);
 }
 
 static int
@@ -524,6 +530,40 @@ parse_mode(const char *optarg)
 		evt_rsrc->enabled = true;
 }
 
+static void
+parse_rx_queue_size(const char *rx_queue_size_arg)
+{
+	char *end = NULL;
+	uint32_t rx_queue_size;
+
+	/* parse decimal string */
+	rx_queue_size = strtoul(rx_queue_size_arg, &end, 10);
+	if ((rx_queue_size_arg[0] == '\0') || (end == NULL) || (*end != '\0'))
+		return;
+
+	if (rx_queue_size == 0)
+		return;
+
+	nb_rxd = rx_queue_size;
+}
+
+static void
+parse_tx_queue_size(const char *tx_queue_size_arg)
+{
+	char *end = NULL;
+	uint32_t tx_queue_size;
+
+	/* parse decimal string */
+	tx_queue_size = strtoul(tx_queue_size_arg, &end, 10);
+	if ((tx_queue_size_arg[0] == '\0') || (end == NULL) || (*end != '\0'))
+		return;
+
+	if (tx_queue_size == 0)
+		return;
+
+	nb_txd = tx_queue_size;
+}
+
 static void
 parse_eventq_sched(const char *optarg)
 {
@@ -581,6 +621,8 @@ static const char short_options[] =
 	;
 
 #define CMD_LINE_OPT_CONFIG "config"
+#define CMD_LINE_OPT_RX_QUEUE_SIZE "rx-queue-size"
+#define CMD_LINE_OPT_TX_QUEUE_SIZE "tx-queue-size"
 #define CMD_LINE_OPT_ETH_DEST "eth-dest"
 #define CMD_LINE_OPT_NO_NUMA "no-numa"
 #define CMD_LINE_OPT_IPV6 "ipv6"
@@ -603,6 +645,8 @@ enum {
 	 * conflict with short options */
 	CMD_LINE_OPT_MIN_NUM = 256,
 	CMD_LINE_OPT_CONFIG_NUM,
+	CMD_LINE_OPT_RX_QUEUE_SIZE_NUM,
+	CMD_LINE_OPT_TX_QUEUE_SIZE_NUM,
 	CMD_LINE_OPT_ETH_DEST_NUM,
 	CMD_LINE_OPT_NO_NUMA_NUM,
 	CMD_LINE_OPT_IPV6_NUM,
@@ -621,6 +665,8 @@ enum {
 
 static const struct option lgopts[] = {
 	{CMD_LINE_OPT_CONFIG, 1, 0, CMD_LINE_OPT_CONFIG_NUM},
+	{CMD_LINE_OPT_RX_QUEUE_SIZE, 1, 0, CMD_LINE_OPT_RX_QUEUE_SIZE_NUM},
+	{CMD_LINE_OPT_TX_QUEUE_SIZE, 1, 0, CMD_LINE_OPT_TX_QUEUE_SIZE_NUM},
 	{CMD_LINE_OPT_ETH_DEST, 1, 0, CMD_LINE_OPT_ETH_DEST_NUM},
 	{CMD_LINE_OPT_NO_NUMA, 0, 0, CMD_LINE_OPT_NO_NUMA_NUM},
 	{CMD_LINE_OPT_IPV6, 0, 0, CMD_LINE_OPT_IPV6_NUM},
@@ -714,6 +760,14 @@ parse_args(int argc, char **argv)
 			lcore_params = 1;
 			break;
 
+		case CMD_LINE_OPT_RX_QUEUE_SIZE_NUM:
+			parse_rx_queue_size(optarg);
+			break;
+
+		case CMD_LINE_OPT_TX_QUEUE_SIZE_NUM:
+			parse_tx_queue_size(optarg);
+			break;
+
 		case CMD_LINE_OPT_ETH_DEST_NUM:
 			parse_eth_dest(optarg);
 			break;
-- 
2.25.1


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH v2 2/2] examples/l3fwd: make RX and TX queue size configurable
  2022-02-11  0:26   ` [PATCH v2 2/2] examples/l3fwd: make RX and TX queue size configurable Honnappa Nagarahalli
@ 2022-02-11  0:53     ` Stephen Hemminger
  2022-02-11  3:43       ` Honnappa Nagarahalli
  2022-02-11  1:01     ` Stephen Hemminger
  1 sibling, 1 reply; 16+ messages in thread
From: Stephen Hemminger @ 2022-02-11  0:53 UTC (permalink / raw)
  To: Honnappa Nagarahalli
  Cc: dev, lijuan.tu, juraj.linkes, ohilyard, david.marchand, thomas,
	jerinj, bruce.richardson, kathleen.capella, nd, Ruifeng Wang

On Fri, 11 Feb 2022 00:26:07 +0000
Honnappa Nagarahalli <honnappa.nagarahalli@arm.com> wrote:

> diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c
> index acd186ab7d..afe94cd1d7 100644
> --- a/examples/l3fwd/main.c
> +++ b/examples/l3fwd/main.c
> @@ -341,6 +341,8 @@ print_usage(const char *prgname)
>  		" [-P]"
>  		" [--lookup]"
>  		" --config (port,queue,lcore)[,(port,queue,lcore)]"
> +		" [--rx-queue-size]"
> +		" [--tx-queue-size]"

Shouldn't there be a NPKTS after the arg?

                 " [--rx-queue-size NPKTS]"

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH v2 2/2] examples/l3fwd: make RX and TX queue size configurable
  2022-02-11  0:26   ` [PATCH v2 2/2] examples/l3fwd: make RX and TX queue size configurable Honnappa Nagarahalli
  2022-02-11  0:53     ` Stephen Hemminger
@ 2022-02-11  1:01     ` Stephen Hemminger
  2022-02-11  3:38       ` Honnappa Nagarahalli
  1 sibling, 1 reply; 16+ messages in thread
From: Stephen Hemminger @ 2022-02-11  1:01 UTC (permalink / raw)
  To: Honnappa Nagarahalli
  Cc: dev, lijuan.tu, juraj.linkes, ohilyard, david.marchand, thomas,
	jerinj, bruce.richardson, kathleen.capella, nd, Ruifeng Wang

On Fri, 11 Feb 2022 00:26:07 +0000
Honnappa Nagarahalli <honnappa.nagarahalli@arm.com> wrote:

> +static void
> +parse_rx_queue_size(const char *rx_queue_size_arg)
> +{
> +	char *end = NULL;
> +	uint32_t rx_queue_size;
> +
> +	/* parse decimal string */
> +	rx_queue_size = strtoul(rx_queue_size_arg, &end, 10);
> +	if ((rx_queue_size_arg[0] == '\0') || (end == NULL) || (*end != '\0'))
> +		return;
> +
> +	if (rx_queue_size == 0)
> +		return;
> +
> +	nb_rxd = rx_queue_size;
> +}
> +
> +static void
> +parse_tx_queue_size(const char *tx_queue_size_arg)
> +{
> +	char *end = NULL;
> +	uint32_t tx_queue_size;
> +
> +	/* parse decimal string */
> +	tx_queue_size = strtoul(tx_queue_size_arg, &end, 10);
> +	if ((tx_queue_size_arg[0] == '\0') || (end == NULL) || (*end != '\0'))
> +		return;
> +
> +	if (tx_queue_size == 0)
> +		return;
> +
> +	nb_txd = tx_queue_size;

These are duplications of the same function, just different result.
Also programs should test for invalid queue size which is currently
limited to 16 bits by rte_eth_dev_configure

static void
parse_queue_size(const char *size_arg, uint32_t *size_ret)
{
	unsigned long result;
	char *end;

	result = strtoul(size_arg, &end, 0);
	if (size_arg[0] == '\0' || *end != '\0' || result > UINT16_MAX)
		rte_exit(EXIT_FAILURE, "Invalid queue size '%s'\n", size_arg);
	*size_ret = result;
}

^ permalink raw reply	[flat|nested] 16+ messages in thread

* RE: [PATCH v2 2/2] examples/l3fwd: make RX and TX queue size configurable
  2022-02-11  1:01     ` Stephen Hemminger
@ 2022-02-11  3:38       ` Honnappa Nagarahalli
  0 siblings, 0 replies; 16+ messages in thread
From: Honnappa Nagarahalli @ 2022-02-11  3:38 UTC (permalink / raw)
  To: Stephen Hemminger
  Cc: dev, lijuan.tu, juraj.linkes, ohilyard, david.marchand, thomas,
	jerinj, bruce.richardson, Kathleen Capella, nd, Ruifeng Wang, nd

<snip>

> 
> On Fri, 11 Feb 2022 00:26:07 +0000
> Honnappa Nagarahalli <honnappa.nagarahalli@arm.com> wrote:
> 
> > +static void
> > +parse_rx_queue_size(const char *rx_queue_size_arg) {
> > +	char *end = NULL;
> > +	uint32_t rx_queue_size;
> > +
> > +	/* parse decimal string */
> > +	rx_queue_size = strtoul(rx_queue_size_arg, &end, 10);
> > +	if ((rx_queue_size_arg[0] == '\0') || (end == NULL) || (*end != '\0'))
> > +		return;
> > +
> > +	if (rx_queue_size == 0)
> > +		return;
> > +
> > +	nb_rxd = rx_queue_size;
> > +}
> > +
> > +static void
> > +parse_tx_queue_size(const char *tx_queue_size_arg) {
> > +	char *end = NULL;
> > +	uint32_t tx_queue_size;
> > +
> > +	/* parse decimal string */
> > +	tx_queue_size = strtoul(tx_queue_size_arg, &end, 10);
> > +	if ((tx_queue_size_arg[0] == '\0') || (end == NULL) || (*end != '\0'))
> > +		return;
> > +
> > +	if (tx_queue_size == 0)
> > +		return;
> > +
> > +	nb_txd = tx_queue_size;
> 
> These are duplications of the same function, just different result.
Agreed, make sense to combine

> Also programs should test for invalid queue size which is currently limited to 16
> bits by rte_eth_dev_configure
> 
> static void
> parse_queue_size(const char *size_arg, uint32_t *size_ret) {
> 	unsigned long result;
> 	char *end;
> 
> 	result = strtoul(size_arg, &end, 0);
> 	if (size_arg[0] == '\0' || *end != '\0' || result > UINT16_MAX)
> 		rte_exit(EXIT_FAILURE, "Invalid queue size '%s'\n", size_arg);
> 	*size_ret = result;
> }

^ permalink raw reply	[flat|nested] 16+ messages in thread

* RE: [PATCH v2 2/2] examples/l3fwd: make RX and TX queue size configurable
  2022-02-11  0:53     ` Stephen Hemminger
@ 2022-02-11  3:43       ` Honnappa Nagarahalli
  0 siblings, 0 replies; 16+ messages in thread
From: Honnappa Nagarahalli @ 2022-02-11  3:43 UTC (permalink / raw)
  To: Stephen Hemminger
  Cc: dev, lijuan.tu, juraj.linkes, ohilyard, david.marchand, thomas,
	jerinj, bruce.richardson, Kathleen Capella, nd, Ruifeng Wang, nd

<snip>

> 
> On Fri, 11 Feb 2022 00:26:07 +0000
> Honnappa Nagarahalli <honnappa.nagarahalli@arm.com> wrote:
> 
> > diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c index
> > acd186ab7d..afe94cd1d7 100644
> > --- a/examples/l3fwd/main.c
> > +++ b/examples/l3fwd/main.c
> > @@ -341,6 +341,8 @@ print_usage(const char *prgname)
> >  		" [-P]"
> >  		" [--lookup]"
> >  		" --config (port,queue,lcore)[,(port,queue,lcore)]"
> > +		" [--rx-queue-size]"
> > +		" [--tx-queue-size]"
> 
> Shouldn't there be a NPKTS after the arg?
I guess it does not harm, makes it consistent with other options, though I don't see much value.

> 
>                  " [--rx-queue-size NPKTS]"

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH v3 1/2] examples/l3fwd: use single set of variables throughout the code
  2022-02-02  6:04 [PATCH 1/2] examples/l3fwd: use single set of variables throughout the code Honnappa Nagarahalli
                   ` (2 preceding siblings ...)
  2022-02-11  0:26 ` [PATCH v2 " Honnappa Nagarahalli
@ 2022-02-23  6:09 ` Honnappa Nagarahalli
  2022-02-23  6:09   ` [PATCH v3 2/2] examples/l3fwd: make RX and TX queue size configurable Honnappa Nagarahalli
                     ` (2 more replies)
  3 siblings, 3 replies; 16+ messages in thread
From: Honnappa Nagarahalli @ 2022-02-23  6:09 UTC (permalink / raw)
  To: dev, honnappa.nagarahalli, lijuan.tu, juraj.linkes, ohilyard,
	david.marchand, thomas, jerinj, bruce.richardson, stephen, bluca,
	ktraynor, christian.ehrhardt, xuemingl
  Cc: kathleen.capella, nd, Ruifeng Wang

nb_rxd and nb_txd are used in polling mode and event mode of
operation. nb_rxd and nb_txd are already global in polling mode
but are not visible to event mode code. Make them visible to all
parts of the application.

Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Kathleen Capella <kathleen.capella@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
DTS test cases require changing the RX and TX queue depths.
Currently, this is achieved by patching the DPDK code. This patch set
provides a mechanism to configure the queue depths while launching
the application. With this change DTS test cases do not need
to modify the DPDK code.

v2 - Single parse function, additional validation on input (Stephen)

v2 - Fixed typo (Ruifeng) and adjusted the commit msg (Kathleen).

 examples/l3fwd/l3fwd.h       | 4 ++++
 examples/l3fwd/l3fwd_event.c | 2 --
 examples/l3fwd/main.c        | 5 ++---
 3 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/examples/l3fwd/l3fwd.h b/examples/l3fwd/l3fwd.h
index 38ca19133c..4ccdb28b4a 100644
--- a/examples/l3fwd/l3fwd.h
+++ b/examples/l3fwd/l3fwd.h
@@ -81,6 +81,10 @@ struct lcore_conf {
 
 extern volatile bool force_quit;
 
+/* RX and TX queue depths */
+extern uint16_t nb_rxd;
+extern uint16_t nb_txd;
+
 /* ethernet addresses of ports */
 extern uint64_t dest_eth_addr[RTE_MAX_ETHPORTS];
 extern struct rte_ether_addr ports_eth_addr[RTE_MAX_ETHPORTS];
diff --git a/examples/l3fwd/l3fwd_event.c b/examples/l3fwd/l3fwd_event.c
index dd9eafa9b9..7a401290f8 100644
--- a/examples/l3fwd/l3fwd_event.c
+++ b/examples/l3fwd/l3fwd_event.c
@@ -43,8 +43,6 @@ l3fwd_eth_dev_port_setup(struct rte_eth_conf *port_conf)
 {
 	struct l3fwd_event_resources *evt_rsrc = l3fwd_get_eventdev_rsrc();
 	uint16_t nb_ports = rte_eth_dev_count_avail();
-	uint16_t nb_rxd = RTE_TEST_RX_DESC_DEFAULT;
-	uint16_t nb_txd = RTE_TEST_TX_DESC_DEFAULT;
 	unsigned int nb_lcores = rte_lcore_count();
 	struct rte_eth_conf local_port_conf;
 	struct rte_eth_dev_info dev_info;
diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c
index eb68ffc5aa..acd186ab7d 100644
--- a/examples/l3fwd/main.c
+++ b/examples/l3fwd/main.c
@@ -53,9 +53,8 @@
 
 #define MAX_LCORE_PARAMS 1024
 
-/* Static global variables used within this file. */
-static uint16_t nb_rxd = RTE_TEST_RX_DESC_DEFAULT;
-static uint16_t nb_txd = RTE_TEST_TX_DESC_DEFAULT;
+uint16_t nb_rxd = RTE_TEST_RX_DESC_DEFAULT;
+uint16_t nb_txd = RTE_TEST_TX_DESC_DEFAULT;
 
 /**< Ports set in promiscuous mode off by default. */
 static int promiscuous_on;
-- 
2.25.1


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH v3 2/2] examples/l3fwd: make RX and TX queue size configurable
  2022-02-23  6:09 ` [PATCH v3 1/2] examples/l3fwd: use single set of variables throughout the code Honnappa Nagarahalli
@ 2022-02-23  6:09   ` Honnappa Nagarahalli
  2022-02-23  6:13   ` [PATCH v3 1/2] examples/l3fwd: use single set of variables throughout the code Honnappa Nagarahalli
  2022-03-01  1:56   ` Han, YingyaX
  2 siblings, 0 replies; 16+ messages in thread
From: Honnappa Nagarahalli @ 2022-02-23  6:09 UTC (permalink / raw)
  To: dev, honnappa.nagarahalli, lijuan.tu, juraj.linkes, ohilyard,
	david.marchand, thomas, jerinj, bruce.richardson, stephen, bluca,
	ktraynor, christian.ehrhardt, xuemingl
  Cc: kathleen.capella, nd, Ruifeng Wang

Make RX and TX queue sizes configurable from the command line.
This helps DTS write better test cases.

Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Kathleen Capella <kathleen.capella@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
 examples/l3fwd/main.c | 54 ++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 53 insertions(+), 1 deletion(-)

diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c
index acd186ab7d..3a0e15109b 100644
--- a/examples/l3fwd/main.c
+++ b/examples/l3fwd/main.c
@@ -341,6 +341,8 @@ print_usage(const char *prgname)
 		" [-P]"
 		" [--lookup]"
 		" --config (port,queue,lcore)[,(port,queue,lcore)]"
+		" [--rx-queue-size NPKTS]"
+		" [--tx-queue-size NPKTS]"
 		" [--eth-dest=X,MM:MM:MM:MM:MM:MM]"
 		" [--max-pkt-len PKTLEN]"
 		" [--no-numa]"
@@ -360,6 +362,10 @@ print_usage(const char *prgname)
 		"            Default: lpm\n"
 		"            Accepted: em (Exact Match), lpm (Longest Prefix Match), fib (Forwarding Information Base)\n"
 		"  --config (port,queue,lcore): Rx queue configuration\n"
+		"  --rx-queue-size NPKTS: Rx queue size in decimal\n"
+		"            Default: %d\n"
+		"  --tx-queue-size NPKTS: Tx queue size in decimal\n"
+		"            Default: %d\n"
 		"  --eth-dest=X,MM:MM:MM:MM:MM:MM: Ethernet destination for port X\n"
 		"  --max-pkt-len PKTLEN: maximum packet length in decimal (64-9600)\n"
 		"  --no-numa: Disable numa awareness\n"
@@ -381,7 +387,7 @@ print_usage(const char *prgname)
 		"  --event-vector-tmo: Max timeout to form vector in nanoseconds if event vectorization is enabled\n"
 		"  -E : Enable exact match, legacy flag please use --lookup=em instead\n"
 		"  -L : Enable longest prefix match, legacy flag please use --lookup=lpm instead\n\n",
-		prgname);
+		prgname, RTE_TEST_RX_DESC_DEFAULT, RTE_TEST_TX_DESC_DEFAULT);
 }
 
 static int
@@ -524,6 +530,38 @@ parse_mode(const char *optarg)
 		evt_rsrc->enabled = true;
 }
 
+static void
+parse_queue_size(const char *queue_size_arg, uint16_t *queue_size, int rx)
+{
+	char *end = NULL;
+	unsigned long value;
+
+	/* parse decimal string */
+	value = strtoul(queue_size_arg, &end, 10);
+	if ((queue_size_arg[0] == '\0') || (end == NULL) ||
+		(*end != '\0') || (value == 0)) {
+		if (rx == 1)
+			rte_exit(EXIT_FAILURE, "Invalid rx-queue-size\n");
+		else
+			rte_exit(EXIT_FAILURE, "Invalid tx-queue-size\n");
+
+		return;
+	}
+
+	if (value > UINT16_MAX) {
+		if (rx == 1)
+			rte_exit(EXIT_FAILURE, "rx-queue-size %lu > %d\n",
+				value, UINT16_MAX);
+		else
+			rte_exit(EXIT_FAILURE, "tx-queue-size %lu > %d\n",
+				value, UINT16_MAX);
+
+		return;
+	}
+
+	*queue_size = value;
+}
+
 static void
 parse_eventq_sched(const char *optarg)
 {
@@ -581,6 +619,8 @@ static const char short_options[] =
 	;
 
 #define CMD_LINE_OPT_CONFIG "config"
+#define CMD_LINE_OPT_RX_QUEUE_SIZE "rx-queue-size"
+#define CMD_LINE_OPT_TX_QUEUE_SIZE "tx-queue-size"
 #define CMD_LINE_OPT_ETH_DEST "eth-dest"
 #define CMD_LINE_OPT_NO_NUMA "no-numa"
 #define CMD_LINE_OPT_IPV6 "ipv6"
@@ -603,6 +643,8 @@ enum {
 	 * conflict with short options */
 	CMD_LINE_OPT_MIN_NUM = 256,
 	CMD_LINE_OPT_CONFIG_NUM,
+	CMD_LINE_OPT_RX_QUEUE_SIZE_NUM,
+	CMD_LINE_OPT_TX_QUEUE_SIZE_NUM,
 	CMD_LINE_OPT_ETH_DEST_NUM,
 	CMD_LINE_OPT_NO_NUMA_NUM,
 	CMD_LINE_OPT_IPV6_NUM,
@@ -621,6 +663,8 @@ enum {
 
 static const struct option lgopts[] = {
 	{CMD_LINE_OPT_CONFIG, 1, 0, CMD_LINE_OPT_CONFIG_NUM},
+	{CMD_LINE_OPT_RX_QUEUE_SIZE, 1, 0, CMD_LINE_OPT_RX_QUEUE_SIZE_NUM},
+	{CMD_LINE_OPT_TX_QUEUE_SIZE, 1, 0, CMD_LINE_OPT_TX_QUEUE_SIZE_NUM},
 	{CMD_LINE_OPT_ETH_DEST, 1, 0, CMD_LINE_OPT_ETH_DEST_NUM},
 	{CMD_LINE_OPT_NO_NUMA, 0, 0, CMD_LINE_OPT_NO_NUMA_NUM},
 	{CMD_LINE_OPT_IPV6, 0, 0, CMD_LINE_OPT_IPV6_NUM},
@@ -714,6 +758,14 @@ parse_args(int argc, char **argv)
 			lcore_params = 1;
 			break;
 
+		case CMD_LINE_OPT_RX_QUEUE_SIZE_NUM:
+			parse_queue_size(optarg, &nb_rxd, 1);
+			break;
+
+		case CMD_LINE_OPT_TX_QUEUE_SIZE_NUM:
+			parse_queue_size(optarg, &nb_txd, 0);
+			break;
+
 		case CMD_LINE_OPT_ETH_DEST_NUM:
 			parse_eth_dest(optarg);
 			break;
-- 
2.25.1


^ permalink raw reply	[flat|nested] 16+ messages in thread

* RE: [PATCH v3 1/2] examples/l3fwd: use single set of variables throughout the code
  2022-02-23  6:09 ` [PATCH v3 1/2] examples/l3fwd: use single set of variables throughout the code Honnappa Nagarahalli
  2022-02-23  6:09   ` [PATCH v3 2/2] examples/l3fwd: make RX and TX queue size configurable Honnappa Nagarahalli
@ 2022-02-23  6:13   ` Honnappa Nagarahalli
  2022-02-23  9:22     ` Kevin Traynor
  2022-03-01  1:56   ` Han, YingyaX
  2 siblings, 1 reply; 16+ messages in thread
From: Honnappa Nagarahalli @ 2022-02-23  6:13 UTC (permalink / raw)
  To: Honnappa Nagarahalli, dev, lijuan.tu, juraj.linkes, ohilyard,
	david.marchand, thomas, jerinj, bruce.richardson, stephen, bluca,
	ktraynor, christian.ehrhardt, xuemingl, stable
  Cc: Kathleen Capella, nd, Ruifeng Wang, nd

Question for stable maintainers. 

DTS WG would like this patch to be merged in 21.11 and 20.11 stable releases even though it is not a bug fix. This allows for a single DTS version to be used with both those stable releases and master.

Do you have any objections?

Thank you,
Honnappa


> -----Original Message-----
> From: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
> Sent: Wednesday, February 23, 2022 12:10 AM
> To: dev@dpdk.org; Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>;
> lijuan.tu@intel.com; juraj.linkes@pantheon.tech; ohilyard@iol.unh.edu;
> david.marchand@redhat.com; thomas@monjalon.net; jerinj@marvell.com;
> bruce.richardson@intel.com; stephen@networkplumber.org;
> bluca@debian.org; ktraynor@redhat.com; christian.ehrhardt@canonical.com;
> xuemingl@nvidia.com
> Cc: Kathleen Capella <Kathleen.Capella@arm.com>; nd <nd@arm.com>;
> Ruifeng Wang <Ruifeng.Wang@arm.com>
> Subject: [PATCH v3 1/2] examples/l3fwd: use single set of variables throughout
> the code
> 
> nb_rxd and nb_txd are used in polling mode and event mode of operation.
> nb_rxd and nb_txd are already global in polling mode but are not visible to
> event mode code. Make them visible to all parts of the application.
> 
> Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
> Reviewed-by: Kathleen Capella <kathleen.capella@arm.com>
> Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
> ---
> DTS test cases require changing the RX and TX queue depths.
> Currently, this is achieved by patching the DPDK code. This patch set provides a
> mechanism to configure the queue depths while launching the application. With
> this change DTS test cases do not need to modify the DPDK code.
> 
> v2 - Single parse function, additional validation on input (Stephen)
> 
> v2 - Fixed typo (Ruifeng) and adjusted the commit msg (Kathleen).
> 
>  examples/l3fwd/l3fwd.h       | 4 ++++
>  examples/l3fwd/l3fwd_event.c | 2 --
>  examples/l3fwd/main.c        | 5 ++---
>  3 files changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/examples/l3fwd/l3fwd.h b/examples/l3fwd/l3fwd.h index
> 38ca19133c..4ccdb28b4a 100644
> --- a/examples/l3fwd/l3fwd.h
> +++ b/examples/l3fwd/l3fwd.h
> @@ -81,6 +81,10 @@ struct lcore_conf {
> 
>  extern volatile bool force_quit;
> 
> +/* RX and TX queue depths */
> +extern uint16_t nb_rxd;
> +extern uint16_t nb_txd;
> +
>  /* ethernet addresses of ports */
>  extern uint64_t dest_eth_addr[RTE_MAX_ETHPORTS];  extern struct
> rte_ether_addr ports_eth_addr[RTE_MAX_ETHPORTS]; diff --git
> a/examples/l3fwd/l3fwd_event.c b/examples/l3fwd/l3fwd_event.c index
> dd9eafa9b9..7a401290f8 100644
> --- a/examples/l3fwd/l3fwd_event.c
> +++ b/examples/l3fwd/l3fwd_event.c
> @@ -43,8 +43,6 @@ l3fwd_eth_dev_port_setup(struct rte_eth_conf
> *port_conf)  {
>  	struct l3fwd_event_resources *evt_rsrc = l3fwd_get_eventdev_rsrc();
>  	uint16_t nb_ports = rte_eth_dev_count_avail();
> -	uint16_t nb_rxd = RTE_TEST_RX_DESC_DEFAULT;
> -	uint16_t nb_txd = RTE_TEST_TX_DESC_DEFAULT;
>  	unsigned int nb_lcores = rte_lcore_count();
>  	struct rte_eth_conf local_port_conf;
>  	struct rte_eth_dev_info dev_info;
> diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c index
> eb68ffc5aa..acd186ab7d 100644
> --- a/examples/l3fwd/main.c
> +++ b/examples/l3fwd/main.c
> @@ -53,9 +53,8 @@
> 
>  #define MAX_LCORE_PARAMS 1024
> 
> -/* Static global variables used within this file. */ -static uint16_t nb_rxd =
> RTE_TEST_RX_DESC_DEFAULT; -static uint16_t nb_txd =
> RTE_TEST_TX_DESC_DEFAULT;
> +uint16_t nb_rxd = RTE_TEST_RX_DESC_DEFAULT; uint16_t nb_txd =
> +RTE_TEST_TX_DESC_DEFAULT;
> 
>  /**< Ports set in promiscuous mode off by default. */  static int
> promiscuous_on;
> --
> 2.25.1


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH v3 1/2] examples/l3fwd: use single set of variables throughout the code
  2022-02-23  6:13   ` [PATCH v3 1/2] examples/l3fwd: use single set of variables throughout the code Honnappa Nagarahalli
@ 2022-02-23  9:22     ` Kevin Traynor
  0 siblings, 0 replies; 16+ messages in thread
From: Kevin Traynor @ 2022-02-23  9:22 UTC (permalink / raw)
  To: Honnappa Nagarahalli, dev, lijuan.tu, juraj.linkes, ohilyard,
	david.marchand, thomas, jerinj, bruce.richardson, stephen, bluca,
	christian.ehrhardt, xuemingl, stable
  Cc: Kathleen Capella, nd, Ruifeng Wang

Hi Honnappa,

On 23/02/2022 06:13, Honnappa Nagarahalli wrote:
> Question for stable maintainers.
> 
> DTS WG would like this patch to be merged in 21.11 and 20.11 stable releases even though it is not a bug fix. This allows for a single DTS version to be used with both those stable releases and master.
> 
> Do you have any objections?
> 

No objection for 21.11. It is example code and just a minor addition 
that is not changing defaults. Please add the stable tag in the commit 
message on merge (or next rev) so it will be found by our scripts.

thanks,
Kevin.

> Thank you,
> Honnappa
> 
> 
>> -----Original Message-----
>> From: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
>> Sent: Wednesday, February 23, 2022 12:10 AM
>> To: dev@dpdk.org; Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>;
>> lijuan.tu@intel.com; juraj.linkes@pantheon.tech; ohilyard@iol.unh.edu;
>> david.marchand@redhat.com; thomas@monjalon.net; jerinj@marvell.com;
>> bruce.richardson@intel.com; stephen@networkplumber.org;
>> bluca@debian.org; ktraynor@redhat.com; christian.ehrhardt@canonical.com;
>> xuemingl@nvidia.com
>> Cc: Kathleen Capella <Kathleen.Capella@arm.com>; nd <nd@arm.com>;
>> Ruifeng Wang <Ruifeng.Wang@arm.com>
>> Subject: [PATCH v3 1/2] examples/l3fwd: use single set of variables throughout
>> the code
>>
>> nb_rxd and nb_txd are used in polling mode and event mode of operation.
>> nb_rxd and nb_txd are already global in polling mode but are not visible to
>> event mode code. Make them visible to all parts of the application.
>>
>> Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
>> Reviewed-by: Kathleen Capella <kathleen.capella@arm.com>
>> Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
>> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
>> ---
>> DTS test cases require changing the RX and TX queue depths.
>> Currently, this is achieved by patching the DPDK code. This patch set provides a
>> mechanism to configure the queue depths while launching the application. With
>> this change DTS test cases do not need to modify the DPDK code.
>>
>> v2 - Single parse function, additional validation on input (Stephen)
>>
>> v2 - Fixed typo (Ruifeng) and adjusted the commit msg (Kathleen).
>>
>>   examples/l3fwd/l3fwd.h       | 4 ++++
>>   examples/l3fwd/l3fwd_event.c | 2 --
>>   examples/l3fwd/main.c        | 5 ++---
>>   3 files changed, 6 insertions(+), 5 deletions(-)
>>
>> diff --git a/examples/l3fwd/l3fwd.h b/examples/l3fwd/l3fwd.h index
>> 38ca19133c..4ccdb28b4a 100644
>> --- a/examples/l3fwd/l3fwd.h
>> +++ b/examples/l3fwd/l3fwd.h
>> @@ -81,6 +81,10 @@ struct lcore_conf {
>>
>>   extern volatile bool force_quit;
>>
>> +/* RX and TX queue depths */
>> +extern uint16_t nb_rxd;
>> +extern uint16_t nb_txd;
>> +
>>   /* ethernet addresses of ports */
>>   extern uint64_t dest_eth_addr[RTE_MAX_ETHPORTS];  extern struct
>> rte_ether_addr ports_eth_addr[RTE_MAX_ETHPORTS]; diff --git
>> a/examples/l3fwd/l3fwd_event.c b/examples/l3fwd/l3fwd_event.c index
>> dd9eafa9b9..7a401290f8 100644
>> --- a/examples/l3fwd/l3fwd_event.c
>> +++ b/examples/l3fwd/l3fwd_event.c
>> @@ -43,8 +43,6 @@ l3fwd_eth_dev_port_setup(struct rte_eth_conf
>> *port_conf)  {
>>   	struct l3fwd_event_resources *evt_rsrc = l3fwd_get_eventdev_rsrc();
>>   	uint16_t nb_ports = rte_eth_dev_count_avail();
>> -	uint16_t nb_rxd = RTE_TEST_RX_DESC_DEFAULT;
>> -	uint16_t nb_txd = RTE_TEST_TX_DESC_DEFAULT;
>>   	unsigned int nb_lcores = rte_lcore_count();
>>   	struct rte_eth_conf local_port_conf;
>>   	struct rte_eth_dev_info dev_info;
>> diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c index
>> eb68ffc5aa..acd186ab7d 100644
>> --- a/examples/l3fwd/main.c
>> +++ b/examples/l3fwd/main.c
>> @@ -53,9 +53,8 @@
>>
>>   #define MAX_LCORE_PARAMS 1024
>>
>> -/* Static global variables used within this file. */ -static uint16_t nb_rxd =
>> RTE_TEST_RX_DESC_DEFAULT; -static uint16_t nb_txd =
>> RTE_TEST_TX_DESC_DEFAULT;
>> +uint16_t nb_rxd = RTE_TEST_RX_DESC_DEFAULT; uint16_t nb_txd =
>> +RTE_TEST_TX_DESC_DEFAULT;
>>
>>   /**< Ports set in promiscuous mode off by default. */  static int
>> promiscuous_on;
>> --
>> 2.25.1
> 


^ permalink raw reply	[flat|nested] 16+ messages in thread

* RE: [PATCH v3 1/2] examples/l3fwd: use single set of variables throughout the code
  2022-02-23  6:09 ` [PATCH v3 1/2] examples/l3fwd: use single set of variables throughout the code Honnappa Nagarahalli
  2022-02-23  6:09   ` [PATCH v3 2/2] examples/l3fwd: make RX and TX queue size configurable Honnappa Nagarahalli
  2022-02-23  6:13   ` [PATCH v3 1/2] examples/l3fwd: use single set of variables throughout the code Honnappa Nagarahalli
@ 2022-03-01  1:56   ` Han, YingyaX
  2022-03-08  9:22     ` Thomas Monjalon
  2 siblings, 1 reply; 16+ messages in thread
From: Han, YingyaX @ 2022-03-01  1:56 UTC (permalink / raw)
  To: Honnappa Nagarahalli, dev, Tu, Lijuan, juraj.linkes, ohilyard,
	david.marchand, thomas, jerinj, Richardson, Bruce, stephen,
	bluca, ktraynor, christian.ehrhardt, xuemingl
  Cc: kathleen.capella, nd, Ruifeng Wang



-----Original Message-----
From: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com> 
Sent: Wednesday, February 23, 2022 2:10 PM
To: dev@dpdk.org; honnappa.nagarahalli@arm.com; Tu, Lijuan <lijuan.tu@intel.com>; juraj.linkes@pantheon.tech; ohilyard@iol.unh.edu; david.marchand@redhat.com; thomas@monjalon.net; jerinj@marvell.com; Richardson, Bruce <bruce.richardson@intel.com>; stephen@networkplumber.org; bluca@debian.org; ktraynor@redhat.com; christian.ehrhardt@canonical.com; xuemingl@nvidia.com
Cc: kathleen.capella@arm.com; nd@arm.com; Ruifeng Wang <ruifeng.wang@arm.com>
Subject: [PATCH v3 1/2] examples/l3fwd: use single set of variables throughout the code

nb_rxd and nb_txd are used in polling mode and event mode of operation. nb_rxd and nb_txd are already global in polling mode but are not visible to event mode code. Make them visible to all parts of the application.

Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Kathleen Capella <kathleen.capella@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>

Tested-by: Yingya Han < yingyax.han@intel.com>

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH v3 1/2] examples/l3fwd: use single set of variables throughout the code
  2022-03-01  1:56   ` Han, YingyaX
@ 2022-03-08  9:22     ` Thomas Monjalon
  0 siblings, 0 replies; 16+ messages in thread
From: Thomas Monjalon @ 2022-03-08  9:22 UTC (permalink / raw)
  To: Honnappa Nagarahalli, Tu, Lijuan, juraj.linkes, ohilyard,
	david.marchand, jerinj, Richardson, Bruce, stephen, bluca,
	ktraynor, christian.ehrhardt, xuemingl
  Cc: dev, kathleen.capella, nd, Ruifeng Wang, Han, YingyaX

> nb_rxd and nb_txd are used in polling mode and event mode of operation. nb_rxd and nb_txd are already global in polling mode but are not visible to event mode code. Make them visible to all parts of the application.
> 
> Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
> Reviewed-by: Kathleen Capella <kathleen.capella@arm.com>
> Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
> 
> Tested-by: Yingya Han < yingyax.han@intel.com>

Applied, thanks.



^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2022-03-08  9:22 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-02  6:04 [PATCH 1/2] examples/l3fwd: use single set of variables throughout the code Honnappa Nagarahalli
2022-02-02  6:04 ` [PATCH 2/2] examples/l3fwd: make RX and TX queue size configurable Honnappa Nagarahalli
2022-02-08  7:41   ` Ruifeng Wang
2022-02-02  8:49 ` [PATCH 1/2] examples/l3fwd: use single set of variables throughout the code Bruce Richardson
2022-02-11  0:26 ` [PATCH v2 " Honnappa Nagarahalli
2022-02-11  0:26   ` [PATCH v2 2/2] examples/l3fwd: make RX and TX queue size configurable Honnappa Nagarahalli
2022-02-11  0:53     ` Stephen Hemminger
2022-02-11  3:43       ` Honnappa Nagarahalli
2022-02-11  1:01     ` Stephen Hemminger
2022-02-11  3:38       ` Honnappa Nagarahalli
2022-02-23  6:09 ` [PATCH v3 1/2] examples/l3fwd: use single set of variables throughout the code Honnappa Nagarahalli
2022-02-23  6:09   ` [PATCH v3 2/2] examples/l3fwd: make RX and TX queue size configurable Honnappa Nagarahalli
2022-02-23  6:13   ` [PATCH v3 1/2] examples/l3fwd: use single set of variables throughout the code Honnappa Nagarahalli
2022-02-23  9:22     ` Kevin Traynor
2022-03-01  1:56   ` Han, YingyaX
2022-03-08  9:22     ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).