From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 86716A0A02; Wed, 13 Jan 2021 19:51:51 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0294B140D4B; Wed, 13 Jan 2021 19:51:51 +0100 (CET) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id 56EB9140D43 for ; Wed, 13 Jan 2021 19:51:48 +0100 (CET) IronPort-SDR: wGfNJSOf0BsWuWE75XTw5xHMWI/OaCHtb/HQltOFQ9aIpraOA8VGTTGGGznGx2W/CkhuHd5DLx /B7junsPuQzQ== X-IronPort-AV: E=McAfee;i="6000,8403,9863"; a="178345382" X-IronPort-AV: E=Sophos;i="5.79,345,1602572400"; d="scan'208";a="178345382" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jan 2021 10:51:47 -0800 IronPort-SDR: EJKQVkMQi/6tQWSbKQd6Amkz5Gi7zCRQsC4GrcOCyJsh5nf5QOeHQK6TGxctaJ5BGw+T+fglra 9jLybMdSAusQ== X-IronPort-AV: E=Sophos;i="5.79,345,1602572400"; d="scan'208";a="424667339" Received: from vmedvedk-mobl.ger.corp.intel.com (HELO [10.252.6.92]) ([10.252.6.92]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jan 2021 10:51:45 -0800 To: Ruifeng Wang , Bruce Richardson Cc: dev@dpdk.org, nd@arm.com, jerinj@marvell.com, drc@linux.vnet.ibm.com, honnappa.nagarahalli@arm.com References: <20210108082127.1061538-1-ruifeng.wang@arm.com> <20210108082127.1061538-5-ruifeng.wang@arm.com> From: "Medvedkin, Vladimir" Message-ID: <450ae1fc-d6bf-7ce3-7531-49e44f25a684@intel.com> Date: Wed, 13 Jan 2021 18:51:43 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.5.1 MIME-Version: 1.0 In-Reply-To: <20210108082127.1061538-5-ruifeng.wang@arm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH 4/4] test/lpm: improve coverage on tbl8 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi Ruifeng, Please find comment inlined. Apart from that looks good. On 08/01/2021 08:21, Ruifeng Wang wrote: > Existing test cases create 256 tbl8 groups for testing. The number covers > only 8 bit next_hop/group field. Since the next_hop/group field had been > extended to 24-bits, creating more than 256 groups in tests can improve > the coverage. > > Coverage was not expanded to reach the max supported group number, because > it would take too much time to run for this fast-test. > > Signed-off-by: Ruifeng Wang > --- > app/test/test_lpm.c | 22 ++++++++++++++-------- > 1 file changed, 14 insertions(+), 8 deletions(-) > > diff --git a/app/test/test_lpm.c b/app/test/test_lpm.c > index 258b2f67c..ee6c4280b 100644 > --- a/app/test/test_lpm.c > +++ b/app/test/test_lpm.c > @@ -993,7 +993,7 @@ test13(void) > } > > /* > - * Fore TBL8 extension exhaustion. Add 256 rules that require a tbl8 extension. > + * For TBL8 extension exhaustion. Add 512 rules that require a tbl8 extension. > * No more tbl8 extensions will be allowed. Now add one more rule that required > * a tbl8 extension and get fail. > * */ > @@ -1008,28 +1008,34 @@ test14(void) > struct rte_lpm_config config; > > config.max_rules = 256 * 32; > - config.number_tbl8s = NUMBER_TBL8S; > + config.number_tbl8s = 512; > config.flags = 0; > - uint32_t ip, next_hop_add, next_hop_return; > + uint32_t ip, next_hop_base, next_hop_return; > uint8_t depth; > int32_t status = 0; > + xmm_t ipx4; > + uint32_t hop[4]; > > /* Add enough space for 256 rules for every depth */ > lpm = rte_lpm_create(__func__, SOCKET_ID_ANY, &config); > TEST_LPM_ASSERT(lpm != NULL); > > depth = 32; > - next_hop_add = 100; > + next_hop_base = 100; > ip = RTE_IPV4(0, 0, 0, 0); > > /* Add 256 rules that require a tbl8 extension */ > - for (; ip <= RTE_IPV4(0, 0, 255, 0); ip += 256) { > - status = rte_lpm_add(lpm, ip, depth, next_hop_add); > + for (; ip <= RTE_IPV4(0, 1, 255, 0); ip += 256) { > + status = rte_lpm_add(lpm, ip, depth, next_hop_base + ip); > TEST_LPM_ASSERT(status == 0); > > status = rte_lpm_lookup(lpm, ip, &next_hop_return); > TEST_LPM_ASSERT((status == 0) && > - (next_hop_return == next_hop_add)); > + (next_hop_return == next_hop_base + ip)); > + > + ipx4 = vect_set_epi32(ip + 3, ip + 2, ip + 1, ip); > + rte_lpm_lookupx4(lpm, ipx4, hop, UINT32_MAX); > + TEST_LPM_ASSERT(hop[0] == next_hop_base + ip); I think it is worth to check all 4 returned next hops here. > } > > /* All tbl8 extensions have been used above. Try to add one more and > @@ -1037,7 +1043,7 @@ test14(void) > ip = RTE_IPV4(1, 0, 0, 0); > depth = 32; > > - status = rte_lpm_add(lpm, ip, depth, next_hop_add); > + status = rte_lpm_add(lpm, ip, depth, next_hop_base + ip); > TEST_LPM_ASSERT(status < 0); > > rte_lpm_free(lpm); > -- Regards, Vladimir