From patchwork Wed Nov 9 13:08:26 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Olivier Matz X-Patchwork-Id: 16982 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id D3DF63772; Wed, 9 Nov 2016 14:08:41 +0100 (CET) Received: from proxy.6wind.com (host.76.145.23.62.rev.coltfrance.com [62.23.145.76]) by dpdk.org (Postfix) with ESMTP id DE9E23770 for ; Wed, 9 Nov 2016 14:08:39 +0100 (CET) Received: from glumotte.dev.6wind.com (unknown [10.16.0.195]) by proxy.6wind.com (Postfix) with ESMTP id 4700F2502B; Wed, 9 Nov 2016 14:08:36 +0100 (CET) From: Olivier Matz To: dev@dpdk.org, wei.dai@intel.com Cc: bruce.richardson@intel.com Date: Wed, 9 Nov 2016 14:08:26 +0100 Message-Id: <1478696906-20948-1-git-send-email-olivier.matz@6wind.com> X-Mailer: git-send-email 2.8.1 Subject: [dpdk-dev] [PATCH] app/test: fix crash of lpm test X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 Acked-by: Wei Dai --- 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