DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH v4] app/testpmd: initialize port_numa and ring_numa
@ 2017-04-28  2:01 Yulong Pei
  2017-04-28  8:30 ` Wu, Jingjing
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Yulong Pei @ 2017-04-28  2:01 UTC (permalink / raw)
  To: dev; +Cc: jingjing.wu, thomas

Previous numa_support = 0 by default, it need to add --numa to testpmd
command line to enable numa, so port_numa and ring_numa were initialized
at function launch_args_parse(), now testpmd change numa_support = 1 as
default, so port_numa and ring_numa also need to initialize by default,
otherwise port->socket_id will be probed to wrong value.

Fixes: 999b2ee0fe45 ("app/testpmd: enable NUMA support by default")

Signed-off-by: Yulong Pei <yulong.pei@intel.com>
---
 app/test-pmd/parameters.c | 6 +-----
 app/test-pmd/testpmd.c    | 6 ++++++
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c
index 3f4d3a2..3296b3a 100644
--- a/app/test-pmd/parameters.c
+++ b/app/test-pmd/parameters.c
@@ -665,12 +665,8 @@ launch_args_parse(int argc, char** argv)
 				parse_fwd_portmask(optarg);
 			if (!strcmp(lgopts[opt_idx].name, "no-numa"))
 				numa_support = 0;
-			if (!strcmp(lgopts[opt_idx].name, "numa")) {
+			if (!strcmp(lgopts[opt_idx].name, "numa"))
 				numa_support = 1;
-				memset(port_numa,NUMA_NO_CONFIG,RTE_MAX_ETHPORTS);
-				memset(rxring_numa,NUMA_NO_CONFIG,RTE_MAX_ETHPORTS);
-				memset(txring_numa,NUMA_NO_CONFIG,RTE_MAX_ETHPORTS);
-			}
 			if (!strcmp(lgopts[opt_idx].name, "mp-anon")) {
 				mp_anon = 1;
 			}
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 3a57348..606bfd1 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -543,6 +543,12 @@ init_config(void)
 		fwd_lcores[lc_id]->cpuid_idx = lc_id;
 	}
 
+	if (numa_support) {
+		memset(port_numa, NUMA_NO_CONFIG, RTE_MAX_ETHPORTS);
+		memset(rxring_numa, NUMA_NO_CONFIG, RTE_MAX_ETHPORTS);
+		memset(txring_numa, NUMA_NO_CONFIG, RTE_MAX_ETHPORTS);
+	}
+
 	/*
 	 * Create pools of mbuf.
 	 * If NUMA support is disabled, create a single pool of mbuf in
-- 
2.7.4

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

* Re: [dpdk-dev] [PATCH v4] app/testpmd: initialize port_numa and ring_numa
  2017-04-28  2:01 [dpdk-dev] [PATCH v4] app/testpmd: initialize port_numa and ring_numa Yulong Pei
@ 2017-04-28  8:30 ` Wu, Jingjing
  2017-05-01 13:35   ` Thomas Monjalon
  2017-05-03 10:27 ` [dpdk-dev] [PATCH] app/testpmd: fix port_numa and ring_numa not initialize issue Yulong Pei
  2017-05-03 10:29 ` [dpdk-dev] [PATCH v5] " Yulong Pei
  2 siblings, 1 reply; 7+ messages in thread
From: Wu, Jingjing @ 2017-04-28  8:30 UTC (permalink / raw)
  To: Pei, Yulong, dev; +Cc: thomas



> -----Original Message-----
> From: Pei, Yulong
> Sent: Friday, April 28, 2017 10:02 AM
> To: dev@dpdk.org
> Cc: Wu, Jingjing <jingjing.wu@intel.com>; thomas@monjalon.net
> Subject: [PATCH v4] app/testpmd: initialize port_numa and ring_numa
> 
> Previous numa_support = 0 by default, it need to add --numa to testpmd
> command line to enable numa, so port_numa and ring_numa were initialized at
> function launch_args_parse(), now testpmd change numa_support = 1 as default,
> so port_numa and ring_numa also need to initialize by default, otherwise port-
> >socket_id will be probed to wrong value.
> 
> Fixes: 999b2ee0fe45 ("app/testpmd: enable NUMA support by default")
> 
> Signed-off-by: Yulong Pei <yulong.pei@intel.com>

You forgot "fix" in title if the patch is fixing a problem.
Anyway, the change is OK.
Acked-by: Jingjing Wu <jingjing.wu@intel.com>

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

* Re: [dpdk-dev] [PATCH v4] app/testpmd: initialize port_numa and ring_numa
  2017-04-28  8:30 ` Wu, Jingjing
@ 2017-05-01 13:35   ` Thomas Monjalon
  0 siblings, 0 replies; 7+ messages in thread
From: Thomas Monjalon @ 2017-05-01 13:35 UTC (permalink / raw)
  To: Pei, Yulong; +Cc: dev, Wu, Jingjing

28/04/2017 10:30, Wu, Jingjing:
> From: Pei, Yulong
> > 
> > Previous numa_support = 0 by default, it need to add --numa to testpmd
> > command line to enable numa, so port_numa and ring_numa were initialized at
> > function launch_args_parse(), now testpmd change numa_support = 1 as default,
> > so port_numa and ring_numa also need to initialize by default, otherwise port-
> > >socket_id will be probed to wrong value.
> > 
> > Fixes: 999b2ee0fe45 ("app/testpmd: enable NUMA support by default")
> > 
> > Signed-off-by: Yulong Pei <yulong.pei@intel.com>
> 
> You forgot "fix" in title if the patch is fixing a problem.
> Anyway, the change is OK.
> Acked-by: Jingjing Wu <jingjing.wu@intel.com>

Please rebase on top of http://dpdk.org/commit/3ab64341d
and check if the patch needs to be reworked.
The check of port_numa array below is weird.

PS: please use --in-reply-to for v5.

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

* [dpdk-dev] [PATCH] app/testpmd: fix port_numa and ring_numa not initialize issue
  2017-04-28  2:01 [dpdk-dev] [PATCH v4] app/testpmd: initialize port_numa and ring_numa Yulong Pei
  2017-04-28  8:30 ` Wu, Jingjing
@ 2017-05-03 10:27 ` Yulong Pei
  2017-05-03 10:29 ` [dpdk-dev] [PATCH v5] " Yulong Pei
  2 siblings, 0 replies; 7+ messages in thread
From: Yulong Pei @ 2017-05-03 10:27 UTC (permalink / raw)
  To: dev; +Cc: jingjing.wu, thomas

Previous numa_support = 0 by default, it need to add --numa to testpmd
command line to enable numa, so port_numa and ring_numa were initialized
at function launch_args_parse(), now testpmd change numa_support = 1 as
default, so port_numa and ring_numa also need to initialize by default,
otherwise port->socket_id will be probed to wrong value.

Fixes: 999b2ee0fe45 ("app/testpmd: enable NUMA support by default")

Signed-off-by: Yulong Pei <yulong.pei@intel.com>
---
 app/test-pmd/parameters.c | 6 +-----
 app/test-pmd/testpmd.c    | 7 +++++++
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c
index 787e143..36f7dd8 100644
--- a/app/test-pmd/parameters.c
+++ b/app/test-pmd/parameters.c
@@ -680,12 +680,8 @@ launch_args_parse(int argc, char** argv)
 				parse_fwd_portmask(optarg);
 			if (!strcmp(lgopts[opt_idx].name, "no-numa"))
 				numa_support = 0;
-			if (!strcmp(lgopts[opt_idx].name, "numa")) {
+			if (!strcmp(lgopts[opt_idx].name, "numa"))
 				numa_support = 1;
-				memset(port_numa,NUMA_NO_CONFIG,RTE_MAX_ETHPORTS);
-				memset(rxring_numa,NUMA_NO_CONFIG,RTE_MAX_ETHPORTS);
-				memset(txring_numa,NUMA_NO_CONFIG,RTE_MAX_ETHPORTS);
-			}
 			if (!strcmp(lgopts[opt_idx].name, "mp-anon")) {
 				mp_anon = 1;
 			}
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index dfe6442..78423ee 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -529,6 +529,13 @@ init_config(void)
 	uint8_t port_per_socket[RTE_MAX_NUMA_NODES];
 
 	memset(port_per_socket,0,RTE_MAX_NUMA_NODES);
+
+	if (numa_support) {
+		memset(port_numa, NUMA_NO_CONFIG, RTE_MAX_ETHPORTS);
+		memset(rxring_numa, NUMA_NO_CONFIG, RTE_MAX_ETHPORTS);
+		memset(txring_numa, NUMA_NO_CONFIG, RTE_MAX_ETHPORTS);
+	}
+
 	/* Configuration of logical cores. */
 	fwd_lcores = rte_zmalloc("testpmd: fwd_lcores",
 				sizeof(struct fwd_lcore *) * nb_lcores,
-- 
2.5.0

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

* [dpdk-dev] [PATCH v5] app/testpmd: fix port_numa and ring_numa not initialize issue
  2017-04-28  2:01 [dpdk-dev] [PATCH v4] app/testpmd: initialize port_numa and ring_numa Yulong Pei
  2017-04-28  8:30 ` Wu, Jingjing
  2017-05-03 10:27 ` [dpdk-dev] [PATCH] app/testpmd: fix port_numa and ring_numa not initialize issue Yulong Pei
@ 2017-05-03 10:29 ` Yulong Pei
  2017-05-06  0:52   ` Wu, Jingjing
  2 siblings, 1 reply; 7+ messages in thread
From: Yulong Pei @ 2017-05-03 10:29 UTC (permalink / raw)
  To: dev; +Cc: jingjing.wu, thomas

Previous numa_support = 0 by default, it need to add --numa to testpmd
command line to enable numa, so port_numa and ring_numa were initialized
at function launch_args_parse(), now testpmd change numa_support = 1 as
default, so port_numa and ring_numa also need to initialize by default,
otherwise port->socket_id will be probed to wrong value.

Fixes: 999b2ee0fe45 ("app/testpmd: enable NUMA support by default")

Signed-off-by: Yulong Pei <yulong.pei@intel.com>
---
 app/test-pmd/parameters.c | 6 +-----
 app/test-pmd/testpmd.c    | 7 +++++++
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c
index 787e143..36f7dd8 100644
--- a/app/test-pmd/parameters.c
+++ b/app/test-pmd/parameters.c
@@ -680,12 +680,8 @@ launch_args_parse(int argc, char** argv)
 				parse_fwd_portmask(optarg);
 			if (!strcmp(lgopts[opt_idx].name, "no-numa"))
 				numa_support = 0;
-			if (!strcmp(lgopts[opt_idx].name, "numa")) {
+			if (!strcmp(lgopts[opt_idx].name, "numa"))
 				numa_support = 1;
-				memset(port_numa,NUMA_NO_CONFIG,RTE_MAX_ETHPORTS);
-				memset(rxring_numa,NUMA_NO_CONFIG,RTE_MAX_ETHPORTS);
-				memset(txring_numa,NUMA_NO_CONFIG,RTE_MAX_ETHPORTS);
-			}
 			if (!strcmp(lgopts[opt_idx].name, "mp-anon")) {
 				mp_anon = 1;
 			}
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index dfe6442..78423ee 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -529,6 +529,13 @@ init_config(void)
 	uint8_t port_per_socket[RTE_MAX_NUMA_NODES];
 
 	memset(port_per_socket,0,RTE_MAX_NUMA_NODES);
+
+	if (numa_support) {
+		memset(port_numa, NUMA_NO_CONFIG, RTE_MAX_ETHPORTS);
+		memset(rxring_numa, NUMA_NO_CONFIG, RTE_MAX_ETHPORTS);
+		memset(txring_numa, NUMA_NO_CONFIG, RTE_MAX_ETHPORTS);
+	}
+
 	/* Configuration of logical cores. */
 	fwd_lcores = rte_zmalloc("testpmd: fwd_lcores",
 				sizeof(struct fwd_lcore *) * nb_lcores,
-- 
2.5.0

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

* Re: [dpdk-dev] [PATCH v5] app/testpmd: fix port_numa and ring_numa not initialize issue
  2017-05-03 10:29 ` [dpdk-dev] [PATCH v5] " Yulong Pei
@ 2017-05-06  0:52   ` Wu, Jingjing
  2017-05-06  8:30     ` Thomas Monjalon
  0 siblings, 1 reply; 7+ messages in thread
From: Wu, Jingjing @ 2017-05-06  0:52 UTC (permalink / raw)
  To: Pei, Yulong, dev; +Cc: thomas



> -----Original Message-----
> From: Pei, Yulong
> Sent: Wednesday, May 3, 2017 6:30 PM
> To: dev@dpdk.org
> Cc: Wu, Jingjing <jingjing.wu@intel.com>; thomas@monjalon.net
> Subject: [PATCH v5] app/testpmd: fix port_numa and ring_numa not initialize
> issue
> 
> Previous numa_support = 0 by default, it need to add --numa to testpmd
> command line to enable numa, so port_numa and ring_numa were initialized at
> function launch_args_parse(), now testpmd change numa_support = 1 as default,
> so port_numa and ring_numa also need to initialize by default, otherwise port-
> >socket_id will be probed to wrong value.
> 
> Fixes: 999b2ee0fe45 ("app/testpmd: enable NUMA support by default")
> 
> Signed-off-by: Yulong Pei <yulong.pei@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>

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

* Re: [dpdk-dev] [PATCH v5] app/testpmd: fix port_numa and ring_numa not initialize issue
  2017-05-06  0:52   ` Wu, Jingjing
@ 2017-05-06  8:30     ` Thomas Monjalon
  0 siblings, 0 replies; 7+ messages in thread
From: Thomas Monjalon @ 2017-05-06  8:30 UTC (permalink / raw)
  To: Pei, Yulong; +Cc: dev, Wu, Jingjing

06/05/2017 02:52, Wu, Jingjing:
> From: Pei, Yulong
> > 
> > Previous numa_support = 0 by default, it need to add --numa to testpmd
> > command line to enable numa, so port_numa and ring_numa were initialized at
> > function launch_args_parse(), now testpmd change numa_support = 1 as default,
> > so port_numa and ring_numa also need to initialize by default, otherwise port-
> > >socket_id will be probed to wrong value.
> > 
> > Fixes: 999b2ee0fe45 ("app/testpmd: enable NUMA support by default")
> > 
> > Signed-off-by: Yulong Pei <yulong.pei@intel.com>
> Acked-by: Jingjing Wu <jingjing.wu@intel.com>

Applied, thanks

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

end of thread, other threads:[~2017-05-06  8:30 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-28  2:01 [dpdk-dev] [PATCH v4] app/testpmd: initialize port_numa and ring_numa Yulong Pei
2017-04-28  8:30 ` Wu, Jingjing
2017-05-01 13:35   ` Thomas Monjalon
2017-05-03 10:27 ` [dpdk-dev] [PATCH] app/testpmd: fix port_numa and ring_numa not initialize issue Yulong Pei
2017-05-03 10:29 ` [dpdk-dev] [PATCH v5] " Yulong Pei
2017-05-06  0:52   ` Wu, Jingjing
2017-05-06  8:30     ` 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).