DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] app/test: fix crash of lpm test
@ 2016-11-09 13:08 Olivier Matz
  2016-11-10  2:59 ` Dai, Wei
  0 siblings, 1 reply; 3+ messages in thread
From: Olivier Matz @ 2016-11-09 13:08 UTC (permalink / raw)
  To: dev, wei.dai; +Cc: bruce.richardson

The test recently added accesses to lpm->tbl8[ip >> 8] with is much
larger than the size of the table, causing a crash of the test
application.

Fix this typo by replacing tbl8 by tbl24.

Fixes: 231fa88ed522 ("app/test: verify LPM tbl8 recycle")

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
---

Hi Wei,

I don't know lpm very well and I did not spend much time to understand
the test case. I guess that's the proper fix, but please check carefully
that I'm not doing something wrong :)

Thanks,
Olivier


 app/test/test_lpm.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/app/test/test_lpm.c b/app/test/test_lpm.c
index 80e0efc..41ae80f 100644
--- a/app/test/test_lpm.c
+++ b/app/test/test_lpm.c
@@ -1256,7 +1256,7 @@ test18(void)
 	rte_lpm_add(lpm, ip, depth, next_hop);
 
 	TEST_LPM_ASSERT(lpm->tbl24[ip>>8].valid_group);
-	tbl8_group_index = lpm->tbl8[ip>>8].group_idx;
+	tbl8_group_index = lpm->tbl24[ip>>8].group_idx;
 
 	depth = 23;
 	next_hop = 2;
@@ -1272,7 +1272,7 @@ test18(void)
 	rte_lpm_add(lpm, ip, depth, next_hop);
 
 	TEST_LPM_ASSERT(lpm->tbl24[ip>>8].valid_group);
-	TEST_LPM_ASSERT(tbl8_group_index == lpm->tbl8[ip>>8].group_idx);
+	TEST_LPM_ASSERT(tbl8_group_index == lpm->tbl24[ip>>8].group_idx);
 
 	depth = 24;
 	next_hop = 4;
@@ -1288,7 +1288,7 @@ test18(void)
 	rte_lpm_add(lpm, ip, depth, next_hop);
 
 	TEST_LPM_ASSERT(lpm->tbl24[ip>>8].valid_group);
-	TEST_LPM_ASSERT(tbl8_group_index == lpm->tbl8[ip>>8].group_idx);
+	TEST_LPM_ASSERT(tbl8_group_index == lpm->tbl24[ip>>8].group_idx);
 
 	rte_lpm_free(lpm);
 #undef group_idx
-- 
2.8.1

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

* Re: [dpdk-dev] [PATCH] app/test: fix crash of lpm test
  2016-11-09 13:08 [dpdk-dev] [PATCH] app/test: fix crash of lpm test Olivier Matz
@ 2016-11-10  2:59 ` Dai, Wei
  2016-11-12 21:21   ` Thomas Monjalon
  0 siblings, 1 reply; 3+ messages in thread
From: Dai, Wei @ 2016-11-10  2:59 UTC (permalink / raw)
  To: Olivier Matz, dev; +Cc: Richardson, Bruce

Hi, Oliver

Thanks for your catching this bug.
After reviewing related codes, I can acknowledge it.

Thanks
-Wei
> -----Original Message-----
> From: Olivier Matz [mailto:olivier.matz@6wind.com]
> Sent: Wednesday, November 9, 2016 9:08 PM
> To: dev@dpdk.org; Dai, Wei <wei.dai@intel.com>
> Cc: Richardson, Bruce <bruce.richardson@intel.com>
> Subject: [PATCH] app/test: fix crash of lpm test
> 
> The test recently added accesses to lpm->tbl8[ip >> 8] with is much larger than
> the size of the table, causing a crash of the test application.
> 
> Fix this typo by replacing tbl8 by tbl24.
> 
> Fixes: 231fa88ed522 ("app/test: verify LPM tbl8 recycle")
> 
> Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Wei Dai <wei.dai@intle.com>

> ---
> 
> Hi Wei,
> 
> I don't know lpm very well and I did not spend much time to understand the
> test case. I guess that's the proper fix, but please check carefully that I'm not
> doing something wrong :)
> 
> Thanks,
> Olivier
> 
> 
>  app/test/test_lpm.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/app/test/test_lpm.c b/app/test/test_lpm.c index 80e0efc..41ae80f
> 100644
> --- a/app/test/test_lpm.c
> +++ b/app/test/test_lpm.c
> @@ -1256,7 +1256,7 @@ test18(void)
>  	rte_lpm_add(lpm, ip, depth, next_hop);
> 
>  	TEST_LPM_ASSERT(lpm->tbl24[ip>>8].valid_group);
> -	tbl8_group_index = lpm->tbl8[ip>>8].group_idx;
> +	tbl8_group_index = lpm->tbl24[ip>>8].group_idx;
> 
>  	depth = 23;
>  	next_hop = 2;
> @@ -1272,7 +1272,7 @@ test18(void)
>  	rte_lpm_add(lpm, ip, depth, next_hop);
> 
>  	TEST_LPM_ASSERT(lpm->tbl24[ip>>8].valid_group);
> -	TEST_LPM_ASSERT(tbl8_group_index == lpm->tbl8[ip>>8].group_idx);
> +	TEST_LPM_ASSERT(tbl8_group_index == lpm->tbl24[ip>>8].group_idx);
> 
>  	depth = 24;
>  	next_hop = 4;
> @@ -1288,7 +1288,7 @@ test18(void)
>  	rte_lpm_add(lpm, ip, depth, next_hop);
> 
>  	TEST_LPM_ASSERT(lpm->tbl24[ip>>8].valid_group);
> -	TEST_LPM_ASSERT(tbl8_group_index == lpm->tbl8[ip>>8].group_idx);
> +	TEST_LPM_ASSERT(tbl8_group_index == lpm->tbl24[ip>>8].group_idx);
> 
>  	rte_lpm_free(lpm);
>  #undef group_idx
> --
> 2.8.1

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

* Re: [dpdk-dev] [PATCH] app/test: fix crash of lpm test
  2016-11-10  2:59 ` Dai, Wei
@ 2016-11-12 21:21   ` Thomas Monjalon
  0 siblings, 0 replies; 3+ messages in thread
From: Thomas Monjalon @ 2016-11-12 21:21 UTC (permalink / raw)
  To: Olivier Matz; +Cc: dev, Dai, Wei, Richardson, Bruce

> > The test recently added accesses to lpm->tbl8[ip >> 8] with is much larger than
> > the size of the table, causing a crash of the test application.
> > 
> > Fix this typo by replacing tbl8 by tbl24.
> > 
> > Fixes: 231fa88ed522 ("app/test: verify LPM tbl8 recycle")
> > 
> > Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
> Acked-by: Wei Dai <wei.dai@intle.com>

Applied, thanks

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

end of thread, other threads:[~2016-11-12 21:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-09 13:08 [dpdk-dev] [PATCH] app/test: fix crash of lpm test Olivier Matz
2016-11-10  2:59 ` Dai, Wei
2016-11-12 21:21   ` 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).