patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH 1/2] test/rcu: fix the compiling error for armv8.2
@ 2019-07-31 23:32 ` Gavin Hu
  2019-07-31 23:48   ` [dpdk-stable] [PATCH v2 1/3] " Gavin Hu
  2019-11-11  5:41   ` [dpdk-stable] [PATCH v3 " Gavin Hu
  0 siblings, 2 replies; 7+ messages in thread
From: Gavin Hu @ 2019-07-31 23:32 UTC (permalink / raw)
  To: dev; +Cc: nd, stable

With "-march=armv8.2-a" specified, a compiling error generated:
app/test/test_rcu_qsbr.c:234:10: error: comparison of integer
expressions of different signedness: ‘unsigned int’ and ‘int’
[-Werror=sign-compare]

Fixes: b87089b0bb19 ("test/rcu: add API and functional tests")
Cc: stable@dpdk.org

Signed-off-by: Gavin Hu <gavin.hu@arm.com>
---
 app/test/test_rcu_qsbr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/test/test_rcu_qsbr.c b/app/test/test_rcu_qsbr.c
index 1d273e3..b008c9d 100644
--- a/app/test/test_rcu_qsbr.c
+++ b/app/test/test_rcu_qsbr.c
@@ -231,7 +231,7 @@ test_rcu_qsbr_thread_unregister(void)
 		/* Update quiescent state counter */
 		for (i = 0; i < num_threads[j]; i++) {
 			/* Skip one update */
-			if (i == (RTE_MAX_LCORE - 10))
+			if (i == (unsigned int)(RTE_MAX_LCORE - 10))
 				continue;
 			rte_rcu_qsbr_quiescent(t[0],
 				(j == 2) ? (RTE_MAX_LCORE - 1) : i);
-- 
2.7.4


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

* [dpdk-stable] [PATCH v2 1/3] test/rcu: fix the compiling error for armv8.2
  2019-07-31 23:32 ` [dpdk-stable] [PATCH 1/2] test/rcu: fix the compiling error for armv8.2 Gavin Hu
@ 2019-07-31 23:48   ` Gavin Hu
  2019-11-11  5:41   ` [dpdk-stable] [PATCH v3 " Gavin Hu
  1 sibling, 0 replies; 7+ messages in thread
From: Gavin Hu @ 2019-07-31 23:48 UTC (permalink / raw)
  To: dev
  Cc: nd, thomas, hemant.agrawal, jerinj, pbhagavatula,
	Honnappa.Nagarahalli, stable

With "-march=armv8.2-a" specified, a compiling error generated:
app/test/test_rcu_qsbr.c:234:10: error: comparison of integer
expressions of different signedness: ‘unsigned int’ and ‘int’
[-Werror=sign-compare]

Fixes: b87089b0bb19 ("test/rcu: add API and functional tests")
Cc: stable@dpdk.org

Signed-off-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Steve Capper <steve.capper@arm.com>
---
 app/test/test_rcu_qsbr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/test/test_rcu_qsbr.c b/app/test/test_rcu_qsbr.c
index 1d273e3..b008c9d 100644
--- a/app/test/test_rcu_qsbr.c
+++ b/app/test/test_rcu_qsbr.c
@@ -231,7 +231,7 @@ test_rcu_qsbr_thread_unregister(void)
 		/* Update quiescent state counter */
 		for (i = 0; i < num_threads[j]; i++) {
 			/* Skip one update */
-			if (i == (RTE_MAX_LCORE - 10))
+			if (i == (unsigned int)(RTE_MAX_LCORE - 10))
 				continue;
 			rte_rcu_qsbr_quiescent(t[0],
 				(j == 2) ? (RTE_MAX_LCORE - 1) : i);
-- 
2.7.4


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

* [dpdk-stable] [PATCH v3 1/3] test/rcu: fix the compiling error for armv8.2
  2019-07-31 23:32 ` [dpdk-stable] [PATCH 1/2] test/rcu: fix the compiling error for armv8.2 Gavin Hu
  2019-07-31 23:48   ` [dpdk-stable] [PATCH v2 1/3] " Gavin Hu
@ 2019-11-11  5:41   ` Gavin Hu
  2019-11-20 22:18     ` Thomas Monjalon
  2019-11-25  3:36     ` [dpdk-stable] [PATCH v4] test/rcu: fix build for small number of cores Gavin Hu
  1 sibling, 2 replies; 7+ messages in thread
From: Gavin Hu @ 2019-11-11  5:41 UTC (permalink / raw)
  To: dev; +Cc: nd, thomas, Honnappa.Nagarahalli, stable

With "-march=armv8.2-a" specified, a compiling error generated:
app/test/test_rcu_qsbr.c:234:10: error: comparison of integer
expressions of different signedness: ‘unsigned int’ and ‘int’
[-Werror=sign-compare]

Fixes: b87089b0bb19 ("test/rcu: add API and functional tests")
Cc: stable@dpdk.org

Signed-off-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Steve Capper <steve.capper@arm.com>
---
 app/test/test_rcu_qsbr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/test/test_rcu_qsbr.c b/app/test/test_rcu_qsbr.c
index 85d80e0..19229ac 100644
--- a/app/test/test_rcu_qsbr.c
+++ b/app/test/test_rcu_qsbr.c
@@ -230,7 +230,7 @@ test_rcu_qsbr_thread_unregister(void)
 		/* Update quiescent state counter */
 		for (i = 0; i < num_threads[j]; i++) {
 			/* Skip one update */
-			if (i == (RTE_MAX_LCORE - 10))
+			if (i == (unsigned int)(RTE_MAX_LCORE - 10))
 				continue;
 			rte_rcu_qsbr_quiescent(t[0],
 				(j == 2) ? (RTE_MAX_LCORE - 1) : i);
-- 
2.7.4


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

* Re: [dpdk-stable] [PATCH v3 1/3] test/rcu: fix the compiling error for armv8.2
  2019-11-11  5:41   ` [dpdk-stable] [PATCH v3 " Gavin Hu
@ 2019-11-20 22:18     ` Thomas Monjalon
  2019-11-21 11:23       ` Gavin Hu (Arm Technology China)
  2019-11-25  3:36     ` [dpdk-stable] [PATCH v4] test/rcu: fix build for small number of cores Gavin Hu
  1 sibling, 1 reply; 7+ messages in thread
From: Thomas Monjalon @ 2019-11-20 22:18 UTC (permalink / raw)
  To: Gavin Hu, Honnappa.Nagarahalli, Steve Capper
  Cc: stable, dev, nd, david.marchand

11/11/2019 06:41, Gavin Hu:
> With "-march=armv8.2-a" specified, a compiling error generated:
> app/test/test_rcu_qsbr.c:234:10: error: comparison of integer
> expressions of different signedness: ‘unsigned int’ and ‘int’
> [-Werror=sign-compare]
> 
> Fixes: b87089b0bb19 ("test/rcu: add API and functional tests")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Gavin Hu <gavin.hu@arm.com>
> Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
> Reviewed-by: Steve Capper <steve.capper@arm.com>
> ---
> --- a/app/test/test_rcu_qsbr.c
> +++ b/app/test/test_rcu_qsbr.c
>  			/* Skip one update */
> -			if (i == (RTE_MAX_LCORE - 10))
> +			if (i == (unsigned int)(RTE_MAX_LCORE - 10))

For N1 SDP, RTE_MAX_LCORE = 4.
So this test weird.
Why not using rand() to find a number between 0 and max ?

You are hiding a real failure with a forced type casting.

Please reviewers, explain why you think it is the right thing to do?



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

* Re: [dpdk-stable] [PATCH v3 1/3] test/rcu: fix the compiling error for armv8.2
  2019-11-20 22:18     ` Thomas Monjalon
@ 2019-11-21 11:23       ` Gavin Hu (Arm Technology China)
  0 siblings, 0 replies; 7+ messages in thread
From: Gavin Hu (Arm Technology China) @ 2019-11-21 11:23 UTC (permalink / raw)
  To: thomas, Honnappa Nagarahalli, Steve Capper
  Cc: stable, dev, nd, david.marchand, nd



> -----Original Message-----
> From: Thomas Monjalon <thomas@monjalon.net>
> Sent: Thursday, November 21, 2019 6:19 AM
> To: Gavin Hu (Arm Technology China) <Gavin.Hu@arm.com>; Honnappa
> Nagarahalli <Honnappa.Nagarahalli@arm.com>; Steve Capper
> <Steve.Capper@arm.com>
> Cc: stable@dpdk.org; dev@dpdk.org; nd <nd@arm.com>;
> david.marchand@redhat.com
> Subject: Re: [dpdk-stable] [PATCH v3 1/3] test/rcu: fix the compiling error for
> armv8.2
> 
> 11/11/2019 06:41, Gavin Hu:
> > With "-march=armv8.2-a" specified, a compiling error generated:
> > app/test/test_rcu_qsbr.c:234:10: error: comparison of integer
> > expressions of different signedness: ‘unsigned int’ and ‘int’
> > [-Werror=sign-compare]
> >
> > Fixes: b87089b0bb19 ("test/rcu: add API and functional tests")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Gavin Hu <gavin.hu@arm.com>
> > Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
> > Reviewed-by: Steve Capper <steve.capper@arm.com>
> > ---
> > --- a/app/test/test_rcu_qsbr.c
> > +++ b/app/test/test_rcu_qsbr.c
> >  			/* Skip one update */
> > -			if (i == (RTE_MAX_LCORE - 10))
> > +			if (i == (unsigned int)(RTE_MAX_LCORE - 10))
> 
> For N1 SDP, RTE_MAX_LCORE = 4.
> So this test weird.
> Why not using rand() to find a number between 0 and max ?
> 
> You are hiding a real failure with a forced type casting.
> 
> Please reviewers, explain why you think it is the right thing to do?
> 
Thanks for pointing out this issue, will fix in next release.


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

* [dpdk-stable] [PATCH v4] test/rcu: fix build for small number of cores
  2019-11-11  5:41   ` [dpdk-stable] [PATCH v3 " Gavin Hu
  2019-11-20 22:18     ` Thomas Monjalon
@ 2019-11-25  3:36     ` Gavin Hu
  2019-11-25 22:40       ` Thomas Monjalon
  1 sibling, 1 reply; 7+ messages in thread
From: Gavin Hu @ 2019-11-25  3:36 UTC (permalink / raw)
  To: dev; +Cc: nd, thomas, Honnappa.Nagarahalli, dharmik.thakkar, stable

If the RTE_MAX_LCORE is less than 10, a compilation error is generated:
app/test/test_rcu_qsbr.c:234:10: error: comparison of integer
expressions of different signedness: ‘unsigned int’ and ‘int’
[-Werror=sign-compare]

The cause is (RTE_MAX_LCORE - 10) results in a negative value.

To fix, use rte_rand() to find a number between 0 and RTE_MAX_LCORE.

Fixes: b87089b0bb19 ("test/rcu: add API and functional tests")
Cc: stable@dpdk.org

Signed-off-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Steve Capper <steve.capper@arm.com>
Reviewed-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
---
v4:
- separate from the N1SDP configuration patch series
- fix the build for smaller number of cores(Thomas Monjalon)
---
 app/test/test_rcu_qsbr.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/app/test/test_rcu_qsbr.c b/app/test/test_rcu_qsbr.c
index 85d80e0..b60dc50 100644
--- a/app/test/test_rcu_qsbr.c
+++ b/app/test/test_rcu_qsbr.c
@@ -9,6 +9,7 @@
 #include <rte_hash_crc.h>
 #include <rte_malloc.h>
 #include <rte_cycles.h>
+#include <rte_random.h>
 #include <unistd.h>
 
 #include "test.h"
@@ -168,6 +169,7 @@ test_rcu_qsbr_thread_unregister(void)
 {
 	unsigned int num_threads[3] = {1, RTE_MAX_LCORE, 1};
 	unsigned int i, j;
+	unsigned int skip_thread_id;
 	uint64_t token;
 	int ret;
 
@@ -227,10 +229,11 @@ test_rcu_qsbr_thread_unregister(void)
 		token = rte_rcu_qsbr_start(t[0]);
 		TEST_RCU_QSBR_RETURN_IF_ERROR(
 			(token != (TEST_RCU_QSBR_CNT_INIT + 1)), "QSBR Start");
+		skip_thread_id = rte_rand() % RTE_MAX_LCORE;
 		/* Update quiescent state counter */
 		for (i = 0; i < num_threads[j]; i++) {
 			/* Skip one update */
-			if (i == (RTE_MAX_LCORE - 10))
+			if ((j == 1) && (i == skip_thread_id))
 				continue;
 			rte_rcu_qsbr_quiescent(t[0],
 				(j == 2) ? (RTE_MAX_LCORE - 1) : i);
@@ -242,7 +245,7 @@ test_rcu_qsbr_thread_unregister(void)
 			TEST_RCU_QSBR_RETURN_IF_ERROR((ret == 0),
 						"Non-blocking QSBR check");
 			/* Update the previously skipped thread */
-			rte_rcu_qsbr_quiescent(t[0], RTE_MAX_LCORE - 10);
+			rte_rcu_qsbr_quiescent(t[0], skip_thread_id);
 		}
 
 		/* Validate the updates */
-- 
2.7.4


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

* Re: [dpdk-stable] [PATCH v4] test/rcu: fix build for small number of cores
  2019-11-25  3:36     ` [dpdk-stable] [PATCH v4] test/rcu: fix build for small number of cores Gavin Hu
@ 2019-11-25 22:40       ` Thomas Monjalon
  0 siblings, 0 replies; 7+ messages in thread
From: Thomas Monjalon @ 2019-11-25 22:40 UTC (permalink / raw)
  To: Gavin Hu; +Cc: stable, dev, nd, Honnappa.Nagarahalli, dharmik.thakkar

25/11/2019 04:36, Gavin Hu:
> If the RTE_MAX_LCORE is less than 10, a compilation error is generated:
> app/test/test_rcu_qsbr.c:234:10: error: comparison of integer
> expressions of different signedness: ‘unsigned int’ and ‘int’
> [-Werror=sign-compare]
> 
> The cause is (RTE_MAX_LCORE - 10) results in a negative value.
> 
> To fix, use rte_rand() to find a number between 0 and RTE_MAX_LCORE.
> 
> Fixes: b87089b0bb19 ("test/rcu: add API and functional tests")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Gavin Hu <gavin.hu@arm.com>
> Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
> Reviewed-by: Steve Capper <steve.capper@arm.com>
> Reviewed-by: Dharmik Thakkar <dharmik.thakkar@arm.com>

Applied, thanks




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

end of thread, other threads:[~2019-11-25 22:40 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1564616902-13861-1-git-send-email-gavin.hu@arm.com>
2019-07-31 23:32 ` [dpdk-stable] [PATCH 1/2] test/rcu: fix the compiling error for armv8.2 Gavin Hu
2019-07-31 23:48   ` [dpdk-stable] [PATCH v2 1/3] " Gavin Hu
2019-11-11  5:41   ` [dpdk-stable] [PATCH v3 " Gavin Hu
2019-11-20 22:18     ` Thomas Monjalon
2019-11-21 11:23       ` Gavin Hu (Arm Technology China)
2019-11-25  3:36     ` [dpdk-stable] [PATCH v4] test/rcu: fix build for small number of cores Gavin Hu
2019-11-25 22:40       ` 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).