DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 1/2] examples/l3fwd: set default schedule type as atomic
@ 2020-01-06  4:34 Nipun Gupta
  2020-01-06  4:34 ` [dpdk-dev] [PATCH 2/2] examples/l3fwd: support multiple queues in event mode Nipun Gupta
  2020-01-07 12:22 ` [dpdk-dev] [PATCH 1/2 v2] examples/l3fwd: set default schedule type as atomic Nipun Gupta
  0 siblings, 2 replies; 6+ messages in thread
From: Nipun Gupta @ 2020-01-06  4:34 UTC (permalink / raw)
  To: dev
  Cc: pbhagavatula, jerinj, hemant.agrawal, akhil.goyal,
	marko.kovacevic, orika, bruce.richardson, radu.nicolau,
	tomasz.kantecki, skori, Nipun Gupta

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>

---
These patches are based over https://patchwork.dpdk.org/patch/63553/.
Feel free to merge into the series.

 examples/l3fwd/l3fwd_event.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/examples/l3fwd/l3fwd_event.h b/examples/l3fwd/l3fwd_event.h
index fcc0ce51a..470aedc61 100644
--- a/examples/l3fwd/l3fwd_event.h
+++ b/examples/l3fwd/l3fwd_event.h
@@ -100,7 +100,11 @@ l3fwd_get_eventdev_rsrc(void)
 	mz = rte_memzone_reserve(name, sizeof(struct l3fwd_event_resources),
 				 0, 0);
 	if (mz != NULL) {
+		struct l3fwd_event_resources *rsrc = mz->addr;
+
 		memset(mz->addr, 0, sizeof(struct l3fwd_event_resources));
+		rsrc->sched_type = RTE_SCHED_TYPE_ATOMIC;
+
 		return mz->addr;
 	}
 
-- 
2.17.1


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

* [dpdk-dev] [PATCH 2/2] examples/l3fwd: support multiple queues in event mode
  2020-01-06  4:34 [dpdk-dev] [PATCH 1/2] examples/l3fwd: set default schedule type as atomic Nipun Gupta
@ 2020-01-06  4:34 ` Nipun Gupta
  2020-01-06  6:09   ` [dpdk-dev] [EXT] " Sunil Kumar Kori
  2020-01-07 12:22 ` [dpdk-dev] [PATCH 1/2 v2] examples/l3fwd: set default schedule type as atomic Nipun Gupta
  1 sibling, 1 reply; 6+ messages in thread
From: Nipun Gupta @ 2020-01-06  4:34 UTC (permalink / raw)
  To: dev
  Cc: pbhagavatula, jerinj, hemant.agrawal, akhil.goyal,
	marko.kovacevic, orika, bruce.richardson, radu.nicolau,
	tomasz.kantecki, skori, Nipun Gupta

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
---
 examples/l3fwd/l3fwd_event.c | 55 ++++++++++++++++++++++++++++--------
 examples/l3fwd/l3fwd_event.h |  4 +++
 examples/l3fwd/main.c        |  8 ++++--
 3 files changed, 53 insertions(+), 14 deletions(-)

diff --git a/examples/l3fwd/l3fwd_event.c b/examples/l3fwd/l3fwd_event.c
index 9fea11bd9..61f642691 100644
--- a/examples/l3fwd/l3fwd_event.c
+++ b/examples/l3fwd/l3fwd_event.c
@@ -40,12 +40,32 @@ parse_eventq_sync(const char *optarg)
 		evt_rsrc->sched_type = RTE_SCHED_TYPE_PARALLEL;
 }
 
+static void
+parse_event_eth_queues(const char *eth_queues)
+{
+	struct l3fwd_event_resources *evt_rsrc = l3fwd_get_eventdev_rsrc();
+	char *end = NULL;
+	uint8_t num_eth_queues;
+
+	/* parse decimal string */
+	num_eth_queues = strtoul(eth_queues, &end, 10);
+	if ((eth_queues[0] == '\0') || (end == NULL) || (*end != '\0'))
+		return;
+
+	if (num_eth_queues == 0)
+		return;
+
+	evt_rsrc->eth_queues = num_eth_queues;
+}
+
 static void
 l3fwd_parse_eventdev_args(char **argv, int argc)
 {
 	const struct option eventdev_lgopts[] = {
 		{CMD_LINE_OPT_MODE, 1, 0, CMD_LINE_OPT_MODE_NUM},
 		{CMD_LINE_OPT_EVENTQ_SYNC, 1, 0, CMD_LINE_OPT_EVENTQ_SYNC_NUM},
+		{CMD_LINE_OPT_EVENT_ETH_QUEUES, 1, 0,
+				CMD_LINE_OPT_EVENT_ETH_QUEUES_NUM},
 		{NULL, 0, 0, 0}
 	};
 	char *prgname = argv[0];
@@ -64,6 +84,10 @@ l3fwd_parse_eventdev_args(char **argv, int argc)
 			parse_eventq_sync(optarg);
 			break;
 
+		case CMD_LINE_OPT_EVENT_ETH_QUEUES_NUM:
+			parse_event_eth_queues(optarg);
+			break;
+
 		default:
 			print_usage(prgname);
 			exit(1);
@@ -85,6 +109,7 @@ l3fwd_eth_dev_port_setup(struct rte_eth_conf *port_conf)
 	struct rte_eth_rxconf rxconf;
 	unsigned int nb_mbuf;
 	uint16_t port_id;
+	uint8_t eth_qid;
 	int32_t ret;
 
 	/* initialize all ports */
@@ -118,7 +143,8 @@ l3fwd_eth_dev_port_setup(struct rte_eth_conf *port_conf)
 			       local_port_conf.rx_adv_conf.rss_conf.rss_hf);
 		}
 
-		ret = rte_eth_dev_configure(port_id, 1, 1, &local_port_conf);
+		ret = rte_eth_dev_configure(port_id, evt_rsrc->eth_queues, 1,
+					    &local_port_conf);
 		if (ret < 0)
 			rte_exit(EXIT_FAILURE,
 				 "Cannot configure device: err=%d, port=%d\n",
@@ -161,20 +187,25 @@ l3fwd_eth_dev_port_setup(struct rte_eth_conf *port_conf)
 					  8192u);
 			ret = init_mem(port_id, nb_mbuf);
 		}
-		/* init one Rx queue per port */
+		/* init Rx queues per port */
 		rxconf = dev_info.default_rxconf;
 		rxconf.offloads = local_port_conf.rxmode.offloads;
-		if (!evt_rsrc->per_port_pool)
-			ret = rte_eth_rx_queue_setup(port_id, 0, nb_rxd, 0,
-					&rxconf, evt_rsrc->pkt_pool[0][0]);
-		else
-			ret = rte_eth_rx_queue_setup(port_id, 0, nb_rxd, 0,
-					&rxconf,
+
+		for (eth_qid = 0; eth_qid < evt_rsrc->eth_queues; eth_qid++) {
+			if (!evt_rsrc->per_port_pool)
+				ret = rte_eth_rx_queue_setup(port_id, eth_qid,
+					nb_rxd, 0, &rxconf,
+					evt_rsrc->pkt_pool[0][0]);
+			else
+				ret = rte_eth_rx_queue_setup(port_id, eth_qid,
+					nb_rxd, 0, &rxconf,
 					evt_rsrc->pkt_pool[port_id][0]);
-		if (ret < 0)
-			rte_exit(EXIT_FAILURE,
-				 "rte_eth_rx_queue_setup: err=%d, "
-				 "port=%d\n", ret, port_id);
+			if (ret < 0)
+				rte_exit(EXIT_FAILURE,
+					 "rte_eth_rx_queue_setup: err=%d, "
+					 "port=%d, eth queue: %d\n",
+					 ret, port_id, eth_qid);
+		}
 
 		/* init one Tx queue per port */
 		txconf = dev_info.default_txconf;
diff --git a/examples/l3fwd/l3fwd_event.h b/examples/l3fwd/l3fwd_event.h
index 470aedc61..1fdd51e62 100644
--- a/examples/l3fwd/l3fwd_event.h
+++ b/examples/l3fwd/l3fwd_event.h
@@ -21,10 +21,12 @@
 
 #define CMD_LINE_OPT_MODE "mode"
 #define CMD_LINE_OPT_EVENTQ_SYNC "eventq-sched"
+#define CMD_LINE_OPT_EVENT_ETH_QUEUES "event-eth-queues"
 
 enum {
 	CMD_LINE_OPT_MODE_NUM = 265,
 	CMD_LINE_OPT_EVENTQ_SYNC_NUM,
+	CMD_LINE_OPT_EVENT_ETH_QUEUES_NUM,
 };
 
 typedef uint32_t (*event_device_setup_cb)(void);
@@ -82,6 +84,7 @@ struct l3fwd_event_resources {
 	uint8_t deq_depth;
 	uint8_t has_burst;
 	uint8_t enabled;
+	uint8_t eth_queues;
 	uint8_t nb_args;
 	char **args;
 };
@@ -104,6 +107,7 @@ l3fwd_get_eventdev_rsrc(void)
 
 		memset(mz->addr, 0, sizeof(struct l3fwd_event_resources));
 		rsrc->sched_type = RTE_SCHED_TYPE_ATOMIC;
+		rsrc->eth_queues = 1;
 
 		return mz->addr;
 	}
diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c
index 68998f42c..ecfaca435 100644
--- a/examples/l3fwd/main.c
+++ b/examples/l3fwd/main.c
@@ -285,7 +285,8 @@ print_usage(const char *prgname)
 		" [--parse-ptype]"
 		" [--per-port-pool]"
 		" [--mode]"
-		" [--eventq-sched]\n\n"
+		" [--eventq-sched]"
+		" [--event-eth-queues]\n\n"
 
 		"  -p PORTMASK: Hexadecimal bitmask of ports to configure\n"
 		"  -P : Enable promiscuous mode\n"
@@ -306,7 +307,10 @@ print_usage(const char *prgname)
 		"  --eventq-sched: Event queue synchronization method "
 		"                  ordered, atomic or parallel.\n\t\t"
 		"		   Default: atomic\n\t\t"
-		"                  Valid only if --mode=eventdev\n\n",
+		"                  Valid only if --mode=eventdev\n"
+		"  --event-eth-queues: Number of ethernet queues per device.\n\t\t"
+		"		       Default: 1\n\t\t"
+		"		       Valid only if --mode=eventdev\n\n",
 		prgname);
 }
 
-- 
2.17.1


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

* Re: [dpdk-dev] [EXT] [PATCH 2/2] examples/l3fwd: support multiple queues in event mode
  2020-01-06  4:34 ` [dpdk-dev] [PATCH 2/2] examples/l3fwd: support multiple queues in event mode Nipun Gupta
@ 2020-01-06  6:09   ` Sunil Kumar Kori
  2020-01-06 17:47     ` Nipun Gupta
  0 siblings, 1 reply; 6+ messages in thread
From: Sunil Kumar Kori @ 2020-01-06  6:09 UTC (permalink / raw)
  To: Nipun Gupta, dev
  Cc: Pavan Nikhilesh Bhagavatula, Jerin Jacob Kollanukkaran,
	hemant.agrawal, akhil.goyal, marko.kovacevic, orika,
	bruce.richardson, radu.nicolau, tomasz.kantecki



Regards
Sunil Kumar Kori

>-----Original Message-----
>From: Nipun Gupta <nipun.gupta@nxp.com>
>Sent: Monday, January 6, 2020 10:05 AM
>To: dev@dpdk.org
>Cc: Pavan Nikhilesh Bhagavatula <pbhagavatula@marvell.com>; Jerin Jacob
>Kollanukkaran <jerinj@marvell.com>; hemant.agrawal@nxp.com;
>akhil.goyal@nxp.com; marko.kovacevic@intel.com; orika@mellanox.com;
>bruce.richardson@intel.com; radu.nicolau@intel.com;
>tomasz.kantecki@intel.com; Sunil Kumar Kori <skori@marvell.com>; Nipun
>Gupta <nipun.gupta@nxp.com>
>Subject: [EXT] [PATCH 2/2] examples/l3fwd: support multiple queues in event
>mode
>
>External Email
>
>----------------------------------------------------------------------
>Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
>---
> examples/l3fwd/l3fwd_event.c | 55 ++++++++++++++++++++++++++++--------
> examples/l3fwd/l3fwd_event.h |  4 +++
> examples/l3fwd/main.c        |  8 ++++--
> 3 files changed, 53 insertions(+), 14 deletions(-)
>
>diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c index
>68998f42c..ecfaca435 100644
>--- a/examples/l3fwd/main.c
>+++ b/examples/l3fwd/main.c
>@@ -285,7 +285,8 @@ print_usage(const char *prgname)
> 		" [--parse-ptype]"
> 		" [--per-port-pool]"
> 		" [--mode]"
>-		" [--eventq-sched]\n\n"
>+		" [--eventq-sched]"
>+		" [--event-eth-queues]\n\n"
>
> 		"  -p PORTMASK: Hexadecimal bitmask of ports to
>configure\n"
> 		"  -P : Enable promiscuous mode\n"
>@@ -306,7 +307,10 @@ print_usage(const char *prgname)
> 		"  --eventq-sched: Event queue synchronization method "
> 		"                  ordered, atomic or parallel.\n\t\t"
> 		"		   Default: atomic\n\t\t"
>-		"                  Valid only if --mode=eventdev\n\n",
>+		"                  Valid only if --mode=eventdev\n"
>+		"  --event-eth-queues: Number of ethernet queues per
>device.\n\t\t"
Will it be better to make it like "eth-rx-queues" simply ? So that It will clearly reflect that which queues it is referring to, Rx or Tx.  Also Comment should be updated accordingly. 
>+		"		       Default: 1\n\t\t"
>+		"		       Valid only if --mode=eventdev\n\n",
> 		prgname);
> }
>
>--
>2.17.1


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

* Re: [dpdk-dev] [EXT] [PATCH 2/2] examples/l3fwd: support multiple queues in event mode
  2020-01-06  6:09   ` [dpdk-dev] [EXT] " Sunil Kumar Kori
@ 2020-01-06 17:47     ` Nipun Gupta
  0 siblings, 0 replies; 6+ messages in thread
From: Nipun Gupta @ 2020-01-06 17:47 UTC (permalink / raw)
  To: Sunil Kumar Kori, dev
  Cc: Pavan Nikhilesh Bhagavatula, Jerin Jacob Kollanukkaran,
	Hemant Agrawal, Akhil Goyal, marko.kovacevic, orika,
	bruce.richardson, radu.nicolau, tomasz.kantecki



> -----Original Message-----
> From: Sunil Kumar Kori <skori@marvell.com>
> Sent: Monday, January 6, 2020 11:39 AM
> To: Nipun Gupta <nipun.gupta@nxp.com>; dev@dpdk.org
> Cc: Pavan Nikhilesh Bhagavatula <pbhagavatula@marvell.com>; Jerin Jacob
> Kollanukkaran <jerinj@marvell.com>; Hemant Agrawal
> <hemant.agrawal@nxp.com>; Akhil Goyal <akhil.goyal@nxp.com>;
> marko.kovacevic@intel.com; orika@mellanox.com;
> bruce.richardson@intel.com; radu.nicolau@intel.com;
> tomasz.kantecki@intel.com
> Subject: RE: [EXT] [PATCH 2/2] examples/l3fwd: support multiple queues in
> event mode
> 
> 
> 
> Regards
> Sunil Kumar Kori
> 
> >-----Original Message-----
> >From: Nipun Gupta <nipun.gupta@nxp.com>
> >Sent: Monday, January 6, 2020 10:05 AM
> >To: dev@dpdk.org
> >Cc: Pavan Nikhilesh Bhagavatula <pbhagavatula@marvell.com>; Jerin Jacob
> >Kollanukkaran <jerinj@marvell.com>; hemant.agrawal@nxp.com;
> >akhil.goyal@nxp.com; marko.kovacevic@intel.com; orika@mellanox.com;
> >bruce.richardson@intel.com; radu.nicolau@intel.com;
> >tomasz.kantecki@intel.com; Sunil Kumar Kori <skori@marvell.com>; Nipun
> >Gupta <nipun.gupta@nxp.com>
> >Subject: [EXT] [PATCH 2/2] examples/l3fwd: support multiple queues in event
> >mode
> >
> >External Email
> >
> >----------------------------------------------------------------------
> >Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
> >---
> > examples/l3fwd/l3fwd_event.c | 55 ++++++++++++++++++++++++++++--------
> > examples/l3fwd/l3fwd_event.h |  4 +++
> > examples/l3fwd/main.c        |  8 ++++--
> > 3 files changed, 53 insertions(+), 14 deletions(-)
> >
> >diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c index
> >68998f42c..ecfaca435 100644
> >--- a/examples/l3fwd/main.c
> >+++ b/examples/l3fwd/main.c
> >@@ -285,7 +285,8 @@ print_usage(const char *prgname)
> > 		" [--parse-ptype]"
> > 		" [--per-port-pool]"
> > 		" [--mode]"
> >-		" [--eventq-sched]\n\n"
> >+		" [--eventq-sched]"
> >+		" [--event-eth-queues]\n\n"
> >
> > 		"  -p PORTMASK: Hexadecimal bitmask of ports to
> >configure\n"
> > 		"  -P : Enable promiscuous mode\n"
> >@@ -306,7 +307,10 @@ print_usage(const char *prgname)
> > 		"  --eventq-sched: Event queue synchronization method "
> > 		"                  ordered, atomic or parallel.\n\t\t"
> > 		"		   Default: atomic\n\t\t"
> >-		"                  Valid only if --mode=eventdev\n\n",
> >+		"                  Valid only if --mode=eventdev\n"
> >+		"  --event-eth-queues: Number of ethernet queues per
> >device.\n\t\t"
> Will it be better to make it like "eth-rx-queues" simply ? So that It will clearly
> reflect that which queues it is referring to, Rx or Tx.  Also Comment should be
> updated accordingly.

Agree we should add rx also in the name to make it more clear, but I do not want
to remove event from the name. How about ' --event-eth-rxqs'?

Regards,
Nipun

> >+		"		       Default: 1\n\t\t"
> >+		"		       Valid only if --mode=eventdev\n\n",
> > 		prgname);
> > }
> >
> >--
> >2.17.1


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

* [dpdk-dev] [PATCH 1/2 v2] examples/l3fwd: set default schedule type as atomic
  2020-01-06  4:34 [dpdk-dev] [PATCH 1/2] examples/l3fwd: set default schedule type as atomic Nipun Gupta
  2020-01-06  4:34 ` [dpdk-dev] [PATCH 2/2] examples/l3fwd: support multiple queues in event mode Nipun Gupta
@ 2020-01-07 12:22 ` Nipun Gupta
  2020-01-07 12:22   ` [dpdk-dev] [PATCH 2/2 v2] examples/l3fwd: support multiple eth Rx queues in event mode Nipun Gupta
  1 sibling, 1 reply; 6+ messages in thread
From: Nipun Gupta @ 2020-01-07 12:22 UTC (permalink / raw)
  To: dev
  Cc: pbhagavatula, jerinj, hemant.agrawal, akhil.goyal,
	marko.kovacevic, orika, bruce.richardson, radu.nicolau,
	tomasz.kantecki, skori, Nipun Gupta

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
---
 examples/l3fwd/l3fwd_event.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/examples/l3fwd/l3fwd_event.h b/examples/l3fwd/l3fwd_event.h
index fcc0ce51a..470aedc61 100644
--- a/examples/l3fwd/l3fwd_event.h
+++ b/examples/l3fwd/l3fwd_event.h
@@ -100,7 +100,11 @@ l3fwd_get_eventdev_rsrc(void)
 	mz = rte_memzone_reserve(name, sizeof(struct l3fwd_event_resources),
 				 0, 0);
 	if (mz != NULL) {
+		struct l3fwd_event_resources *rsrc = mz->addr;
+
 		memset(mz->addr, 0, sizeof(struct l3fwd_event_resources));
+		rsrc->sched_type = RTE_SCHED_TYPE_ATOMIC;
+
 		return mz->addr;
 	}
 
-- 
2.17.1


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

* [dpdk-dev] [PATCH 2/2 v2] examples/l3fwd: support multiple eth Rx queues in event mode
  2020-01-07 12:22 ` [dpdk-dev] [PATCH 1/2 v2] examples/l3fwd: set default schedule type as atomic Nipun Gupta
@ 2020-01-07 12:22   ` Nipun Gupta
  0 siblings, 0 replies; 6+ messages in thread
From: Nipun Gupta @ 2020-01-07 12:22 UTC (permalink / raw)
  To: dev
  Cc: pbhagavatula, jerinj, hemant.agrawal, akhil.goyal,
	marko.kovacevic, orika, bruce.richardson, radu.nicolau,
	tomasz.kantecki, skori, Nipun Gupta

This patch adds support of multiple Ethernet RX queues
for the event dev mode.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
---

Changes in v2:
 - Update command line argument to '--event-eth-rxqs' instead of
   '--event-eth-queues'
 - Correctly printed the number of RX queues being created

 examples/l3fwd/l3fwd_event.c | 59 ++++++++++++++++++++++++++++--------
 examples/l3fwd/l3fwd_event.h |  4 +++
 examples/l3fwd/main.c        |  8 +++--
 3 files changed, 56 insertions(+), 15 deletions(-)

diff --git a/examples/l3fwd/l3fwd_event.c b/examples/l3fwd/l3fwd_event.c
index 9fea11bd9..1289bc9ab 100644
--- a/examples/l3fwd/l3fwd_event.c
+++ b/examples/l3fwd/l3fwd_event.c
@@ -40,12 +40,32 @@ parse_eventq_sync(const char *optarg)
 		evt_rsrc->sched_type = RTE_SCHED_TYPE_PARALLEL;
 }
 
+static void
+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;
+
+	/* parse decimal string */
+	num_eth_rx_queues = strtoul(eth_rx_queues, &end, 10);
+	if ((eth_rx_queues[0] == '\0') || (end == NULL) || (*end != '\0'))
+		return;
+
+	if (num_eth_rx_queues == 0)
+		return;
+
+	evt_rsrc->eth_rx_queues = num_eth_rx_queues;
+}
+
 static void
 l3fwd_parse_eventdev_args(char **argv, int argc)
 {
 	const struct option eventdev_lgopts[] = {
 		{CMD_LINE_OPT_MODE, 1, 0, CMD_LINE_OPT_MODE_NUM},
 		{CMD_LINE_OPT_EVENTQ_SYNC, 1, 0, CMD_LINE_OPT_EVENTQ_SYNC_NUM},
+		{CMD_LINE_OPT_EVENT_ETH_RX_QUEUES, 1, 0,
+				CMD_LINE_OPT_EVENT_ETH_RX_QUEUES_NUM},
 		{NULL, 0, 0, 0}
 	};
 	char *prgname = argv[0];
@@ -64,6 +84,10 @@ l3fwd_parse_eventdev_args(char **argv, int argc)
 			parse_eventq_sync(optarg);
 			break;
 
+		case CMD_LINE_OPT_EVENT_ETH_RX_QUEUES_NUM:
+			parse_event_eth_rx_queues(optarg);
+			break;
+
 		default:
 			print_usage(prgname);
 			exit(1);
@@ -85,6 +109,7 @@ l3fwd_eth_dev_port_setup(struct rte_eth_conf *port_conf)
 	struct rte_eth_rxconf rxconf;
 	unsigned int nb_mbuf;
 	uint16_t port_id;
+	uint8_t eth_qid;
 	int32_t ret;
 
 	/* initialize all ports */
@@ -99,7 +124,8 @@ l3fwd_eth_dev_port_setup(struct rte_eth_conf *port_conf)
 		/* init port */
 		printf("Initializing port %d ... ", port_id);
 		fflush(stdout);
-		printf("Creating queues: nb_rxq=1 nb_txq=1...\n");
+		printf("Creating queues: nb_rxq=%d nb_txq=1...\n",
+		       evt_rsrc->eth_rx_queues);
 
 		rte_eth_dev_info_get(port_id, &dev_info);
 		if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
@@ -118,7 +144,8 @@ l3fwd_eth_dev_port_setup(struct rte_eth_conf *port_conf)
 			       local_port_conf.rx_adv_conf.rss_conf.rss_hf);
 		}
 
-		ret = rte_eth_dev_configure(port_id, 1, 1, &local_port_conf);
+		ret = rte_eth_dev_configure(port_id, evt_rsrc->eth_rx_queues,
+					    1, &local_port_conf);
 		if (ret < 0)
 			rte_exit(EXIT_FAILURE,
 				 "Cannot configure device: err=%d, port=%d\n",
@@ -161,20 +188,26 @@ l3fwd_eth_dev_port_setup(struct rte_eth_conf *port_conf)
 					  8192u);
 			ret = init_mem(port_id, nb_mbuf);
 		}
-		/* init one Rx queue per port */
+		/* init Rx queues per port */
 		rxconf = dev_info.default_rxconf;
 		rxconf.offloads = local_port_conf.rxmode.offloads;
-		if (!evt_rsrc->per_port_pool)
-			ret = rte_eth_rx_queue_setup(port_id, 0, nb_rxd, 0,
-					&rxconf, evt_rsrc->pkt_pool[0][0]);
-		else
-			ret = rte_eth_rx_queue_setup(port_id, 0, nb_rxd, 0,
-					&rxconf,
+
+		for (eth_qid = 0; eth_qid < evt_rsrc->eth_rx_queues;
+		     eth_qid++) {
+			if (!evt_rsrc->per_port_pool)
+				ret = rte_eth_rx_queue_setup(port_id, eth_qid,
+					nb_rxd, 0, &rxconf,
+					evt_rsrc->pkt_pool[0][0]);
+			else
+				ret = rte_eth_rx_queue_setup(port_id, eth_qid,
+					nb_rxd, 0, &rxconf,
 					evt_rsrc->pkt_pool[port_id][0]);
-		if (ret < 0)
-			rte_exit(EXIT_FAILURE,
-				 "rte_eth_rx_queue_setup: err=%d, "
-				 "port=%d\n", ret, port_id);
+			if (ret < 0)
+				rte_exit(EXIT_FAILURE,
+					 "rte_eth_rx_queue_setup: err=%d, "
+					 "port=%d, eth_qid: %d\n",
+					 ret, port_id, eth_qid);
+		}
 
 		/* init one Tx queue per port */
 		txconf = dev_info.default_txconf;
diff --git a/examples/l3fwd/l3fwd_event.h b/examples/l3fwd/l3fwd_event.h
index 470aedc61..c79458eec 100644
--- a/examples/l3fwd/l3fwd_event.h
+++ b/examples/l3fwd/l3fwd_event.h
@@ -21,10 +21,12 @@
 
 #define CMD_LINE_OPT_MODE "mode"
 #define CMD_LINE_OPT_EVENTQ_SYNC "eventq-sched"
+#define CMD_LINE_OPT_EVENT_ETH_RX_QUEUES "event-eth-rxqs"
 
 enum {
 	CMD_LINE_OPT_MODE_NUM = 265,
 	CMD_LINE_OPT_EVENTQ_SYNC_NUM,
+	CMD_LINE_OPT_EVENT_ETH_RX_QUEUES_NUM,
 };
 
 typedef uint32_t (*event_device_setup_cb)(void);
@@ -82,6 +84,7 @@ struct l3fwd_event_resources {
 	uint8_t deq_depth;
 	uint8_t has_burst;
 	uint8_t enabled;
+	uint8_t eth_rx_queues;
 	uint8_t nb_args;
 	char **args;
 };
@@ -104,6 +107,7 @@ l3fwd_get_eventdev_rsrc(void)
 
 		memset(mz->addr, 0, sizeof(struct l3fwd_event_resources));
 		rsrc->sched_type = RTE_SCHED_TYPE_ATOMIC;
+		rsrc->eth_rx_queues = 1;
 
 		return mz->addr;
 	}
diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c
index 68998f42c..b76942a9b 100644
--- a/examples/l3fwd/main.c
+++ b/examples/l3fwd/main.c
@@ -285,7 +285,8 @@ print_usage(const char *prgname)
 		" [--parse-ptype]"
 		" [--per-port-pool]"
 		" [--mode]"
-		" [--eventq-sched]\n\n"
+		" [--eventq-sched]"
+		" [--event-eth-rxqs]\n\n"
 
 		"  -p PORTMASK: Hexadecimal bitmask of ports to configure\n"
 		"  -P : Enable promiscuous mode\n"
@@ -306,7 +307,10 @@ print_usage(const char *prgname)
 		"  --eventq-sched: Event queue synchronization method "
 		"                  ordered, atomic or parallel.\n\t\t"
 		"		   Default: atomic\n\t\t"
-		"                  Valid only if --mode=eventdev\n\n",
+		"                  Valid only if --mode=eventdev\n"
+		"  --event-eth-rxqs: Number of ethernet RX queues per device.\n\t\t"
+		"		     Default: 1\n\t\t"
+		"		     Valid only if --mode=eventdev\n\n",
 		prgname);
 }
 
-- 
2.17.1


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

end of thread, other threads:[~2020-01-07 12:39 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-06  4:34 [dpdk-dev] [PATCH 1/2] examples/l3fwd: set default schedule type as atomic Nipun Gupta
2020-01-06  4:34 ` [dpdk-dev] [PATCH 2/2] examples/l3fwd: support multiple queues in event mode Nipun Gupta
2020-01-06  6:09   ` [dpdk-dev] [EXT] " Sunil Kumar Kori
2020-01-06 17:47     ` Nipun Gupta
2020-01-07 12:22 ` [dpdk-dev] [PATCH 1/2 v2] examples/l3fwd: set default schedule type as atomic Nipun Gupta
2020-01-07 12:22   ` [dpdk-dev] [PATCH 2/2 v2] examples/l3fwd: support multiple eth Rx queues in event mode Nipun Gupta

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).