From: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
To: dev@dpdk.org
Cc: thomas@monjalon.net
Subject: [dpdk-dev] [PATCH v3 04/18] librte_table: remove deprecated variable size key ext hash tables
Date: Wed, 18 Oct 2017 16:03:21 +0100 [thread overview]
Message-ID: <1508339034-171115-5-git-send-email-cristian.dumitrescu@intel.com> (raw)
In-Reply-To: <1508339034-171115-1-git-send-email-cristian.dumitrescu@intel.com>
The non-dosig version of the variable size key extendible bucket
hash tables are removed. The remaining hash tables are renamed to
eliminate the dosig particle from their name.
Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
---
.../pipeline/pipeline_flow_classification_be.c | 2 +-
lib/librte_table/rte_table_hash.h | 5 -
lib/librte_table/rte_table_hash_ext.c | 196 +--------------------
test/test-pipeline/pipeline_hash.c | 2 +-
4 files changed, 8 insertions(+), 197 deletions(-)
mode change 100644 => 100755 lib/librte_table/rte_table_hash.h
mode change 100644 => 100755 lib/librte_table/rte_table_hash_ext.c
diff --git a/examples/ip_pipeline/pipeline/pipeline_flow_classification_be.c b/examples/ip_pipeline/pipeline/pipeline_flow_classification_be.c
index 0f667e6..191cb15 100755
--- a/examples/ip_pipeline/pipeline/pipeline_flow_classification_be.c
+++ b/examples/ip_pipeline/pipeline/pipeline_flow_classification_be.c
@@ -552,7 +552,7 @@ static void *pipeline_fc_init(struct pipeline_params *params,
break;
default:
- table_params.ops = &rte_table_hash_ext_dosig_ops;
+ table_params.ops = &rte_table_hash_ext_ops;
table_params.arg_create = &table_hash_params;
}
diff --git a/lib/librte_table/rte_table_hash.h b/lib/librte_table/rte_table_hash.h
old mode 100644
new mode 100755
index 57c6073..0eb23a7
--- a/lib/librte_table/rte_table_hash.h
+++ b/lib/librte_table/rte_table_hash.h
@@ -135,13 +135,8 @@ struct rte_table_hash_ext_params {
uint32_t key_offset;
};
-/** Extendible bucket hash table operations for pre-computed key signature */
extern struct rte_table_ops rte_table_hash_ext_ops;
-/** Extendible bucket hash table operations for key signature computed on
- lookup ("do-sig") */
-extern struct rte_table_ops rte_table_hash_ext_dosig_ops;
-
/** LRU hash table parameters */
struct rte_table_hash_lru_params {
/** Key size (number of bytes) */
diff --git a/lib/librte_table/rte_table_hash_ext.c b/lib/librte_table/rte_table_hash_ext.c
old mode 100644
new mode 100755
index e718102..c4824c3
--- a/lib/librte_table/rte_table_hash_ext.c
+++ b/lib/librte_table/rte_table_hash_ext.c
@@ -437,8 +437,7 @@ static int rte_table_hash_ext_lookup_unoptimized(
struct rte_mbuf **pkts,
uint64_t pkts_mask,
uint64_t *lookup_hit_mask,
- void **entries,
- int dosig)
+ void **entries)
{
struct rte_table_hash *t = (struct rte_table_hash *) table;
uint64_t pkts_mask_out = 0;
@@ -458,11 +457,7 @@ static int rte_table_hash_ext_lookup_unoptimized(
pkt = pkts[pkt_index];
key = RTE_MBUF_METADATA_UINT8_PTR(pkt, t->key_offset);
- if (dosig)
- sig = (uint64_t) t->f_hash(key, t->key_size, t->seed);
- else
- sig = RTE_MBUF_METADATA_UINT32(pkt,
- t->signature_offset);
+ sig = (uint64_t) t->f_hash(key, t->key_size, t->seed);
bkt_index = sig & t->bucket_mask;
bkt0 = &t->buckets[bkt_index];
@@ -685,38 +680,7 @@ static int rte_table_hash_ext_lookup_unoptimized(
rte_prefetch0(RTE_MBUF_METADATA_UINT8_PTR(mbuf01, key_offset));\
}
-#define lookup2_stage1(t, g, pkts, pkt10_index, pkt11_index) \
-{ \
- struct grinder *g10, *g11; \
- uint64_t sig10, sig11, bkt10_index, bkt11_index; \
- struct rte_mbuf *mbuf10, *mbuf11; \
- struct bucket *bkt10, *bkt11, *buckets = t->buckets; \
- uint64_t bucket_mask = t->bucket_mask; \
- uint32_t signature_offset = t->signature_offset; \
- \
- mbuf10 = pkts[pkt10_index]; \
- sig10 = (uint64_t) RTE_MBUF_METADATA_UINT32(mbuf10, signature_offset);\
- bkt10_index = sig10 & bucket_mask; \
- bkt10 = &buckets[bkt10_index]; \
- \
- mbuf11 = pkts[pkt11_index]; \
- sig11 = (uint64_t) RTE_MBUF_METADATA_UINT32(mbuf11, signature_offset);\
- bkt11_index = sig11 & bucket_mask; \
- bkt11 = &buckets[bkt11_index]; \
- \
- rte_prefetch0(bkt10); \
- rte_prefetch0(bkt11); \
- \
- g10 = &g[pkt10_index]; \
- g10->sig = sig10; \
- g10->bkt = bkt10; \
- \
- g11 = &g[pkt11_index]; \
- g11->sig = sig11; \
- g11->bkt = bkt11; \
-}
-
-#define lookup2_stage1_dosig(t, g, pkts, pkt10_index, pkt11_index) \
+#define lookup2_stage1(t, g, pkts, pkt10_index, pkt11_index) \
{ \
struct grinder *g10, *g11; \
uint64_t sig10, sig11, bkt10_index, bkt11_index; \
@@ -874,7 +838,7 @@ static int rte_table_hash_ext_lookup(
/* Cannot run the pipeline with less than 7 packets */
if (__builtin_popcountll(pkts_mask) < 7) {
status = rte_table_hash_ext_lookup_unoptimized(table, pkts,
- pkts_mask, lookup_hit_mask, entries, 0);
+ pkts_mask, lookup_hit_mask, entries);
RTE_TABLE_HASH_EXT_STATS_PKTS_LOOKUP_MISS(t, n_pkts_in -
__builtin_popcountll(*lookup_hit_mask));
return status;
@@ -982,144 +946,7 @@ static int rte_table_hash_ext_lookup(
uint64_t pkts_mask_out_slow = 0;
status = rte_table_hash_ext_lookup_unoptimized(table, pkts,
- pkts_mask_match_many, &pkts_mask_out_slow, entries, 0);
- pkts_mask_out |= pkts_mask_out_slow;
- }
-
- *lookup_hit_mask = pkts_mask_out;
- RTE_TABLE_HASH_EXT_STATS_PKTS_LOOKUP_MISS(t, n_pkts_in - __builtin_popcountll(pkts_mask_out));
- return status;
-}
-
-static int rte_table_hash_ext_lookup_dosig(
- void *table,
- struct rte_mbuf **pkts,
- uint64_t pkts_mask,
- uint64_t *lookup_hit_mask,
- void **entries)
-{
- struct rte_table_hash *t = (struct rte_table_hash *) table;
- struct grinder *g = t->grinders;
- uint64_t pkt00_index, pkt01_index, pkt10_index, pkt11_index;
- uint64_t pkt20_index, pkt21_index, pkt30_index, pkt31_index;
- uint64_t pkts_mask_out = 0, pkts_mask_match_many = 0;
- int status = 0;
-
- __rte_unused uint32_t n_pkts_in = __builtin_popcountll(pkts_mask);
- RTE_TABLE_HASH_EXT_STATS_PKTS_IN_ADD(t, n_pkts_in);
-
- /* Cannot run the pipeline with less than 7 packets */
- if (__builtin_popcountll(pkts_mask) < 7) {
- status = rte_table_hash_ext_lookup_unoptimized(table, pkts,
- pkts_mask, lookup_hit_mask, entries, 1);
- RTE_TABLE_HASH_EXT_STATS_PKTS_LOOKUP_MISS(t, n_pkts_in -
- __builtin_popcountll(*lookup_hit_mask));
- return status;
- }
-
- /* Pipeline stage 0 */
- lookup2_stage0(t, g, pkts, pkts_mask, pkt00_index, pkt01_index);
-
- /* Pipeline feed */
- pkt10_index = pkt00_index;
- pkt11_index = pkt01_index;
-
- /* Pipeline stage 0 */
- lookup2_stage0(t, g, pkts, pkts_mask, pkt00_index, pkt01_index);
-
- /* Pipeline stage 1 */
- lookup2_stage1_dosig(t, g, pkts, pkt10_index, pkt11_index);
-
- /* Pipeline feed */
- pkt20_index = pkt10_index;
- pkt21_index = pkt11_index;
- pkt10_index = pkt00_index;
- pkt11_index = pkt01_index;
-
- /* Pipeline stage 0 */
- lookup2_stage0(t, g, pkts, pkts_mask, pkt00_index, pkt01_index);
-
- /* Pipeline stage 1 */
- lookup2_stage1_dosig(t, g, pkts, pkt10_index, pkt11_index);
-
- /* Pipeline stage 2 */
- lookup2_stage2(t, g, pkt20_index, pkt21_index, pkts_mask_match_many);
-
- /*
- * Pipeline run
- *
- */
- for ( ; pkts_mask; ) {
- /* Pipeline feed */
- pkt30_index = pkt20_index;
- pkt31_index = pkt21_index;
- pkt20_index = pkt10_index;
- pkt21_index = pkt11_index;
- pkt10_index = pkt00_index;
- pkt11_index = pkt01_index;
-
- /* Pipeline stage 0 */
- lookup2_stage0_with_odd_support(t, g, pkts, pkts_mask,
- pkt00_index, pkt01_index);
-
- /* Pipeline stage 1 */
- lookup2_stage1_dosig(t, g, pkts, pkt10_index, pkt11_index);
-
- /* Pipeline stage 2 */
- lookup2_stage2(t, g, pkt20_index, pkt21_index,
- pkts_mask_match_many);
-
- /* Pipeline stage 3 */
- lookup2_stage3(t, g, pkts, pkt30_index, pkt31_index,
- pkts_mask_out, entries);
- }
-
- /* Pipeline feed */
- pkt30_index = pkt20_index;
- pkt31_index = pkt21_index;
- pkt20_index = pkt10_index;
- pkt21_index = pkt11_index;
- pkt10_index = pkt00_index;
- pkt11_index = pkt01_index;
-
- /* Pipeline stage 1 */
- lookup2_stage1_dosig(t, g, pkts, pkt10_index, pkt11_index);
-
- /* Pipeline stage 2 */
- lookup2_stage2(t, g, pkt20_index, pkt21_index, pkts_mask_match_many);
-
- /* Pipeline stage 3 */
- lookup2_stage3(t, g, pkts, pkt30_index, pkt31_index, pkts_mask_out,
- entries);
-
- /* Pipeline feed */
- pkt30_index = pkt20_index;
- pkt31_index = pkt21_index;
- pkt20_index = pkt10_index;
- pkt21_index = pkt11_index;
-
- /* Pipeline stage 2 */
- lookup2_stage2(t, g, pkt20_index, pkt21_index, pkts_mask_match_many);
-
- /* Pipeline stage 3 */
- lookup2_stage3(t, g, pkts, pkt30_index, pkt31_index, pkts_mask_out,
- entries);
-
- /* Pipeline feed */
- pkt30_index = pkt20_index;
- pkt31_index = pkt21_index;
-
- /* Pipeline stage 3 */
- lookup2_stage3(t, g, pkts, pkt30_index, pkt31_index, pkts_mask_out,
- entries);
-
- /* Slow path */
- pkts_mask_match_many &= ~pkts_mask_out;
- if (pkts_mask_match_many) {
- uint64_t pkts_mask_out_slow = 0;
-
- status = rte_table_hash_ext_lookup_unoptimized(table, pkts,
- pkts_mask_match_many, &pkts_mask_out_slow, entries, 1);
+ pkts_mask_match_many, &pkts_mask_out_slow, entries);
pkts_mask_out |= pkts_mask_out_slow;
}
@@ -1142,7 +969,7 @@ rte_table_hash_ext_stats_read(void *table, struct rte_table_stats *stats, int cl
return 0;
}
-struct rte_table_ops rte_table_hash_ext_ops = {
+struct rte_table_ops rte_table_hash_ext_ops = {
.f_create = rte_table_hash_ext_create,
.f_free = rte_table_hash_ext_free,
.f_add = rte_table_hash_ext_entry_add,
@@ -1152,14 +979,3 @@ struct rte_table_ops rte_table_hash_ext_ops = {
.f_lookup = rte_table_hash_ext_lookup,
.f_stats = rte_table_hash_ext_stats_read,
};
-
-struct rte_table_ops rte_table_hash_ext_dosig_ops = {
- .f_create = rte_table_hash_ext_create,
- .f_free = rte_table_hash_ext_free,
- .f_add = rte_table_hash_ext_entry_add,
- .f_delete = rte_table_hash_ext_entry_delete,
- .f_add_bulk = NULL,
- .f_delete_bulk = NULL,
- .f_lookup = rte_table_hash_ext_lookup_dosig,
- .f_stats = rte_table_hash_ext_stats_read,
-};
diff --git a/test/test-pipeline/pipeline_hash.c b/test/test-pipeline/pipeline_hash.c
index b4e4e08..e473c42 100644
--- a/test/test-pipeline/pipeline_hash.c
+++ b/test/test-pipeline/pipeline_hash.c
@@ -187,7 +187,7 @@ app_main_loop_worker_pipeline_hash(void) {
};
struct rte_pipeline_table_params table_params = {
- .ops = &rte_table_hash_ext_dosig_ops,
+ .ops = &rte_table_hash_ext_ops,
.arg_create = &table_hash_params,
.f_action_hit = NULL,
.f_action_miss = NULL,
--
2.7.4
next prev parent reply other threads:[~2017-10-18 15:04 UTC|newest]
Thread overview: 53+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-24 13:53 [dpdk-dev] [PATCH 0/5] table: add key mask for " Cristian Dumitrescu
2017-08-24 13:53 ` [dpdk-dev] [PATCH 1/5] " Cristian Dumitrescu
2017-10-10 11:18 ` [dpdk-dev] [PATCH V2 0/5] " Cristian Dumitrescu
2017-10-10 11:18 ` [dpdk-dev] [PATCH V2 1/5] " Cristian Dumitrescu
2017-10-18 15:03 ` [dpdk-dev] [PATCH v3 00/18] librte_table: " Cristian Dumitrescu
2017-10-18 15:03 ` [dpdk-dev] [PATCH v3 01/18] test: removing calls to deprecated " Cristian Dumitrescu
2017-10-18 15:03 ` [dpdk-dev] [PATCH v3 02/18] librte_table: remove deprecated 8-byte key " Cristian Dumitrescu
2017-10-18 15:03 ` [dpdk-dev] [PATCH v3 03/18] librte_table: remove deprecated 16-byte " Cristian Dumitrescu
2017-10-18 15:03 ` Cristian Dumitrescu [this message]
2017-10-18 15:03 ` [dpdk-dev] [PATCH v3 05/18] librte_table: remove deprecated variable size key lru " Cristian Dumitrescu
2017-10-18 15:03 ` [dpdk-dev] [PATCH v3 06/18] librte_table: rename cuckoo hash table ops Cristian Dumitrescu
2017-10-18 15:03 ` [dpdk-dev] [PATCH v3 07/18] librte_table: add unified params structure and mask-based hash func Cristian Dumitrescu
2017-10-18 15:03 ` [dpdk-dev] [PATCH v3 08/18] librte_table: rework variable size key ext hash tables Cristian Dumitrescu
2017-10-18 15:03 ` [dpdk-dev] [PATCH v3 09/18] librte_table: rework variable size key lru hash table Cristian Dumitrescu
2017-10-18 15:03 ` [dpdk-dev] [PATCH v3 10/18] librte_table: rework 8-byte key hash tables Cristian Dumitrescu
2017-10-18 15:03 ` [dpdk-dev] [PATCH v3 11/18] librte_table: rework 16-byte " Cristian Dumitrescu
2017-10-18 15:03 ` [dpdk-dev] [PATCH v3 12/18] librte_table: rework 32-byte " Cristian Dumitrescu
2017-10-18 15:03 ` [dpdk-dev] [PATCH v3 13/18] librte_table: rework cuckoo hash table Cristian Dumitrescu
2017-10-18 15:03 ` [dpdk-dev] [PATCH v3 14/18] test: add mask-based hash functions Cristian Dumitrescu
2017-10-18 15:03 ` [dpdk-dev] [PATCH v3 15/18] librte_table: cosmetic enhancements in api file Cristian Dumitrescu
2017-10-18 15:03 ` [dpdk-dev] [PATCH v3 16/18] librte_table: copyright cosmetic updates Cristian Dumitrescu
2017-10-18 15:03 ` [dpdk-dev] [PATCH v3 17/18] librte_table: map file updates Cristian Dumitrescu
2017-10-18 15:03 ` [dpdk-dev] [PATCH v3 18/18] doc: remove deprecation notice for librte_table Cristian Dumitrescu
2017-10-18 15:03 ` [dpdk-dev] [PATCH v3 00/18] librte_table: add key mask for hash tables Cristian Dumitrescu
2017-10-18 17:10 ` Dumitrescu, Cristian
2017-10-18 15:03 ` [dpdk-dev] [PATCH v3 01/18] test: removing calls to deprecated " Cristian Dumitrescu
2017-10-18 15:03 ` [dpdk-dev] [PATCH v3 02/18] librte_table: remove deprecated 8-byte key " Cristian Dumitrescu
2017-10-18 15:03 ` [dpdk-dev] [PATCH v3 03/18] librte_table: remove deprecated 16-byte " Cristian Dumitrescu
2017-10-18 15:03 ` [dpdk-dev] [PATCH v3 04/18] librte_table: remove deprecated variable size key ext " Cristian Dumitrescu
2017-10-18 15:03 ` [dpdk-dev] [PATCH v3 05/18] librte_table: remove deprecated variable size key lru " Cristian Dumitrescu
2017-10-18 15:03 ` [dpdk-dev] [PATCH v3 06/18] librte_table: rename cuckoo hash table ops Cristian Dumitrescu
2017-10-18 15:03 ` [dpdk-dev] [PATCH v3 07/18] librte_table: add unified params structure and mask-based hash func Cristian Dumitrescu
2017-10-18 15:03 ` [dpdk-dev] [PATCH v3 08/18] librte_table: rework variable size key ext hash tables Cristian Dumitrescu
2017-10-18 15:03 ` [dpdk-dev] [PATCH v3 09/18] librte_table: rework variable size key lru hash table Cristian Dumitrescu
2017-10-18 15:03 ` [dpdk-dev] [PATCH v3 10/18] librte_table: rework 8-byte key hash tables Cristian Dumitrescu
2017-10-18 15:03 ` [dpdk-dev] [PATCH v3 11/18] librte_table: rework 16-byte " Cristian Dumitrescu
2017-10-18 15:03 ` [dpdk-dev] [PATCH v3 12/18] librte_table: rework 32-byte " Cristian Dumitrescu
2017-10-18 15:03 ` [dpdk-dev] [PATCH v3 13/18] librte_table: rework cuckoo hash table Cristian Dumitrescu
2017-10-18 15:03 ` [dpdk-dev] [PATCH v3 14/18] test: add mask-based hash functions Cristian Dumitrescu
2017-10-18 15:03 ` [dpdk-dev] [PATCH v3 15/18] librte_table: cosmetic enhancements in api file Cristian Dumitrescu
2017-10-18 15:03 ` [dpdk-dev] [PATCH v3 16/18] librte_table: copyright cosmetic updates Cristian Dumitrescu
2017-10-18 15:03 ` [dpdk-dev] [PATCH v3 17/18] librte_table: map file updates Cristian Dumitrescu
2017-10-18 15:03 ` [dpdk-dev] [PATCH v3 18/18] doc: remove deprecation notice for librte_table Cristian Dumitrescu
2017-10-18 18:30 ` Mcnamara, John
2017-10-10 11:18 ` [dpdk-dev] [PATCH V2 2/5] test: update due to api changes in librte_table Cristian Dumitrescu
2017-10-10 11:18 ` [dpdk-dev] [PATCH V2 3/5] test-pipeline: " Cristian Dumitrescu
2017-10-10 11:19 ` [dpdk-dev] [PATCH V2 4/5] ip_pipeline: " Cristian Dumitrescu
2017-10-10 11:19 ` [dpdk-dev] [PATCH V2 5/5] deprecation: removed the librte_table notice Cristian Dumitrescu
2017-10-11 14:22 ` [dpdk-dev] [PATCH V2 0/5] table: add key mask for hash tables Dumitrescu, Cristian
2017-08-24 13:53 ` [dpdk-dev] [PATCH 2/5] test: update due to api changes in librte_table Cristian Dumitrescu
2017-08-24 13:53 ` [dpdk-dev] [PATCH 3/5] test-pipeline: " Cristian Dumitrescu
2017-08-24 13:53 ` [dpdk-dev] [PATCH 4/5] ip_pipeline: " Cristian Dumitrescu
2017-08-24 13:53 ` [dpdk-dev] [PATCH 5/5] deprecation: removed the librte_table notice Cristian Dumitrescu
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=1508339034-171115-5-git-send-email-cristian.dumitrescu@intel.com \
--to=cristian.dumitrescu@intel.com \
--cc=dev@dpdk.org \
--cc=thomas@monjalon.net \
/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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).