All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] examples/eventdev: fix run forever with -n param
@ 2017-08-04 15:41 Harry van Haaren
  2017-08-04 15:49 ` [PATCH v2] " Harry van Haaren
  0 siblings, 1 reply; 3+ messages in thread
From: Harry van Haaren @ 2017-08-04 15:41 UTC (permalink / raw)
  To: dev; +Cc: bruce.richardson, Harry van Haaren

During the refactoring of the sample app to be more generic, the
option to set -n0 and process a huge number of packets was lost.
This commit re-adds -n0, and will process INT64_MAX number of packets.

Fixes: adb5d5486c39 ("examples/eventdev_pipeline_sw_pmd: add sample app")

Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
---
 examples/eventdev_pipeline_sw_pmd/main.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/examples/eventdev_pipeline_sw_pmd/main.c b/examples/eventdev_pipeline_sw_pmd/main.c
index 91dddb1..ae537a5 100644
--- a/examples/eventdev_pipeline_sw_pmd/main.c
+++ b/examples/eventdev_pipeline_sw_pmd/main.c
@@ -91,7 +91,7 @@ static struct fastpath_data *fdata;
 struct config_data {
 	unsigned int active_cores;
 	unsigned int num_workers;
-	long num_packets;
+	int64_t num_packets;
 	unsigned int num_fids;
 	int queue_type;
 	int worker_cycles;
@@ -121,7 +121,6 @@ core_in_use(unsigned int lcore_id) {
 		fdata->tx_core[lcore_id] || fdata->worker_core[lcore_id]);
 }
 
-
 static void
 eth_tx_buffer_retry(struct rte_mbuf **pkts, uint16_t unsent,
 			void *userdata)
@@ -471,7 +470,9 @@ parse_app_args(int argc, char **argv)
 		int popcnt = 0;
 		switch (c) {
 		case 'n':
-			cdata.num_packets = (unsigned long)atol(optarg);
+			cdata.num_packets = (int64_t)atol(optarg);
+			if(cdata.num_packets == 0)
+				cdata.num_packets = INT64_MAX;
 			break;
 		case 'f':
 			cdata.num_fids = (unsigned int)atoi(optarg);
@@ -908,7 +909,7 @@ main(int argc, char **argv)
 		printf("  Config:\n");
 		printf("\tports: %u\n", num_ports);
 		printf("\tworkers: %u\n", cdata.num_workers);
-		printf("\tpackets: %lu\n", cdata.num_packets);
+		printf("\tpackets: %"PRIi64"\n", cdata.num_packets);
 		printf("\tQueue-prio: %u\n", cdata.enable_queue_priorities);
 		if (cdata.queue_type == RTE_EVENT_QUEUE_CFG_ORDERED_ONLY)
 			printf("\tqid0 type: ordered\n");
-- 
2.7.4

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

* [PATCH v2] examples/eventdev: fix run forever with -n param
  2017-08-04 15:41 [PATCH] examples/eventdev: fix run forever with -n param Harry van Haaren
@ 2017-08-04 15:49 ` Harry van Haaren
  2017-08-04 23:37   ` Thomas Monjalon
  0 siblings, 1 reply; 3+ messages in thread
From: Harry van Haaren @ 2017-08-04 15:49 UTC (permalink / raw)
  To: dev; +Cc: bruce.richardson, Harry van Haaren

During the refactoring of the sample app to be more generic, the
option to set -n0 and process a huge number of packets was lost.
This commit re-adds -n0, and will process INT64_MAX number of packets.

Fixes: adb5d5486c39 ("examples/eventdev_pipeline_sw_pmd: add sample app")

Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>

---

v2: fix checkpatch whitespace issue
---
 examples/eventdev_pipeline_sw_pmd/main.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/examples/eventdev_pipeline_sw_pmd/main.c b/examples/eventdev_pipeline_sw_pmd/main.c
index 91dddb1..dd75cb7 100644
--- a/examples/eventdev_pipeline_sw_pmd/main.c
+++ b/examples/eventdev_pipeline_sw_pmd/main.c
@@ -91,7 +91,7 @@ static struct fastpath_data *fdata;
 struct config_data {
 	unsigned int active_cores;
 	unsigned int num_workers;
-	long num_packets;
+	int64_t num_packets;
 	unsigned int num_fids;
 	int queue_type;
 	int worker_cycles;
@@ -121,7 +121,6 @@ core_in_use(unsigned int lcore_id) {
 		fdata->tx_core[lcore_id] || fdata->worker_core[lcore_id]);
 }
 
-
 static void
 eth_tx_buffer_retry(struct rte_mbuf **pkts, uint16_t unsent,
 			void *userdata)
@@ -471,7 +470,9 @@ parse_app_args(int argc, char **argv)
 		int popcnt = 0;
 		switch (c) {
 		case 'n':
-			cdata.num_packets = (unsigned long)atol(optarg);
+			cdata.num_packets = (int64_t)atol(optarg);
+			if (cdata.num_packets == 0)
+				cdata.num_packets = INT64_MAX;
 			break;
 		case 'f':
 			cdata.num_fids = (unsigned int)atoi(optarg);
@@ -908,7 +909,7 @@ main(int argc, char **argv)
 		printf("  Config:\n");
 		printf("\tports: %u\n", num_ports);
 		printf("\tworkers: %u\n", cdata.num_workers);
-		printf("\tpackets: %lu\n", cdata.num_packets);
+		printf("\tpackets: %"PRIi64"\n", cdata.num_packets);
 		printf("\tQueue-prio: %u\n", cdata.enable_queue_priorities);
 		if (cdata.queue_type == RTE_EVENT_QUEUE_CFG_ORDERED_ONLY)
 			printf("\tqid0 type: ordered\n");
-- 
2.7.4

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

* Re: [PATCH v2] examples/eventdev: fix run forever with -n param
  2017-08-04 15:49 ` [PATCH v2] " Harry van Haaren
@ 2017-08-04 23:37   ` Thomas Monjalon
  0 siblings, 0 replies; 3+ messages in thread
From: Thomas Monjalon @ 2017-08-04 23:37 UTC (permalink / raw)
  To: Harry van Haaren; +Cc: dev, bruce.richardson

04/08/2017 17:49, Harry van Haaren:
> During the refactoring of the sample app to be more generic, the
> option to set -n0 and process a huge number of packets was lost.
> This commit re-adds -n0, and will process INT64_MAX number of packets.
> 
> Fixes: adb5d5486c39 ("examples/eventdev_pipeline_sw_pmd: add sample app")
> 
> Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>

Applied, thanks

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

end of thread, other threads:[~2017-08-04 23:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-04 15:41 [PATCH] examples/eventdev: fix run forever with -n param Harry van Haaren
2017-08-04 15:49 ` [PATCH v2] " Harry van Haaren
2017-08-04 23:37   ` Thomas Monjalon

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.