DPDK patches and discussions
 help / color / mirror / Atom feed
From: Balazs Nemeth <balazs.nemeth@intel.com>
To: dev@dpdk.org
Cc: Balazs Nemeth <balazs.nemeth@intel.com>
Subject: [dpdk-dev] [PATCH 2/4] lib/librte_table: Fix checking extended buckets in unoptimized case
Date: Thu, 11 Sep 2014 19:47:19 +0200
Message-ID: <1410457641-3540-3-git-send-email-balazs.nemeth@intel.com> (raw)
In-Reply-To: <1410457641-3540-1-git-send-email-balazs.nemeth@intel.com>

If a key is not found in a bucket and the bucket has been extended,
the extended buckets also have to checked for potentially matching
keys. The extended buckets are checked at the end of the lookup. In
most cases, this logic is skipped as it is uncommon to have buckets in
an extended state.

In case the lookup is performed with less than 5 packets, an
unoptimized version is run instead (the optimized version requires at
least 5 packets). The extended buckets should also be checked in this
case instead of simply ignoring the extended buckets.

Signed-off-by: Balazs Nemeth <balazs.nemeth@intel.com>
---
 lib/librte_table/rte_table_hash_key16.c | 4 ++--
 lib/librte_table/rte_table_hash_key32.c | 4 ++--
 lib/librte_table/rte_table_hash_key8.c  | 8 ++++----
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/lib/librte_table/rte_table_hash_key16.c b/lib/librte_table/rte_table_hash_key16.c
index f5ec87d..f78db77 100644
--- a/lib/librte_table/rte_table_hash_key16.c
+++ b/lib/librte_table/rte_table_hash_key16.c
@@ -968,8 +968,7 @@ rte_table_hash_lookup_key16_ext(
 				buckets, keys, f);
 		}
 
-		*lookup_hit_mask = pkts_mask_out;
-		return 0;
+		goto grind_next_buckets;
 	}
 
 	/*
@@ -1060,6 +1059,7 @@ rte_table_hash_lookup_key16_ext(
 		bucket20, bucket21, pkts_mask_out, entries,
 		buckets_mask, buckets, keys, f);
 
+grind_next_buckets:
 	/* Grind next buckets */
 	for ( ; buckets_mask; ) {
 		uint64_t buckets_mask_next = 0;
diff --git a/lib/librte_table/rte_table_hash_key32.c b/lib/librte_table/rte_table_hash_key32.c
index e8f4812..10e281d 100644
--- a/lib/librte_table/rte_table_hash_key32.c
+++ b/lib/librte_table/rte_table_hash_key32.c
@@ -988,8 +988,7 @@ rte_table_hash_lookup_key32_ext(
 				keys, f);
 		}
 
-		*lookup_hit_mask = pkts_mask_out;
-		return 0;
+		goto grind_next_buckets;
 	}
 
 	/*
@@ -1080,6 +1079,7 @@ rte_table_hash_lookup_key32_ext(
 		bucket20, bucket21, pkts_mask_out, entries,
 		buckets_mask, buckets, keys, f);
 
+grind_next_buckets:
 	/* Grind next buckets */
 	for ( ; buckets_mask; ) {
 		uint64_t buckets_mask_next = 0;
diff --git a/lib/librte_table/rte_table_hash_key8.c b/lib/librte_table/rte_table_hash_key8.c
index d60c96e..606805d 100644
--- a/lib/librte_table/rte_table_hash_key8.c
+++ b/lib/librte_table/rte_table_hash_key8.c
@@ -1104,8 +1104,7 @@ rte_table_hash_lookup_key8_ext(
 				keys, f);
 		}
 
-		*lookup_hit_mask = pkts_mask_out;
-		return 0;
+		goto grind_next_buckets;
 	}
 
 	/*
@@ -1196,6 +1195,7 @@ rte_table_hash_lookup_key8_ext(
 		bucket20, bucket21, pkts_mask_out, entries,
 		buckets_mask, buckets, keys, f);
 
+grind_next_buckets:
 	/* Grind next buckets */
 	for ( ; buckets_mask; ) {
 		uint64_t buckets_mask_next = 0;
@@ -1250,8 +1250,7 @@ rte_table_hash_lookup_key8_ext_dosig(
 				buckets, keys, f);
 		}
 
-		*lookup_hit_mask = pkts_mask_out;
-		return 0;
+		goto grind_next_buckets;
 	}
 
 	/*
@@ -1342,6 +1341,7 @@ rte_table_hash_lookup_key8_ext_dosig(
 		bucket20, bucket21, pkts_mask_out, entries,
 		buckets_mask, buckets, keys, f);
 
+grind_next_buckets:
 	/* Grind next buckets */
 	for ( ; buckets_mask; ) {
 		uint64_t buckets_mask_next = 0;
-- 
1.9.1

Intel Corporation NV/SA
Kings Square, Veldkant 31
2550 Kontich
RPM (Bruxelles) 0415.497.718. 
Citibank, Brussels, account 570/1031255/09

This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.

  parent reply	other threads:[~2014-09-11 17:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-11 17:47 [dpdk-dev] [PATCH 0/4] lib/librte_table: Fix bugs occuring in corner cases Balazs Nemeth
2014-09-11 17:47 ` [dpdk-dev] [PATCH 1/4] lib/librte_table: Fix empty bucket removal during entry deletion in rte_table_hash_ext Balazs Nemeth
2014-09-11 17:47 ` Balazs Nemeth [this message]
2014-09-11 17:47 ` [dpdk-dev] [PATCH 3/4] lib/librte_table: Fix incorrect t->data_size_shl initialization Balazs Nemeth
2014-09-11 17:47 ` [dpdk-dev] [PATCH 4/4] lib/librte_table: Fix pointer calculations at initialization Balazs Nemeth
2014-09-11 17:56 ` [dpdk-dev] [PATCH 0/4] lib/librte_table: Fix bugs occuring in corner cases Dumitrescu, Cristian
2014-09-24 17:48 ` Thomas Monjalon

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=1410457641-3540-3-git-send-email-balazs.nemeth@intel.com \
    --to=balazs.nemeth@intel.com \
    --cc=dev@dpdk.org \
    /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