All of lore.kernel.org
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 0/3] fix check of port and core
@ 2021-03-27  7:40 Min Hu (Connor)
  2021-03-27  7:40 ` [dpdk-dev] [PATCH 1/3] examples/flow_classify: " Min Hu (Connor)
                   ` (5 more replies)
  0 siblings, 6 replies; 29+ messages in thread
From: Min Hu (Connor) @ 2021-03-27  7:40 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, bernard.iremonger, tomasz.kantecki, bruce.richardson

Currently, some examples check that the port is on the same NUMA
node as the polling thread for best performance. The method is
to compare the socket id of port and that of current core. If the
result is different, warning info will be given.

But it ignores the port which is from numa node 0, that is, no
warning info will be given if the port is from numa node 0, and
this set of patches will fix it.

Min Hu (Connor) (3):
  examples/flow_classify: fix check of port and core
  examples/l2fwd-cat: fix check of port and core
  examples/skeleton: fix check of port and core

 examples/flow_classify/flow_classify.c | 2 +-
 examples/l2fwd-cat/l2fwd-cat.c         | 2 +-
 examples/skeleton/basicfwd.c           | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

-- 
2.7.4


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

* [dpdk-dev] [PATCH 1/3] examples/flow_classify: fix check of port and core
  2021-03-27  7:40 [dpdk-dev] [PATCH 0/3] fix check of port and core Min Hu (Connor)
@ 2021-03-27  7:40 ` Min Hu (Connor)
  2021-04-20  1:08   ` Thomas Monjalon
  2021-03-27  7:40 ` [dpdk-dev] [PATCH 2/3] examples/l2fwd-cat: " Min Hu (Connor)
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 29+ messages in thread
From: Min Hu (Connor) @ 2021-03-27  7:40 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, bernard.iremonger, tomasz.kantecki, bruce.richardson

fix check of port and core in flow_classify example.

Fixes: bab16ddaf2c1 ("examples/flow_classify: add sample application")
Cc: stable@dpdk.org

Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
---
 examples/flow_classify/flow_classify.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/examples/flow_classify/flow_classify.c b/examples/flow_classify/flow_classify.c
index 335d7d2..277a2f5 100644
--- a/examples/flow_classify/flow_classify.c
+++ b/examples/flow_classify/flow_classify.c
@@ -284,7 +284,7 @@ lcore_main(struct flow_classifier *cls_app)
 	 * for best performance.
 	 */
 	RTE_ETH_FOREACH_DEV(port)
-		if (rte_eth_dev_socket_id(port) > 0 &&
+		if (rte_eth_dev_socket_id(port) >= 0 &&
 			rte_eth_dev_socket_id(port) != (int)rte_socket_id()) {
 			printf("\n\n");
 			printf("WARNING: port %u is on remote NUMA node\n",
-- 
2.7.4


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

* [dpdk-dev] [PATCH 2/3] examples/l2fwd-cat: fix check of port and core
  2021-03-27  7:40 [dpdk-dev] [PATCH 0/3] fix check of port and core Min Hu (Connor)
  2021-03-27  7:40 ` [dpdk-dev] [PATCH 1/3] examples/flow_classify: " Min Hu (Connor)
@ 2021-03-27  7:40 ` Min Hu (Connor)
  2021-03-27  7:40 ` [dpdk-dev] [PATCH 3/3] examples/skeleton: " Min Hu (Connor)
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 29+ messages in thread
From: Min Hu (Connor) @ 2021-03-27  7:40 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, bernard.iremonger, tomasz.kantecki, bruce.richardson

fix check of port and core in l2fwd-cat example.

Fixes: f6baccbc2b3b ("examples/l2fwd-cat: add sample application for PQoS CAT and CDP")
Cc: stable@dpdk.org

Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
---
 examples/l2fwd-cat/l2fwd-cat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/examples/l2fwd-cat/l2fwd-cat.c b/examples/l2fwd-cat/l2fwd-cat.c
index 2e632c5..2e74404 100644
--- a/examples/l2fwd-cat/l2fwd-cat.c
+++ b/examples/l2fwd-cat/l2fwd-cat.c
@@ -107,7 +107,7 @@ lcore_main(void)
 	 * for best performance.
 	 */
 	RTE_ETH_FOREACH_DEV(port)
-		if (rte_eth_dev_socket_id(port) > 0 &&
+		if (rte_eth_dev_socket_id(port) >= 0 &&
 				rte_eth_dev_socket_id(port) !=
 						(int)rte_socket_id())
 			printf("WARNING, port %u is on remote NUMA node to "
-- 
2.7.4


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

* [dpdk-dev] [PATCH 3/3] examples/skeleton: fix check of port and core
  2021-03-27  7:40 [dpdk-dev] [PATCH 0/3] fix check of port and core Min Hu (Connor)
  2021-03-27  7:40 ` [dpdk-dev] [PATCH 1/3] examples/flow_classify: " Min Hu (Connor)
  2021-03-27  7:40 ` [dpdk-dev] [PATCH 2/3] examples/l2fwd-cat: " Min Hu (Connor)
@ 2021-03-27  7:40 ` Min Hu (Connor)
  2021-04-10  9:14 ` [dpdk-dev] [PATCH 0/3] " Min Hu (Connor)
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 29+ messages in thread
From: Min Hu (Connor) @ 2021-03-27  7:40 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, bernard.iremonger, tomasz.kantecki, bruce.richardson

fix check of port and core in skeleton example.

Fixes: 7107e471a6c7 ("examples/skeleton: very simple code for packet forwarding")
Cc: stable@dpdk.org

Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
---
 examples/skeleton/basicfwd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/examples/skeleton/basicfwd.c b/examples/skeleton/basicfwd.c
index 4b2b6ab..bea0e55 100644
--- a/examples/skeleton/basicfwd.c
+++ b/examples/skeleton/basicfwd.c
@@ -122,7 +122,7 @@ lcore_main(void)
 	 * for best performance.
 	 */
 	RTE_ETH_FOREACH_DEV(port)
-		if (rte_eth_dev_socket_id(port) > 0 &&
+		if (rte_eth_dev_socket_id(port) >= 0 &&
 				rte_eth_dev_socket_id(port) !=
 						(int)rte_socket_id())
 			printf("WARNING, port %u is on remote NUMA node to "
-- 
2.7.4


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

* Re: [dpdk-dev] [PATCH 0/3] fix check of port and core
  2021-03-27  7:40 [dpdk-dev] [PATCH 0/3] fix check of port and core Min Hu (Connor)
                   ` (2 preceding siblings ...)
  2021-03-27  7:40 ` [dpdk-dev] [PATCH 3/3] examples/skeleton: " Min Hu (Connor)
@ 2021-04-10  9:14 ` Min Hu (Connor)
  2021-04-19  7:44   ` Min Hu (Connor)
  2021-04-21  7:00 ` [dpdk-dev] [PATCH v2 " Min Hu (Connor)
  2021-04-29  0:50 ` [dpdk-dev] [PATCH v3 0/3] " Min Hu (Connor)
  5 siblings, 1 reply; 29+ messages in thread
From: Min Hu (Connor) @ 2021-04-10  9:14 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, bernard.iremonger, tomasz.kantecki, bruce.richardson

Hi,Ferruh, bernard, tomasz, bruce and all,
	Any comments about this set of patches?

在 2021/3/27 15:40, Min Hu (Connor) 写道:
> Currently, some examples check that the port is on the same NUMA
> node as the polling thread for best performance. The method is
> to compare the socket id of port and that of current core. If the
> result is different, warning info will be given.
> 
> But it ignores the port which is from numa node 0, that is, no
> warning info will be given if the port is from numa node 0, and
> this set of patches will fix it.
> 
> Min Hu (Connor) (3):
>    examples/flow_classify: fix check of port and core
>    examples/l2fwd-cat: fix check of port and core
>    examples/skeleton: fix check of port and core
> 
>   examples/flow_classify/flow_classify.c | 2 +-
>   examples/l2fwd-cat/l2fwd-cat.c         | 2 +-
>   examples/skeleton/basicfwd.c           | 2 +-
>   3 files changed, 3 insertions(+), 3 deletions(-)
> 

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

* Re: [dpdk-dev] [PATCH 0/3] fix check of port and core
  2021-04-10  9:14 ` [dpdk-dev] [PATCH 0/3] " Min Hu (Connor)
@ 2021-04-19  7:44   ` Min Hu (Connor)
  0 siblings, 0 replies; 29+ messages in thread
From: Min Hu (Connor) @ 2021-04-19  7:44 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, bernard.iremonger, tomasz.kantecki, bruce.richardson

Hi,Ferruh, bernard, tomasz, bruce and all,
     Any comments about this set of patches?

在 2021/4/10 17:14, Min Hu (Connor) 写道:
> Hi,Ferruh, bernard, tomasz, bruce and all,
>      Any comments about this set of patches?
> 
> 在 2021/3/27 15:40, Min Hu (Connor) 写道:
>> Currently, some examples check that the port is on the same NUMA
>> node as the polling thread for best performance. The method is
>> to compare the socket id of port and that of current core. If the
>> result is different, warning info will be given.
>>
>> But it ignores the port which is from numa node 0, that is, no
>> warning info will be given if the port is from numa node 0, and
>> this set of patches will fix it.
>>
>> Min Hu (Connor) (3):
>>    examples/flow_classify: fix check of port and core
>>    examples/l2fwd-cat: fix check of port and core
>>    examples/skeleton: fix check of port and core
>>
>>   examples/flow_classify/flow_classify.c | 2 +-
>>   examples/l2fwd-cat/l2fwd-cat.c         | 2 +-
>>   examples/skeleton/basicfwd.c           | 2 +-
>>   3 files changed, 3 insertions(+), 3 deletions(-)
>>
> .

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

* Re: [dpdk-dev] [PATCH 1/3] examples/flow_classify: fix check of port and core
  2021-03-27  7:40 ` [dpdk-dev] [PATCH 1/3] examples/flow_classify: " Min Hu (Connor)
@ 2021-04-20  1:08   ` Thomas Monjalon
  2021-04-20  2:26     ` Min Hu (Connor)
  0 siblings, 1 reply; 29+ messages in thread
From: Thomas Monjalon @ 2021-04-20  1:08 UTC (permalink / raw)
  To: Min Hu (Connor)
  Cc: dev, ferruh.yigit, bernard.iremonger, tomasz.kantecki,
	bruce.richardson, anatoly.burakov, david.marchand

27/03/2021 08:40, Min Hu (Connor):
> fix check of port and core in flow_classify example.
> 
> Fixes: bab16ddaf2c1 ("examples/flow_classify: add sample application")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
> ---
>  	RTE_ETH_FOREACH_DEV(port)
> -		if (rte_eth_dev_socket_id(port) > 0 &&
> +		if (rte_eth_dev_socket_id(port) >= 0 &&
>  			rte_eth_dev_socket_id(port) != (int)rte_socket_id()) {
>  			printf("\n\n");
>  			printf("WARNING: port %u is on remote NUMA node\n",

Please explain which case is broken and why.
If I understand well, we don't detect remote NUMA if not running on first socket.



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

* Re: [dpdk-dev] [PATCH 1/3] examples/flow_classify: fix check of port and core
  2021-04-20  1:08   ` Thomas Monjalon
@ 2021-04-20  2:26     ` Min Hu (Connor)
  2021-04-20  9:40       ` Thomas Monjalon
  0 siblings, 1 reply; 29+ messages in thread
From: Min Hu (Connor) @ 2021-04-20  2:26 UTC (permalink / raw)
  To: Thomas Monjalon
  Cc: dev, ferruh.yigit, bernard.iremonger, tomasz.kantecki,
	bruce.richardson, anatoly.burakov, david.marchand



在 2021/4/20 9:08, Thomas Monjalon 写道:
> 27/03/2021 08:40, Min Hu (Connor):
>> fix check of port and core in flow_classify example.
>>
>> Fixes: bab16ddaf2c1 ("examples/flow_classify: add sample application")
>> Cc: stable@dpdk.org
>>
>> Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
>> ---
>>   	RTE_ETH_FOREACH_DEV(port)
>> -		if (rte_eth_dev_socket_id(port) > 0 &&
>> +		if (rte_eth_dev_socket_id(port) >= 0 &&
>>   			rte_eth_dev_socket_id(port) != (int)rte_socket_id()) {
>>   			printf("\n\n");
>>   			printf("WARNING: port %u is on remote NUMA node\n",
> 
> Please explain which case is broken and why.
> If I understand well, we don't detect remote NUMA if not running on first socket.
> 
Hi, the code is this:
*************************************************************************
	/*
	 * Check that the port is on the same NUMA node as the polling thread
	 * for best performance.
	 */
	RTE_ETH_FOREACH_DEV(port)
		if (rte_eth_dev_socket_id(port) > 0 &&
			rte_eth_dev_socket_id(port) != (int)rte_socket_id()) {
			printf("\n\n");
			printf("WARNING: port %u is on remote NUMA node\n",
			       port);
			printf("to polling thread.\n");
			printf("Performance will not be optimal.\n");
		}
	printf("\nCore %u forwarding packets. ", rte_lcore_id());
	printf("[Ctrl+C to quit]\n");
*************************************************************************

According to the comments and logging, the author just hope user to use
the core and device which are in the same numa node for optimal
performance. If not, A warning gives out.

For example in flow_classify:
./build/flow_classify -w 0000:7d:00.1  -l 93
Here:
0000:7d:00.1 is on numa node 0.
core 93  is on numa node 3.

the two are not in same numa node, but no warning gives out in old codes.

Well, using this patch, we can get the waring.

Thanks, Thomas.




> 
> .
> 

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

* Re: [dpdk-dev] [PATCH 1/3] examples/flow_classify: fix check of port and core
  2021-04-20  2:26     ` Min Hu (Connor)
@ 2021-04-20  9:40       ` Thomas Monjalon
  2021-04-27 11:51         ` Iremonger, Bernard
  0 siblings, 1 reply; 29+ messages in thread
From: Thomas Monjalon @ 2021-04-20  9:40 UTC (permalink / raw)
  To: Min Hu (Connor)
  Cc: dev, ferruh.yigit, bernard.iremonger, tomasz.kantecki,
	bruce.richardson, anatoly.burakov, david.marchand

20/04/2021 04:26, Min Hu (Connor):
> 2021/4/20 9:08, Thomas Monjalon:
> > 27/03/2021 08:40, Min Hu (Connor):
> >> fix check of port and core in flow_classify example.
> >>
> >> Fixes: bab16ddaf2c1 ("examples/flow_classify: add sample application")
> >> Cc: stable@dpdk.org
> >>
> >> Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
> >> ---
> >>   	RTE_ETH_FOREACH_DEV(port)
> >> -		if (rte_eth_dev_socket_id(port) > 0 &&
> >> +		if (rte_eth_dev_socket_id(port) >= 0 &&
> >>   			rte_eth_dev_socket_id(port) != (int)rte_socket_id()) {
> >>   			printf("\n\n");
> >>   			printf("WARNING: port %u is on remote NUMA node\n",
> > 
> > Please explain which case is broken and why.
> > If I understand well, we don't detect remote NUMA if not running on first socket.
> > 
> Hi, the code is this:
> *************************************************************************
> 	/*
> 	 * Check that the port is on the same NUMA node as the polling thread
> 	 * for best performance.
> 	 */
> 	RTE_ETH_FOREACH_DEV(port)
> 		if (rte_eth_dev_socket_id(port) > 0 &&
> 			rte_eth_dev_socket_id(port) != (int)rte_socket_id()) {
> 			printf("\n\n");
> 			printf("WARNING: port %u is on remote NUMA node\n",
> 			       port);
> 			printf("to polling thread.\n");
> 			printf("Performance will not be optimal.\n");
> 		}
> 	printf("\nCore %u forwarding packets. ", rte_lcore_id());
> 	printf("[Ctrl+C to quit]\n");
> *************************************************************************
> 
> According to the comments and logging, the author just hope user to use
> the core and device which are in the same numa node for optimal
> performance. If not, A warning gives out.
> 
> For example in flow_classify:
> ./build/flow_classify -w 0000:7d:00.1  -l 93
> Here:
> 0000:7d:00.1 is on numa node 0.
> core 93  is on numa node 3.
> 
> the two are not in same numa node, but no warning gives out in old codes.
> 
> Well, using this patch, we can get the waring.

You need to explain which case was broken in the commit log.
Thanks




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

* [dpdk-dev] [PATCH v2 0/3] fix check of port and core
  2021-03-27  7:40 [dpdk-dev] [PATCH 0/3] fix check of port and core Min Hu (Connor)
                   ` (3 preceding siblings ...)
  2021-04-10  9:14 ` [dpdk-dev] [PATCH 0/3] " Min Hu (Connor)
@ 2021-04-21  7:00 ` Min Hu (Connor)
  2021-04-21  7:00   ` [dpdk-dev] [PATCH v2 1/3] examples/flow_classify: " Min Hu (Connor)
                     ` (2 more replies)
  2021-04-29  0:50 ` [dpdk-dev] [PATCH v3 0/3] " Min Hu (Connor)
  5 siblings, 3 replies; 29+ messages in thread
From: Min Hu (Connor) @ 2021-04-21  7:00 UTC (permalink / raw)
  To: dev
  Cc: ferruh.yigit, bernard.iremonger, tomasz.kantecki,
	bruce.richardson, thomas

Currently, some examples check that the port is on the same NUMA
node as the polling thread for best performance. The method is
to compare the socket id of port and that of current core. If the
result is different, warning info will be given.

But it ignores the port which is from numa node 0, that is, no
warning info will be given if the port is from numa node 0, and
this set of patches will fix it.
---
v2:
* add more commit info.

Min Hu (Connor) (3):
  examples/flow_classify: fix check of port and core
  examples/l2fwd-cat: fix check of port and core
  examples/skeleton: fix check of port and core

 examples/flow_classify/flow_classify.c | 2 +-
 examples/l2fwd-cat/l2fwd-cat.c         | 2 +-
 examples/skeleton/basicfwd.c           | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

-- 
2.7.4


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

* [dpdk-dev] [PATCH v2 1/3] examples/flow_classify: fix check of port and core
  2021-04-21  7:00 ` [dpdk-dev] [PATCH v2 " Min Hu (Connor)
@ 2021-04-21  7:00   ` Min Hu (Connor)
  2021-04-28 13:29     ` Iremonger, Bernard
  2021-04-21  7:00   ` [dpdk-dev] [PATCH v2 2/3] examples/l2fwd-cat: " Min Hu (Connor)
  2021-04-21  7:00   ` [dpdk-dev] [PATCH v2 3/3] examples/skeleton: " Min Hu (Connor)
  2 siblings, 1 reply; 29+ messages in thread
From: Min Hu (Connor) @ 2021-04-21  7:00 UTC (permalink / raw)
  To: dev
  Cc: ferruh.yigit, bernard.iremonger, tomasz.kantecki,
	bruce.richardson, thomas

According to the comments and logging, the author just hope user to use
the core and device which are in the same numa node for optimal
performance. If not, A warning gives out.

For example in flow_classify:
./build/flow_classify -w 0000:7d:00.1  -l 93
Here:
0000:7d:00.1 is on numa node 0.
core 93  is on numa node 3.

The two are not in same numa node, but no warning gives out in old codes.

This patch can fix it.

Fixes: bab16ddaf2c1 ("examples/flow_classify: add sample application")
Cc: stable@dpdk.org

Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
---
 examples/flow_classify/flow_classify.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/examples/flow_classify/flow_classify.c b/examples/flow_classify/flow_classify.c
index 335d7d2..277a2f5 100644
--- a/examples/flow_classify/flow_classify.c
+++ b/examples/flow_classify/flow_classify.c
@@ -284,7 +284,7 @@ lcore_main(struct flow_classifier *cls_app)
 	 * for best performance.
 	 */
 	RTE_ETH_FOREACH_DEV(port)
-		if (rte_eth_dev_socket_id(port) > 0 &&
+		if (rte_eth_dev_socket_id(port) >= 0 &&
 			rte_eth_dev_socket_id(port) != (int)rte_socket_id()) {
 			printf("\n\n");
 			printf("WARNING: port %u is on remote NUMA node\n",
-- 
2.7.4


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

* [dpdk-dev] [PATCH v2 2/3] examples/l2fwd-cat: fix check of port and core
  2021-04-21  7:00 ` [dpdk-dev] [PATCH v2 " Min Hu (Connor)
  2021-04-21  7:00   ` [dpdk-dev] [PATCH v2 1/3] examples/flow_classify: " Min Hu (Connor)
@ 2021-04-21  7:00   ` Min Hu (Connor)
  2021-04-21  7:00   ` [dpdk-dev] [PATCH v2 3/3] examples/skeleton: " Min Hu (Connor)
  2 siblings, 0 replies; 29+ messages in thread
From: Min Hu (Connor) @ 2021-04-21  7:00 UTC (permalink / raw)
  To: dev
  Cc: ferruh.yigit, bernard.iremonger, tomasz.kantecki,
	bruce.richardson, thomas

According to the comments and logging, the author just hope user to use
the core and device which are in the same numa node for optimal
performance. If not, A warning gives out.

For example in flow_classify:
./build/flow_classify -w 0000:7d:00.1  -l 93
Here:
0000:7d:00.1 is on numa node 0.
core 93  is on numa node 3.

The two are not in same numa node, but no warning gives out in old codes.

This patch can fix it.

Fixes: f6baccbc2b3b ("examples/l2fwd-cat: add sample application for PQoS CAT and CDP")
Cc: stable@dpdk.org

Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
---
 examples/l2fwd-cat/l2fwd-cat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/examples/l2fwd-cat/l2fwd-cat.c b/examples/l2fwd-cat/l2fwd-cat.c
index 2e632c5..2e74404 100644
--- a/examples/l2fwd-cat/l2fwd-cat.c
+++ b/examples/l2fwd-cat/l2fwd-cat.c
@@ -107,7 +107,7 @@ lcore_main(void)
 	 * for best performance.
 	 */
 	RTE_ETH_FOREACH_DEV(port)
-		if (rte_eth_dev_socket_id(port) > 0 &&
+		if (rte_eth_dev_socket_id(port) >= 0 &&
 				rte_eth_dev_socket_id(port) !=
 						(int)rte_socket_id())
 			printf("WARNING, port %u is on remote NUMA node to "
-- 
2.7.4


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

* [dpdk-dev] [PATCH v2 3/3] examples/skeleton: fix check of port and core
  2021-04-21  7:00 ` [dpdk-dev] [PATCH v2 " Min Hu (Connor)
  2021-04-21  7:00   ` [dpdk-dev] [PATCH v2 1/3] examples/flow_classify: " Min Hu (Connor)
  2021-04-21  7:00   ` [dpdk-dev] [PATCH v2 2/3] examples/l2fwd-cat: " Min Hu (Connor)
@ 2021-04-21  7:00   ` Min Hu (Connor)
  2 siblings, 0 replies; 29+ messages in thread
From: Min Hu (Connor) @ 2021-04-21  7:00 UTC (permalink / raw)
  To: dev
  Cc: ferruh.yigit, bernard.iremonger, tomasz.kantecki,
	bruce.richardson, thomas

According to the comments and logging, the author just hope user to use
the core and device which are in the same numa node for optimal
performance. If not, A warning gives out.

For example in flow_classify:
./build/flow_classify -w 0000:7d:00.1  -l 93
Here:
0000:7d:00.1 is on numa node 0.
core 93  is on numa node 3.

The two are not in same numa node, but no warning gives out in old codes.

This patch can fix it.

Fixes: 7107e471a6c7 ("examples/skeleton: very simple code for packet forwarding")
Cc: stable@dpdk.org

Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
---
 examples/skeleton/basicfwd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/examples/skeleton/basicfwd.c b/examples/skeleton/basicfwd.c
index 4b2b6ab..bea0e55 100644
--- a/examples/skeleton/basicfwd.c
+++ b/examples/skeleton/basicfwd.c
@@ -122,7 +122,7 @@ lcore_main(void)
 	 * for best performance.
 	 */
 	RTE_ETH_FOREACH_DEV(port)
-		if (rte_eth_dev_socket_id(port) > 0 &&
+		if (rte_eth_dev_socket_id(port) >= 0 &&
 				rte_eth_dev_socket_id(port) !=
 						(int)rte_socket_id())
 			printf("WARNING, port %u is on remote NUMA node to "
-- 
2.7.4


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

* Re: [dpdk-dev] [PATCH 1/3] examples/flow_classify: fix check of port and core
  2021-04-20  9:40       ` Thomas Monjalon
@ 2021-04-27 11:51         ` Iremonger, Bernard
  2021-04-27 12:23           ` Min Hu (Connor)
  0 siblings, 1 reply; 29+ messages in thread
From: Iremonger, Bernard @ 2021-04-27 11:51 UTC (permalink / raw)
  To: Thomas Monjalon, Min Hu (Connor)
  Cc: dev, Yigit, Ferruh, Kantecki, Tomasz, Richardson, Bruce, Burakov,
	Anatoly, david.marchand

Hi Min,

> -----Original Message-----
> From: Thomas Monjalon <thomas@monjalon.net>
> Sent: Tuesday, April 20, 2021 10:41 AM
> To: Min Hu (Connor) <humin29@huawei.com>
> Cc: dev@dpdk.org; Yigit, Ferruh <ferruh.yigit@intel.com>; Iremonger,
> Bernard <bernard.iremonger@intel.com>; Kantecki, Tomasz
> <tomasz.kantecki@intel.com>; Richardson, Bruce
> <bruce.richardson@intel.com>; Burakov, Anatoly
> <anatoly.burakov@intel.com>; david.marchand@redhat.com
> Subject: Re: [dpdk-dev] [PATCH 1/3] examples/flow_classify: fix check of
> port and core
> 
> 20/04/2021 04:26, Min Hu (Connor):
> > 2021/4/20 9:08, Thomas Monjalon:
> > > 27/03/2021 08:40, Min Hu (Connor):
> > >> fix check of port and core in flow_classify example.
> > >>
> > >> Fixes: bab16ddaf2c1 ("examples/flow_classify: add sample
> > >> application")
> > >> Cc: stable@dpdk.org
> > >>
> > >> Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
> > >> ---
> > >>   	RTE_ETH_FOREACH_DEV(port)
> > >> -		if (rte_eth_dev_socket_id(port) > 0 &&
> > >> +		if (rte_eth_dev_socket_id(port) >= 0 &&

This fix works (I have tested it on my system)
However a cleaner fix would be to drop the above line and add the if on the next line instead (also tested on my system).

If (rte_eth_dev_socket_id(port) != (int)rte_socket_id())

> > >>   			rte_eth_dev_socket_id(port) != (int)rte_socket_id())
> {
> > >>   			printf("\n\n");
> > >>   			printf("WARNING: port %u is on remote NUMA
> node\n",
> > >
> > > Please explain which case is broken and why.
> > > If I understand well, we don't detect remote NUMA if not running on first
> socket.
> > >
> > Hi, the code is this:
> >
> **********************************************************
> ***************
> > 	/*
> > 	 * Check that the port is on the same NUMA node as the polling
> thread
> > 	 * for best performance.
> > 	 */
> > 	RTE_ETH_FOREACH_DEV(port)
> > 		if (rte_eth_dev_socket_id(port) > 0 &&
> > 			rte_eth_dev_socket_id(port) != (int)rte_socket_id())
> {
> > 			printf("\n\n");
> > 			printf("WARNING: port %u is on remote NUMA
> node\n",
> > 			       port);
> > 			printf("to polling thread.\n");
> > 			printf("Performance will not be optimal.\n");
> > 		}
> > 	printf("\nCore %u forwarding packets. ", rte_lcore_id());
> > 	printf("[Ctrl+C to quit]\n");
> >
> **********************************************************
> ************
> > ***
> >
> > According to the comments and logging, the author just hope user to
> > use the core and device which are in the same numa node for optimal
> > performance. If not, A warning gives out.
> >
> > For example in flow_classify:
> > ./build/flow_classify -w 0000:7d:00.1  -l 93
> > Here:
> > 0000:7d:00.1 is on numa node 0.
> > core 93  is on numa node 3.
> >
> > the two are not in same numa node, but no warning gives out in old codes.
> >
> > Well, using this patch, we can get the waring.
> 
> You need to explain which case was broken in the commit log.
> Thanks
> 
> 
Regards,

Bernard.

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

* Re: [dpdk-dev] [PATCH 1/3] examples/flow_classify: fix check of port and core
  2021-04-27 11:51         ` Iremonger, Bernard
@ 2021-04-27 12:23           ` Min Hu (Connor)
  2021-04-27 13:06             ` Iremonger, Bernard
  0 siblings, 1 reply; 29+ messages in thread
From: Min Hu (Connor) @ 2021-04-27 12:23 UTC (permalink / raw)
  To: Iremonger, Bernard, Thomas Monjalon
  Cc: dev, Yigit, Ferruh, Kantecki, Tomasz, Richardson, Bruce, Burakov,
	Anatoly, david.marchand



在 2021/4/27 19:51, Iremonger, Bernard 写道:
> Hi Min,
> 
>> -----Original Message-----
>> From: Thomas Monjalon <thomas@monjalon.net>
>> Sent: Tuesday, April 20, 2021 10:41 AM
>> To: Min Hu (Connor) <humin29@huawei.com>
>> Cc: dev@dpdk.org; Yigit, Ferruh <ferruh.yigit@intel.com>; Iremonger,
>> Bernard <bernard.iremonger@intel.com>; Kantecki, Tomasz
>> <tomasz.kantecki@intel.com>; Richardson, Bruce
>> <bruce.richardson@intel.com>; Burakov, Anatoly
>> <anatoly.burakov@intel.com>; david.marchand@redhat.com
>> Subject: Re: [dpdk-dev] [PATCH 1/3] examples/flow_classify: fix check of
>> port and core
>>
>> 20/04/2021 04:26, Min Hu (Connor):
>>> 2021/4/20 9:08, Thomas Monjalon:
>>>> 27/03/2021 08:40, Min Hu (Connor):
>>>>> fix check of port and core in flow_classify example.
>>>>>
>>>>> Fixes: bab16ddaf2c1 ("examples/flow_classify: add sample
>>>>> application")
>>>>> Cc: stable@dpdk.org
>>>>>
>>>>> Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
>>>>> ---
>>>>>    	RTE_ETH_FOREACH_DEV(port)
>>>>> -		if (rte_eth_dev_socket_id(port) > 0 &&
>>>>> +		if (rte_eth_dev_socket_id(port) >= 0 &&
> 
> This fix works (I have tested it on my system)
> However a cleaner fix would be to drop the above line and add the if on the next line instead (also tested on my system).
> 
Hi, 'rte_eth_dev_socket_id(port)' may return -1,  we should avoid this
situation.

> If (rte_eth_dev_socket_id(port) != (int)rte_socket_id())
> 
>>>>>    			rte_eth_dev_socket_id(port) != (int)rte_socket_id())
>> {
>>>>>    			printf("\n\n");
>>>>>    			printf("WARNING: port %u is on remote NUMA
>> node\n",
>>>>
>>>> Please explain which case is broken and why.
>>>> If I understand well, we don't detect remote NUMA if not running on first
>> socket.
>>>>
>>> Hi, the code is this:
>>>
>> **********************************************************
>> ***************
>>> 	/*
>>> 	 * Check that the port is on the same NUMA node as the polling
>> thread
>>> 	 * for best performance.
>>> 	 */
>>> 	RTE_ETH_FOREACH_DEV(port)
>>> 		if (rte_eth_dev_socket_id(port) > 0 &&
>>> 			rte_eth_dev_socket_id(port) != (int)rte_socket_id())
>> {
>>> 			printf("\n\n");
>>> 			printf("WARNING: port %u is on remote NUMA
>> node\n",
>>> 			       port);
>>> 			printf("to polling thread.\n");
>>> 			printf("Performance will not be optimal.\n");
>>> 		}
>>> 	printf("\nCore %u forwarding packets. ", rte_lcore_id());
>>> 	printf("[Ctrl+C to quit]\n");
>>>
>> **********************************************************
>> ************
>>> ***
>>>
>>> According to the comments and logging, the author just hope user to
>>> use the core and device which are in the same numa node for optimal
>>> performance. If not, A warning gives out.
>>>
>>> For example in flow_classify:
>>> ./build/flow_classify -w 0000:7d:00.1  -l 93
>>> Here:
>>> 0000:7d:00.1 is on numa node 0.
>>> core 93  is on numa node 3.
>>>
>>> the two are not in same numa node, but no warning gives out in old codes.
>>>
>>> Well, using this patch, we can get the waring.
>>
>> You need to explain which case was broken in the commit log.
>> Thanks
>>
>>
> Regards,
> 
> Bernard.
> .
> 

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

* Re: [dpdk-dev] [PATCH 1/3] examples/flow_classify: fix check of port and core
  2021-04-27 12:23           ` Min Hu (Connor)
@ 2021-04-27 13:06             ` Iremonger, Bernard
  2021-04-28  9:26               ` Iremonger, Bernard
  0 siblings, 1 reply; 29+ messages in thread
From: Iremonger, Bernard @ 2021-04-27 13:06 UTC (permalink / raw)
  To: Min Hu (Connor), Thomas Monjalon
  Cc: dev, Yigit, Ferruh, Kantecki, Tomasz, Richardson, Bruce, Burakov,
	Anatoly, david.marchand

Hi Min,

> -----Original Message-----
> From: Min Hu (Connor) <humin29@huawei.com>
> Sent: Tuesday, April 27, 2021 1:23 PM
> To: Iremonger, Bernard <bernard.iremonger@intel.com>; Thomas Monjalon
> <thomas@monjalon.net>
> Cc: dev@dpdk.org; Yigit, Ferruh <ferruh.yigit@intel.com>; Kantecki, Tomasz
> <tomasz.kantecki@intel.com>; Richardson, Bruce
> <bruce.richardson@intel.com>; Burakov, Anatoly
> <anatoly.burakov@intel.com>; david.marchand@redhat.com
> Subject: Re: [dpdk-dev] [PATCH 1/3] examples/flow_classify: fix check of
> port and core
> 
> 
> 
> 在 2021/4/27 19:51, Iremonger, Bernard 写道:
> > Hi Min,
> >
> >> -----Original Message-----
> >> From: Thomas Monjalon <thomas@monjalon.net>
> >> Sent: Tuesday, April 20, 2021 10:41 AM
> >> To: Min Hu (Connor) <humin29@huawei.com>
> >> Cc: dev@dpdk.org; Yigit, Ferruh <ferruh.yigit@intel.com>; Iremonger,
> >> Bernard <bernard.iremonger@intel.com>; Kantecki, Tomasz
> >> <tomasz.kantecki@intel.com>; Richardson, Bruce
> >> <bruce.richardson@intel.com>; Burakov, Anatoly
> >> <anatoly.burakov@intel.com>; david.marchand@redhat.com
> >> Subject: Re: [dpdk-dev] [PATCH 1/3] examples/flow_classify: fix check
> >> of port and core
> >>
> >> 20/04/2021 04:26, Min Hu (Connor):
> >>> 2021/4/20 9:08, Thomas Monjalon:
> >>>> 27/03/2021 08:40, Min Hu (Connor):
> >>>>> fix check of port and core in flow_classify example.
> >>>>>
> >>>>> Fixes: bab16ddaf2c1 ("examples/flow_classify: add sample
> >>>>> application")
> >>>>> Cc: stable@dpdk.org
> >>>>>
> >>>>> Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
> >>>>> ---
> >>>>>    	RTE_ETH_FOREACH_DEV(port)
> >>>>> -		if (rte_eth_dev_socket_id(port) > 0 &&
> >>>>> +		if (rte_eth_dev_socket_id(port) >= 0 &&
> >
> > This fix works (I have tested it on my system) However a cleaner fix
> > would be to drop the above line and add the if on the next line instead
> (also tested on my system).
> >
> Hi, 'rte_eth_dev_socket_id(port)' may return -1,  we should avoid this
> situation.

Agreed.
Original fix is good.

> 
> > If (rte_eth_dev_socket_id(port) != (int)rte_socket_id())
> >
> >>>>>    			rte_eth_dev_socket_id(port) !=
> (int)rte_socket_id())
> >> {
> >>>>>    			printf("\n\n");
> >>>>>    			printf("WARNING: port %u is on remote
> NUMA
> >> node\n",
> >>>>
> >>>> Please explain which case is broken and why.
> >>>> If I understand well, we don't detect remote NUMA if not running on
> >>>> first
> >> socket.
> >>>>
> >>> Hi, the code is this:
> >>>
> >>
> **********************************************************
> >> ***************
> >>> 	/*
> >>> 	 * Check that the port is on the same NUMA node as the polling
> >> thread
> >>> 	 * for best performance.
> >>> 	 */
> >>> 	RTE_ETH_FOREACH_DEV(port)
> >>> 		if (rte_eth_dev_socket_id(port) > 0 &&
> >>> 			rte_eth_dev_socket_id(port) != (int)rte_socket_id())
> >> {
> >>> 			printf("\n\n");
> >>> 			printf("WARNING: port %u is on remote NUMA
> >> node\n",
> >>> 			       port);
> >>> 			printf("to polling thread.\n");
> >>> 			printf("Performance will not be optimal.\n");
> >>> 		}
> >>> 	printf("\nCore %u forwarding packets. ", rte_lcore_id());
> >>> 	printf("[Ctrl+C to quit]\n");
> >>>
> >>
> **********************************************************
> >> ************
> >>> ***
> >>>
> >>> According to the comments and logging, the author just hope user to
> >>> use the core and device which are in the same numa node for optimal
> >>> performance. If not, A warning gives out.
> >>>
> >>> For example in flow_classify:
> >>> ./build/flow_classify -w 0000:7d:00.1  -l 93
> >>> Here:
> >>> 0000:7d:00.1 is on numa node 0.
> >>> core 93  is on numa node 3.
> >>>
> >>> the two are not in same numa node, but no warning gives out in old
> codes.
> >>>
> >>> Well, using this patch, we can get the waring.
> >>
> >> You need to explain which case was broken in the commit log.
> >> Thanks
> >>
> >>
> > Regards,
> >
> > Bernard.
> > .
> >

Regards,

Bernard.


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

* Re: [dpdk-dev] [PATCH 1/3] examples/flow_classify: fix check of port and core
  2021-04-27 13:06             ` Iremonger, Bernard
@ 2021-04-28  9:26               ` Iremonger, Bernard
  0 siblings, 0 replies; 29+ messages in thread
From: Iremonger, Bernard @ 2021-04-28  9:26 UTC (permalink / raw)
  To: Iremonger, Bernard, Min Hu (Connor), Thomas Monjalon
  Cc: dev, Yigit, Ferruh, Kantecki, Tomasz, Richardson, Bruce, Burakov,
	Anatoly, david.marchand

Hi Min,

<snip>

> > >>>
> > >>> According to the comments and logging, the author just hope user
> > >>> to use the core and device which are in the same numa node for
> > >>> optimal performance. If not, A warning gives out.
> > >>>
> > >>> For example in flow_classify:
> > >>> ./build/flow_classify -w 0000:7d:00.1  -l 93

The EAL option "-w" has been replaced by the "-a" option  in dpdk-20.05

> > >>> Here:
> > >>> 0000:7d:00.1 is on numa node 0.
> > >>> core 93  is on numa node 3.
> > >>>
> > >>> the two are not in same numa node, but no warning gives out in old
> > codes.
> > >>>
> > >>> Well, using this patch, we can get the waring.
> > >>
> > >> You need to explain which case was broken in the commit log.
> > >> Thanks

Regards,
 
 Bernard.


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

* Re: [dpdk-dev] [PATCH v2 1/3] examples/flow_classify: fix check of port and core
  2021-04-21  7:00   ` [dpdk-dev] [PATCH v2 1/3] examples/flow_classify: " Min Hu (Connor)
@ 2021-04-28 13:29     ` Iremonger, Bernard
  2021-04-29  0:51       ` Min Hu (Connor)
  0 siblings, 1 reply; 29+ messages in thread
From: Iremonger, Bernard @ 2021-04-28 13:29 UTC (permalink / raw)
  To: Min Hu (Connor), dev
  Cc: Yigit, Ferruh, Kantecki, Tomasz, Richardson, Bruce, thomas

Hi Min,

> -----Original Message-----
> From: Min Hu (Connor) <humin29@huawei.com>
> Sent: Wednesday, April 21, 2021 8:00 AM
> To: dev@dpdk.org
> Cc: Yigit, Ferruh <ferruh.yigit@intel.com>; Iremonger, Bernard
> <bernard.iremonger@intel.com>; Kantecki, Tomasz
> <tomasz.kantecki@intel.com>; Richardson, Bruce
> <bruce.richardson@intel.com>; thomas@monjalon.net
> Subject: [PATCH v2 1/3] examples/flow_classify: fix check of port and core
> 
> According to the comments and logging, the author just hope user to use the
> core and device which are in the same numa node for optimal performance.
> If not, A warning gives out.
> 
> For example in flow_classify:
> ./build/flow_classify -w 0000:7d:00.1  -l 93

The EAL option "-w" has been replaced by the "-a" option  in dpdk-20.05

> Here:
> 0000:7d:00.1 is on numa node 0.
> core 93  is on numa node 3.
> 
> The two are not in same numa node, but no warning gives out in old codes.
> 
> This patch can fix it.
> 
> Fixes: bab16ddaf2c1 ("examples/flow_classify: add sample application")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
> ---
>  examples/flow_classify/flow_classify.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/examples/flow_classify/flow_classify.c
> b/examples/flow_classify/flow_classify.c
> index 335d7d2..277a2f5 100644
> --- a/examples/flow_classify/flow_classify.c
> +++ b/examples/flow_classify/flow_classify.c
> @@ -284,7 +284,7 @@ lcore_main(struct flow_classifier *cls_app)
>  	 * for best performance.
>  	 */
>  	RTE_ETH_FOREACH_DEV(port)
> -		if (rte_eth_dev_socket_id(port) > 0 &&
> +		if (rte_eth_dev_socket_id(port) >= 0 &&
>  			rte_eth_dev_socket_id(port) != (int)rte_socket_id())
> {
>  			printf("\n\n");
>  			printf("WARNING: port %u is on remote NUMA
> node\n",
> --
> 2.7.4

Tested-by: Bernard Iremonger <bernard.iremonger@intel.com>

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

* [dpdk-dev] [PATCH v3 0/3] fix check of port and core
  2021-03-27  7:40 [dpdk-dev] [PATCH 0/3] fix check of port and core Min Hu (Connor)
                   ` (4 preceding siblings ...)
  2021-04-21  7:00 ` [dpdk-dev] [PATCH v2 " Min Hu (Connor)
@ 2021-04-29  0:50 ` Min Hu (Connor)
  2021-04-29  0:50   ` [dpdk-dev] [PATCH v3 1/3] examples/flow_classify: " Min Hu (Connor)
                     ` (3 more replies)
  5 siblings, 4 replies; 29+ messages in thread
From: Min Hu (Connor) @ 2021-04-29  0:50 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, bernard.iremonger, thomas

Currently, some examples check that the port is on the same NUMA
node as the polling thread for best performance. The method is
to compare the socket id of port and that of current core. If the
result is different, warning info will be given.

But it ignores the port which is from numa node 0, that is, no
warning info will be given if the port is from numa node 0, and
this set of patches will fix it.
---
v3:
* change "-w" to "-a".

v2:
* add more commit info.

Min Hu (Connor) (3):
  examples/flow_classify: fix check of port and core
  examples/l2fwd-cat: fix check of port and core
  examples/skeleton: fix check of port and core

 examples/flow_classify/flow_classify.c | 2 +-
 examples/l2fwd-cat/l2fwd-cat.c         | 2 +-
 examples/skeleton/basicfwd.c           | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

-- 
2.7.4


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

* [dpdk-dev] [PATCH v3 1/3] examples/flow_classify: fix check of port and core
  2021-04-29  0:50 ` [dpdk-dev] [PATCH v3 0/3] " Min Hu (Connor)
@ 2021-04-29  0:50   ` Min Hu (Connor)
  2021-04-29  9:07     ` Iremonger, Bernard
  2021-04-29  0:50   ` [dpdk-dev] [PATCH v3 2/3] examples/l2fwd-cat: " Min Hu (Connor)
                     ` (2 subsequent siblings)
  3 siblings, 1 reply; 29+ messages in thread
From: Min Hu (Connor) @ 2021-04-29  0:50 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, bernard.iremonger, thomas

According to the comments and logging, the author just hope user to use
the core and device which are in the same numa node for optimal
performance. If not, A warning gives out.

For example in flow_classify:
./build/flow_classify -a 0000:7d:00.1  -l 93
Here:
0000:7d:00.1 is on numa node 0.
core 93  is on numa node 3.

The two are not in same numa node, but no warning gives out in old codes.

This patch can fix it.

Fixes: bab16ddaf2c1 ("examples/flow_classify: add sample application")
Cc: stable@dpdk.org

Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
---
 examples/flow_classify/flow_classify.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/examples/flow_classify/flow_classify.c b/examples/flow_classify/flow_classify.c
index 335d7d2..277a2f5 100644
--- a/examples/flow_classify/flow_classify.c
+++ b/examples/flow_classify/flow_classify.c
@@ -284,7 +284,7 @@ lcore_main(struct flow_classifier *cls_app)
 	 * for best performance.
 	 */
 	RTE_ETH_FOREACH_DEV(port)
-		if (rte_eth_dev_socket_id(port) > 0 &&
+		if (rte_eth_dev_socket_id(port) >= 0 &&
 			rte_eth_dev_socket_id(port) != (int)rte_socket_id()) {
 			printf("\n\n");
 			printf("WARNING: port %u is on remote NUMA node\n",
-- 
2.7.4


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

* [dpdk-dev] [PATCH v3 2/3] examples/l2fwd-cat: fix check of port and core
  2021-04-29  0:50 ` [dpdk-dev] [PATCH v3 0/3] " Min Hu (Connor)
  2021-04-29  0:50   ` [dpdk-dev] [PATCH v3 1/3] examples/flow_classify: " Min Hu (Connor)
@ 2021-04-29  0:50   ` Min Hu (Connor)
  2021-04-29  0:50   ` [dpdk-dev] [PATCH v3 3/3] examples/skeleton: " Min Hu (Connor)
  2021-05-12 16:52   ` [dpdk-dev] [PATCH v3 0/3] " Ferruh Yigit
  3 siblings, 0 replies; 29+ messages in thread
From: Min Hu (Connor) @ 2021-04-29  0:50 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, bernard.iremonger, thomas

According to the comments and logging, the author just hope user to use
the core and device which are in the same numa node for optimal
performance. If not, A warning gives out.

For example in flow_classify:
./build/flow_classify -a 0000:7d:00.1  -l 93
Here:
0000:7d:00.1 is on numa node 0.
core 93  is on numa node 3.

The two are not in same numa node, but no warning gives out in old codes.

This patch can fix it.

Fixes: f6baccbc2b3b ("examples/l2fwd-cat: add sample application for PQoS CAT and CDP")
Cc: stable@dpdk.org

Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
---
 examples/l2fwd-cat/l2fwd-cat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/examples/l2fwd-cat/l2fwd-cat.c b/examples/l2fwd-cat/l2fwd-cat.c
index 2e632c5..2e74404 100644
--- a/examples/l2fwd-cat/l2fwd-cat.c
+++ b/examples/l2fwd-cat/l2fwd-cat.c
@@ -107,7 +107,7 @@ lcore_main(void)
 	 * for best performance.
 	 */
 	RTE_ETH_FOREACH_DEV(port)
-		if (rte_eth_dev_socket_id(port) > 0 &&
+		if (rte_eth_dev_socket_id(port) >= 0 &&
 				rte_eth_dev_socket_id(port) !=
 						(int)rte_socket_id())
 			printf("WARNING, port %u is on remote NUMA node to "
-- 
2.7.4


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

* [dpdk-dev] [PATCH v3 3/3] examples/skeleton: fix check of port and core
  2021-04-29  0:50 ` [dpdk-dev] [PATCH v3 0/3] " Min Hu (Connor)
  2021-04-29  0:50   ` [dpdk-dev] [PATCH v3 1/3] examples/flow_classify: " Min Hu (Connor)
  2021-04-29  0:50   ` [dpdk-dev] [PATCH v3 2/3] examples/l2fwd-cat: " Min Hu (Connor)
@ 2021-04-29  0:50   ` Min Hu (Connor)
  2021-05-12 16:52   ` [dpdk-dev] [PATCH v3 0/3] " Ferruh Yigit
  3 siblings, 0 replies; 29+ messages in thread
From: Min Hu (Connor) @ 2021-04-29  0:50 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, bernard.iremonger, thomas

According to the comments and logging, the author just hope user to use
the core and device which are in the same numa node for optimal
performance. If not, A warning gives out.

For example in flow_classify:
./build/flow_classify -a 0000:7d:00.1  -l 93
Here:
0000:7d:00.1 is on numa node 0.
core 93  is on numa node 3.

The two are not in same numa node, but no warning gives out in old codes.

This patch can fix it.

Fixes: 7107e471a6c7 ("examples/skeleton: very simple code for packet forwarding")
Cc: stable@dpdk.org

Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
---
 examples/skeleton/basicfwd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/examples/skeleton/basicfwd.c b/examples/skeleton/basicfwd.c
index 4b2b6ab..bea0e55 100644
--- a/examples/skeleton/basicfwd.c
+++ b/examples/skeleton/basicfwd.c
@@ -122,7 +122,7 @@ lcore_main(void)
 	 * for best performance.
 	 */
 	RTE_ETH_FOREACH_DEV(port)
-		if (rte_eth_dev_socket_id(port) > 0 &&
+		if (rte_eth_dev_socket_id(port) >= 0 &&
 				rte_eth_dev_socket_id(port) !=
 						(int)rte_socket_id())
 			printf("WARNING, port %u is on remote NUMA node to "
-- 
2.7.4


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

* Re: [dpdk-dev] [PATCH v2 1/3] examples/flow_classify: fix check of port and core
  2021-04-28 13:29     ` Iremonger, Bernard
@ 2021-04-29  0:51       ` Min Hu (Connor)
  0 siblings, 0 replies; 29+ messages in thread
From: Min Hu (Connor) @ 2021-04-29  0:51 UTC (permalink / raw)
  To: Iremonger, Bernard, dev
  Cc: Yigit, Ferruh, Kantecki, Tomasz, Richardson, Bruce, thomas



在 2021/4/28 21:29, Iremonger, Bernard 写道:
> Hi Min,
> 
>> -----Original Message-----
>> From: Min Hu (Connor) <humin29@huawei.com>
>> Sent: Wednesday, April 21, 2021 8:00 AM
>> To: dev@dpdk.org
>> Cc: Yigit, Ferruh <ferruh.yigit@intel.com>; Iremonger, Bernard
>> <bernard.iremonger@intel.com>; Kantecki, Tomasz
>> <tomasz.kantecki@intel.com>; Richardson, Bruce
>> <bruce.richardson@intel.com>; thomas@monjalon.net
>> Subject: [PATCH v2 1/3] examples/flow_classify: fix check of port and core
>>
>> According to the comments and logging, the author just hope user to use the
>> core and device which are in the same numa node for optimal performance.
>> If not, A warning gives out.
>>
>> For example in flow_classify:
>> ./build/flow_classify -w 0000:7d:00.1  -l 93
> 
> The EAL option "-w" has been replaced by the "-a" option  in dpdk-20.05
> 
Hi, thanks Iremonger, fixed in v3.
>> Here:
>> 0000:7d:00.1 is on numa node 0.
>> core 93  is on numa node 3.
>>
>> The two are not in same numa node, but no warning gives out in old codes.
>>
>> This patch can fix it.
>>
>> Fixes: bab16ddaf2c1 ("examples/flow_classify: add sample application")
>> Cc: stable@dpdk.org
>>
>> Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
>> ---
>>   examples/flow_classify/flow_classify.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/examples/flow_classify/flow_classify.c
>> b/examples/flow_classify/flow_classify.c
>> index 335d7d2..277a2f5 100644
>> --- a/examples/flow_classify/flow_classify.c
>> +++ b/examples/flow_classify/flow_classify.c
>> @@ -284,7 +284,7 @@ lcore_main(struct flow_classifier *cls_app)
>>   	 * for best performance.
>>   	 */
>>   	RTE_ETH_FOREACH_DEV(port)
>> -		if (rte_eth_dev_socket_id(port) > 0 &&
>> +		if (rte_eth_dev_socket_id(port) >= 0 &&
>>   			rte_eth_dev_socket_id(port) != (int)rte_socket_id())
>> {
>>   			printf("\n\n");
>>   			printf("WARNING: port %u is on remote NUMA
>> node\n",
>> --
>> 2.7.4
> 
> Tested-by: Bernard Iremonger <bernard.iremonger@intel.com>
> .
> 

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

* Re: [dpdk-dev] [PATCH v3 1/3] examples/flow_classify: fix check of port and core
  2021-04-29  0:50   ` [dpdk-dev] [PATCH v3 1/3] examples/flow_classify: " Min Hu (Connor)
@ 2021-04-29  9:07     ` Iremonger, Bernard
  2021-04-29  9:37       ` Min Hu (Connor)
  0 siblings, 1 reply; 29+ messages in thread
From: Iremonger, Bernard @ 2021-04-29  9:07 UTC (permalink / raw)
  To: Min Hu (Connor), dev; +Cc: Yigit, Ferruh, thomas

> -----Original Message-----
> From: Min Hu (Connor) <humin29@huawei.com>
> Sent: Thursday, April 29, 2021 1:51 AM
> To: dev@dpdk.org
> Cc: Yigit, Ferruh <ferruh.yigit@intel.com>; Iremonger, Bernard
> <bernard.iremonger@intel.com>; thomas@monjalon.net
> Subject: [PATCH v3 1/3] examples/flow_classify: fix check of port and core
> 
> According to the comments and logging, the author just hope user to use the
> core and device which are in the same numa node for optimal performance.
> If not, A warning gives out.
> 
> For example in flow_classify:
> ./build/flow_classify -a 0000:7d:00.1  -l 93
> Here:
> 0000:7d:00.1 is on numa node 0.
> core 93  is on numa node 3.
> 
> The two are not in same numa node, but no warning gives out in old codes.
> 
> This patch can fix it.
> 
> Fixes: bab16ddaf2c1 ("examples/flow_classify: add sample application")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Min Hu (Connor) <humin29@huawei.com>

Tested-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>


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

* Re: [dpdk-dev] [PATCH v3 1/3] examples/flow_classify: fix check of port and core
  2021-04-29  9:07     ` Iremonger, Bernard
@ 2021-04-29  9:37       ` Min Hu (Connor)
  2021-04-29 11:44         ` Thomas Monjalon
  0 siblings, 1 reply; 29+ messages in thread
From: Min Hu (Connor) @ 2021-04-29  9:37 UTC (permalink / raw)
  To: Iremonger, Bernard, dev; +Cc: Yigit, Ferruh, thomas

Thanks Bernard .

Hi, Thomas, Ferruh, any other comments?

在 2021/4/29 17:07, Iremonger, Bernard 写道:
>> -----Original Message-----
>> From: Min Hu (Connor) <humin29@huawei.com>
>> Sent: Thursday, April 29, 2021 1:51 AM
>> To: dev@dpdk.org
>> Cc: Yigit, Ferruh <ferruh.yigit@intel.com>; Iremonger, Bernard
>> <bernard.iremonger@intel.com>; thomas@monjalon.net
>> Subject: [PATCH v3 1/3] examples/flow_classify: fix check of port and core
>>
>> According to the comments and logging, the author just hope user to use the
>> core and device which are in the same numa node for optimal performance.
>> If not, A warning gives out.
>>
>> For example in flow_classify:
>> ./build/flow_classify -a 0000:7d:00.1  -l 93
>> Here:
>> 0000:7d:00.1 is on numa node 0.
>> core 93  is on numa node 3.
>>
>> The two are not in same numa node, but no warning gives out in old codes.
>>
>> This patch can fix it.
>>
>> Fixes: bab16ddaf2c1 ("examples/flow_classify: add sample application")
>> Cc: stable@dpdk.org
>>
>> Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
> 
> Tested-by: Bernard Iremonger <bernard.iremonger@intel.com>
> Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
> 
> .
> 

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

* Re: [dpdk-dev] [PATCH v3 1/3] examples/flow_classify: fix check of port and core
  2021-04-29  9:37       ` Min Hu (Connor)
@ 2021-04-29 11:44         ` Thomas Monjalon
  2021-04-29 12:15           ` Min Hu (Connor)
  0 siblings, 1 reply; 29+ messages in thread
From: Thomas Monjalon @ 2021-04-29 11:44 UTC (permalink / raw)
  To: Min Hu (Connor); +Cc: Iremonger, Bernard, dev, Yigit, Ferruh

Hi,

29/04/2021 11:37, Min Hu (Connor):
> Thanks Bernard .
> 
> Hi, Thomas, Ferruh, any other comments?

No need to ask for more comments after each ack.
We are very busy and we'll come to this patch on time.
You are sending a lot of fixes. That's very good
but we need time to digest them :)
Thanks



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

* Re: [dpdk-dev] [PATCH v3 1/3] examples/flow_classify: fix check of port and core
  2021-04-29 11:44         ` Thomas Monjalon
@ 2021-04-29 12:15           ` Min Hu (Connor)
  0 siblings, 0 replies; 29+ messages in thread
From: Min Hu (Connor) @ 2021-04-29 12:15 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: Iremonger, Bernard, dev, Yigit, Ferruh



在 2021/4/29 19:44, Thomas Monjalon 写道:
> Hi,
> 
> 29/04/2021 11:37, Min Hu (Connor):
>> Thanks Bernard .
>>
>> Hi, Thomas, Ferruh, any other comments?
> 
> No need to ask for more comments after each ack.
> We are very busy and we'll come to this patch on time.
> You are sending a lot of fixes. That's very good
> but we need time to digest them :)
> Thanks
> 
Hi, Thomas,
	Sorry for that. I will be waiting more patiently in future.
	Thanks.
> 
> .
> 

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

* Re: [dpdk-dev] [PATCH v3 0/3] fix check of port and core
  2021-04-29  0:50 ` [dpdk-dev] [PATCH v3 0/3] " Min Hu (Connor)
                     ` (2 preceding siblings ...)
  2021-04-29  0:50   ` [dpdk-dev] [PATCH v3 3/3] examples/skeleton: " Min Hu (Connor)
@ 2021-05-12 16:52   ` Ferruh Yigit
  2021-05-12 19:16     ` Thomas Monjalon
  3 siblings, 1 reply; 29+ messages in thread
From: Ferruh Yigit @ 2021-05-12 16:52 UTC (permalink / raw)
  To: Min Hu (Connor), dev; +Cc: bernard.iremonger, thomas

On 4/29/2021 1:50 AM, Min Hu (Connor) wrote:
> Currently, some examples check that the port is on the same NUMA
> node as the polling thread for best performance. The method is
> to compare the socket id of port and that of current core. If the
> result is different, warning info will be given.
> 
> But it ignores the port which is from numa node 0, that is, no
> warning info will be given if the port is from numa node 0, and
> this set of patches will fix it.
> ---
> v3:
> * change "-w" to "-a".
> 
> v2:
> * add more commit info.
> 
> Min Hu (Connor) (3):
>   examples/flow_classify: fix check of port and core
>   examples/l2fwd-cat: fix check of port and core
>   examples/skeleton: fix check of port and core
> 

For series,
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>

Only I am not sure if it is confusing to mention from 'flow_classify' in the
commit log of 'l2fwd-cat' or 'skeleton' patches.

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

* Re: [dpdk-dev] [PATCH v3 0/3] fix check of port and core
  2021-05-12 16:52   ` [dpdk-dev] [PATCH v3 0/3] " Ferruh Yigit
@ 2021-05-12 19:16     ` Thomas Monjalon
  0 siblings, 0 replies; 29+ messages in thread
From: Thomas Monjalon @ 2021-05-12 19:16 UTC (permalink / raw)
  To: Min Hu (Connor); +Cc: dev, bernard.iremonger, Ferruh Yigit

12/05/2021 18:52, Ferruh Yigit:
> On 4/29/2021 1:50 AM, Min Hu (Connor) wrote:
> > Currently, some examples check that the port is on the same NUMA
> > node as the polling thread for best performance. The method is
> > to compare the socket id of port and that of current core. If the
> > result is different, warning info will be given.
> > 
> > But it ignores the port which is from numa node 0, that is, no
> > warning info will be given if the port is from numa node 0, and
> > this set of patches will fix it.
> > ---
> > v3:
> > * change "-w" to "-a".
> > 
> > v2:
> > * add more commit info.
> > 
> > Min Hu (Connor) (3):
> >   examples/flow_classify: fix check of port and core
> >   examples/l2fwd-cat: fix check of port and core
> >   examples/skeleton: fix check of port and core
> > 
> 
> For series,
> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
> 
> Only I am not sure if it is confusing to mention from 'flow_classify' in the
> commit log of 'l2fwd-cat' or 'skeleton' patches.

Yes it is confusing, I'll drop these comments.
The commits are still not explaining the issue is for devices on node 0,
I'll reword a bit.

Applied, thanks.



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

end of thread, other threads:[~2021-05-12 19:16 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-27  7:40 [dpdk-dev] [PATCH 0/3] fix check of port and core Min Hu (Connor)
2021-03-27  7:40 ` [dpdk-dev] [PATCH 1/3] examples/flow_classify: " Min Hu (Connor)
2021-04-20  1:08   ` Thomas Monjalon
2021-04-20  2:26     ` Min Hu (Connor)
2021-04-20  9:40       ` Thomas Monjalon
2021-04-27 11:51         ` Iremonger, Bernard
2021-04-27 12:23           ` Min Hu (Connor)
2021-04-27 13:06             ` Iremonger, Bernard
2021-04-28  9:26               ` Iremonger, Bernard
2021-03-27  7:40 ` [dpdk-dev] [PATCH 2/3] examples/l2fwd-cat: " Min Hu (Connor)
2021-03-27  7:40 ` [dpdk-dev] [PATCH 3/3] examples/skeleton: " Min Hu (Connor)
2021-04-10  9:14 ` [dpdk-dev] [PATCH 0/3] " Min Hu (Connor)
2021-04-19  7:44   ` Min Hu (Connor)
2021-04-21  7:00 ` [dpdk-dev] [PATCH v2 " Min Hu (Connor)
2021-04-21  7:00   ` [dpdk-dev] [PATCH v2 1/3] examples/flow_classify: " Min Hu (Connor)
2021-04-28 13:29     ` Iremonger, Bernard
2021-04-29  0:51       ` Min Hu (Connor)
2021-04-21  7:00   ` [dpdk-dev] [PATCH v2 2/3] examples/l2fwd-cat: " Min Hu (Connor)
2021-04-21  7:00   ` [dpdk-dev] [PATCH v2 3/3] examples/skeleton: " Min Hu (Connor)
2021-04-29  0:50 ` [dpdk-dev] [PATCH v3 0/3] " Min Hu (Connor)
2021-04-29  0:50   ` [dpdk-dev] [PATCH v3 1/3] examples/flow_classify: " Min Hu (Connor)
2021-04-29  9:07     ` Iremonger, Bernard
2021-04-29  9:37       ` Min Hu (Connor)
2021-04-29 11:44         ` Thomas Monjalon
2021-04-29 12:15           ` Min Hu (Connor)
2021-04-29  0:50   ` [dpdk-dev] [PATCH v3 2/3] examples/l2fwd-cat: " Min Hu (Connor)
2021-04-29  0:50   ` [dpdk-dev] [PATCH v3 3/3] examples/skeleton: " Min Hu (Connor)
2021-05-12 16:52   ` [dpdk-dev] [PATCH v3 0/3] " Ferruh Yigit
2021-05-12 19:16     ` 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.