DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ruifeng Wang <ruifeng.wang@arm.com>
To: Bruce Richardson <bruce.richardson@intel.com>,
	Vladimir Medvedkin <vladimir.medvedkin@intel.com>
Cc: dev@dpdk.org, nd@arm.com, jerinj@marvell.com,
	drc@linux.vnet.ibm.com, honnappa.nagarahalli@arm.com,
	Ruifeng Wang <ruifeng.wang@arm.com>
Subject: [dpdk-dev] [PATCH v2 4/4] test/lpm: improve coverage on tbl8
Date: Thu, 14 Jan 2021 06:59:25 +0000
Message-ID: <20210114065926.1200855-5-ruifeng.wang@arm.com> (raw)
In-Reply-To: <20210114065926.1200855-1-ruifeng.wang@arm.com>

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 <ruifeng.wang@arm.com>
Tested-by: David Christensen <drc@linux.vnet.ibm.com>
Acked-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
---
v2:
Check all 4 returned next hops. (Vladimir)

 app/test/test_lpm.c | 25 +++++++++++++++++--------
 1 file changed, 17 insertions(+), 8 deletions(-)

diff --git a/app/test/test_lpm.c b/app/test/test_lpm.c
index 258b2f67c..556f5a67b 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,37 @@ 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);
+		TEST_LPM_ASSERT(hop[1] == UINT32_MAX);
+		TEST_LPM_ASSERT(hop[2] == UINT32_MAX);
+		TEST_LPM_ASSERT(hop[3] == UINT32_MAX);
 	}
 
 	/* All tbl8 extensions have been used above. Try to add one more and
@@ -1037,7 +1046,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);
-- 
2.25.1


  parent reply	other threads:[~2021-01-14  7:01 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-08  8:21 [dpdk-dev] [PATCH 0/4] lpm lookupx4 fixes Ruifeng Wang
2021-01-08  8:21 ` [dpdk-dev] [PATCH 1/4] lpm: fix vector lookup for Arm Ruifeng Wang
2021-01-08  8:21 ` [dpdk-dev] [PATCH 2/4] lpm: fix vector lookup for x86 Ruifeng Wang
2021-01-13 18:46   ` Medvedkin, Vladimir
2021-01-08  8:21 ` [dpdk-dev] [PATCH 3/4] lpm: fix vector lookup for ppc64 Ruifeng Wang
2021-01-11 21:29   ` David Christensen
2021-01-08  8:21 ` [dpdk-dev] [PATCH 4/4] test/lpm: improve coverage on tbl8 Ruifeng Wang
2021-01-11 21:29   ` David Christensen
2021-01-13 18:51   ` Medvedkin, Vladimir
2021-01-14  6:38     ` Ruifeng Wang
2021-01-13 14:52 ` [dpdk-dev] [PATCH 0/4] lpm lookupx4 fixes David Marchand
2021-01-14  6:54   ` Ruifeng Wang
2021-01-13 18:46 ` Medvedkin, Vladimir
2021-01-14  6:59 ` [dpdk-dev] [PATCH v2 " Ruifeng Wang
2021-01-14  6:59   ` [dpdk-dev] [PATCH v2 1/4] lpm: fix vector lookup for Arm Ruifeng Wang
2021-01-14  6:59   ` [dpdk-dev] [PATCH v2 2/4] lpm: fix vector lookup for x86 Ruifeng Wang
2021-01-14  6:59   ` [dpdk-dev] [PATCH v2 3/4] lpm: fix vector lookup for ppc64 Ruifeng Wang
2021-01-14  6:59   ` Ruifeng Wang [this message]
2021-01-14 11:14     ` [dpdk-dev] [PATCH v2 4/4] test/lpm: improve coverage on tbl8 Medvedkin, Vladimir
2021-01-14 15:25   ` [dpdk-dev] [PATCH v2 0/4] lpm lookupx4 fixes David Marchand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210114065926.1200855-5-ruifeng.wang@arm.com \
    --to=ruifeng.wang@arm.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=drc@linux.vnet.ibm.com \
    --cc=honnappa.nagarahalli@arm.com \
    --cc=jerinj@marvell.com \
    --cc=nd@arm.com \
    --cc=vladimir.medvedkin@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git