From patchwork Thu Sep 25 15:24:36 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Balazs Nemeth X-Patchwork-Id: 527 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 1FD6DB44A; Thu, 25 Sep 2014 17:17:43 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id C45A7B430 for ; Thu, 25 Sep 2014 17:17:38 +0200 (CEST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP; 25 Sep 2014 08:23:19 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.97,862,1389772800"; d="scan'208";a="391549796" Received: from bnemeth-mobl.ger.corp.intel.com (HELO bn-ivy12.localdomain) ([172.22.195.65]) by FMSMGA003.fm.intel.com with ESMTP; 25 Sep 2014 08:17:18 -0700 From: Balazs Nemeth To: dev@dpdk.org Date: Thu, 25 Sep 2014 15:24:36 +0000 Message-Id: <1411658678-658-3-git-send-email-balazs.nemeth@intel.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1411658678-658-1-git-send-email-balazs.nemeth@intel.com> References: <1411658678-658-1-git-send-email-balazs.nemeth@intel.com> Cc: Balazs Nemeth Subject: [dpdk-dev] [PATCH 2/4] table: fix checking extended buckets in unoptimized case 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" 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. Acked-by: Cristian Dumitrescu Signed-off-by: Balazs Nemeth --- 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(-) -- 2.1.0 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. 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;