Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/30557/?format=api
https://patches.dpdk.org/api/patches/30557/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/1508339034-171115-27-git-send-email-cristian.dumitrescu@intel.com/", "project": { "id": 1, "url": "https://patches.dpdk.org/api/projects/1/?format=api", "name": "DPDK", "link_name": "dpdk", "list_id": "dev.dpdk.org", "list_email": "dev@dpdk.org", "web_url": "http://core.dpdk.org", "scm_url": "git://dpdk.org/dpdk", "webscm_url": "http://git.dpdk.org/dpdk", "list_archive_url": "https://inbox.dpdk.org/dev", "list_archive_url_format": "https://inbox.dpdk.org/dev/{}", "commit_url_format": "" }, "msgid": "<1508339034-171115-27-git-send-email-cristian.dumitrescu@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1508339034-171115-27-git-send-email-cristian.dumitrescu@intel.com", "date": "2017-10-18T15:03:43", "name": "[dpdk-dev,v3,07/18] librte_table: add unified params structure and mask-based hash func", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "c2b1600fc85736b6c9c44f99435edd3452a608d0", "submitter": { "id": 19, "url": "https://patches.dpdk.org/api/people/19/?format=api", "name": "Cristian Dumitrescu", "email": "cristian.dumitrescu@intel.com" }, "delegate": null, "mbox": "https://patches.dpdk.org/project/dpdk/patch/1508339034-171115-27-git-send-email-cristian.dumitrescu@intel.com/mbox/", "series": [], "comments": "https://patches.dpdk.org/api/patches/30557/comments/", "check": "success", "checks": "https://patches.dpdk.org/api/patches/30557/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@dpdk.org", "Delivered-To": "patchwork@dpdk.org", "Received": [ "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id C3E0A1B1FE;\n\tWed, 18 Oct 2017 17:05:09 +0200 (CEST)", "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n\tby dpdk.org (Postfix) with ESMTP id 15C751B1C4\n\tfor <dev@dpdk.org>; Wed, 18 Oct 2017 17:04:26 +0200 (CEST)", "from orsmga004.jf.intel.com ([10.7.209.38])\n\tby fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t18 Oct 2017 08:04:26 -0700", "from silpixa00382658.ir.intel.com ([10.237.223.29])\n\tby orsmga004.jf.intel.com with ESMTP; 18 Oct 2017 08:04:25 -0700" ], "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.43,397,1503385200\"; d=\"scan'208\";a=\"139673172\"", "From": "Cristian Dumitrescu <cristian.dumitrescu@intel.com>", "To": "dev@dpdk.org", "Cc": "thomas@monjalon.net", "Date": "Wed, 18 Oct 2017 16:03:43 +0100", "Message-Id": "<1508339034-171115-27-git-send-email-cristian.dumitrescu@intel.com>", "X-Mailer": "git-send-email 2.7.4", "In-Reply-To": "<1508339034-171115-1-git-send-email-cristian.dumitrescu@intel.com>", "References": "<1507634341-72277-2-git-send-email-cristian.dumitrescu@intel.com>\n\t<1508339034-171115-1-git-send-email-cristian.dumitrescu@intel.com>", "Subject": "[dpdk-dev] [PATCH v3 07/18] librte_table: add unified params\n\tstructure and mask-based hash func", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "Precedence": "list", "List-Id": "DPDK patches and discussions <dev.dpdk.org>", "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://dpdk.org/ml/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "Add unified parameter structure for all hash tables in librte_table.\n\nAdd mask-based hash function prototype, which is input parameter for\nall hash tables.\n\nRenamed the non-mask-based hash function prototype and all the calls\nto it (to be removed later).\n\nSigned-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>\n---\n .../pipeline/pipeline_flow_classification_be.c | 2 +-\n .../ip_pipeline/pipeline/pipeline_passthrough_be.c | 4 +-\n lib/librte_table/rte_table_hash.h | 52 ++++++++++++++++++----\n lib/librte_table/rte_table_hash_cuckoo.c | 2 +-\n lib/librte_table/rte_table_hash_ext.c | 4 +-\n lib/librte_table/rte_table_hash_key16.c | 2 +-\n lib/librte_table/rte_table_hash_key32.c | 2 +-\n lib/librte_table/rte_table_hash_key8.c | 4 +-\n lib/librte_table/rte_table_hash_lru.c | 4 +-\n 9 files changed, 55 insertions(+), 21 deletions(-)", "diff": "diff --git a/examples/ip_pipeline/pipeline/pipeline_flow_classification_be.c b/examples/ip_pipeline/pipeline/pipeline_flow_classification_be.c\nindex 191cb15..e131a5b 100644\n--- a/examples/ip_pipeline/pipeline/pipeline_flow_classification_be.c\n+++ b/examples/ip_pipeline/pipeline/pipeline_flow_classification_be.c\n@@ -118,7 +118,7 @@ struct flow_table_entry {\n \tuint32_t pad;\n };\n \n-rte_table_hash_op_hash hash_func[] = {\n+rte_table_hash_op_hash_nomask hash_func[] = {\n \thash_default_key8,\n \thash_default_key16,\n \thash_default_key24,\ndiff --git a/examples/ip_pipeline/pipeline/pipeline_passthrough_be.c b/examples/ip_pipeline/pipeline/pipeline_passthrough_be.c\nindex 8cb2f0c..6b57f83\n--- a/examples/ip_pipeline/pipeline/pipeline_passthrough_be.c\n+++ b/examples/ip_pipeline/pipeline/pipeline_passthrough_be.c\n@@ -52,7 +52,7 @@\n struct pipeline_passthrough {\n \tstruct pipeline p;\n \tstruct pipeline_passthrough_params params;\n-\trte_table_hash_op_hash f_hash;\n+\trte_table_hash_op_hash_nomask f_hash;\n \tuint32_t swap_field0_offset[SWAP_DIM];\n \tuint32_t swap_field1_offset[SWAP_DIM];\n \tuint64_t swap_field_mask[SWAP_DIM];\n@@ -677,7 +677,7 @@ pipeline_passthrough_parse_args(struct pipeline_passthrough_params *p,\n \treturn 0;\n }\n \n-static rte_table_hash_op_hash\n+static rte_table_hash_op_hash_nomask\n get_hash_function(struct pipeline_passthrough *p)\n {\n \tswitch (p->params.dma_size) {\ndiff --git a/lib/librte_table/rte_table_hash.h b/lib/librte_table/rte_table_hash.h\nindex 5f655ee..bb5b83d 100644\n--- a/lib/librte_table/rte_table_hash.h\n+++ b/lib/librte_table/rte_table_hash.h\n@@ -98,6 +98,40 @@ extern \"C\" {\n /** Hash function */\n typedef uint64_t (*rte_table_hash_op_hash)(\n \tvoid *key,\n+\tvoid *key_mask,\n+\tuint32_t key_size,\n+\tuint64_t seed);\n+\n+/** Hash table parameters */\n+struct rte_table_hash_params {\n+\t/** Name */\n+\tconst char *name;\n+\n+\t/** Key size (number of bytes) */\n+\tuint32_t key_size;\n+\n+\t/** Byte offset within packet meta-data where the key is located */\n+\tuint32_t key_offset;\n+\n+\t/** Key mask */\n+\tuint8_t *key_mask;\n+\n+\t/** Number of keys */\n+\tuint32_t n_keys;\n+\n+\t/** Number of buckets */\n+\tuint32_t n_buckets;\n+\n+\t/** Hash function */\n+\trte_table_hash_op_hash f_hash;\n+\n+\t/** Seed value for the hash function */\n+\tuint64_t seed;\n+};\n+\n+/** Hash function */\n+typedef uint64_t (*rte_table_hash_op_hash_nomask)(\n+\tvoid *key,\n \tuint32_t key_size,\n \tuint64_t seed);\n \n@@ -121,7 +155,7 @@ struct rte_table_hash_ext_params {\n \tuint32_t n_buckets_ext;\n \n \t/** Hash function */\n-\trte_table_hash_op_hash f_hash;\n+\trte_table_hash_op_hash_nomask f_hash;\n \n \t/** Seed value for the hash function */\n \tuint64_t seed;\n@@ -149,7 +183,7 @@ struct rte_table_hash_lru_params {\n \tuint32_t n_buckets;\n \n \t/** Hash function */\n-\trte_table_hash_op_hash f_hash;\n+\trte_table_hash_op_hash_nomask f_hash;\n \n \t/** Seed value for the hash function */\n \tuint64_t seed;\n@@ -175,7 +209,7 @@ struct rte_table_hash_key8_lru_params {\n \tuint32_t n_entries;\n \n \t/** Hash function */\n-\trte_table_hash_op_hash f_hash;\n+\trte_table_hash_op_hash_nomask f_hash;\n \n \t/** Seed for the hash function */\n \tuint64_t seed;\n@@ -204,7 +238,7 @@ struct rte_table_hash_key8_ext_params {\n \tuint32_t n_entries_ext;\n \n \t/** Hash function */\n-\trte_table_hash_op_hash f_hash;\n+\trte_table_hash_op_hash_nomask f_hash;\n \n \t/** Seed for the hash function */\n \tuint64_t seed;\n@@ -233,7 +267,7 @@ struct rte_table_hash_key16_lru_params {\n \tuint32_t n_entries;\n \n \t/** Hash function */\n-\trte_table_hash_op_hash f_hash;\n+\trte_table_hash_op_hash_nomask f_hash;\n \n \t/** Seed for the hash function */\n \tuint64_t seed;\n@@ -262,7 +296,7 @@ struct rte_table_hash_key16_ext_params {\n \tuint32_t n_entries_ext;\n \n \t/** Hash function */\n-\trte_table_hash_op_hash f_hash;\n+\trte_table_hash_op_hash_nomask f_hash;\n \n \t/** Seed for the hash function */\n \tuint64_t seed;\n@@ -291,7 +325,7 @@ struct rte_table_hash_key32_lru_params {\n \tuint32_t n_entries;\n \n \t/** Hash function */\n-\trte_table_hash_op_hash f_hash;\n+\trte_table_hash_op_hash_nomask f_hash;\n \n \t/** Seed for the hash function */\n \tuint64_t seed;\n@@ -318,7 +352,7 @@ struct rte_table_hash_key32_ext_params {\n \tuint32_t n_entries_ext;\n \n \t/** Hash function */\n-\trte_table_hash_op_hash f_hash;\n+\trte_table_hash_op_hash_nomask f_hash;\n \n \t/** Seed for the hash function */\n \tuint64_t seed;\n@@ -344,7 +378,7 @@ struct rte_table_hash_cuckoo_params {\n \tuint32_t n_keys;\n \n \t/** Hash function used to calculate hash */\n-\trte_table_hash_op_hash f_hash;\n+\trte_table_hash_op_hash_nomask f_hash;\n \n \t/** Seed value or Init value used by f_hash */\n \tuint32_t seed;\ndiff --git a/lib/librte_table/rte_table_hash_cuckoo.c b/lib/librte_table/rte_table_hash_cuckoo.c\nindex beb45c5..9b42423 100644\n--- a/lib/librte_table/rte_table_hash_cuckoo.c\n+++ b/lib/librte_table/rte_table_hash_cuckoo.c\n@@ -64,7 +64,7 @@ struct rte_table_hash {\n \tuint32_t key_size;\n \tuint32_t entry_size;\n \tuint32_t n_keys;\n-\trte_table_hash_op_hash f_hash;\n+\trte_table_hash_op_hash_nomask f_hash;\n \tuint32_t seed;\n \tuint32_t signature_offset;\n \tuint32_t key_offset;\ndiff --git a/lib/librte_table/rte_table_hash_ext.c b/lib/librte_table/rte_table_hash_ext.c\nindex c4824c3..72802b8 100644\n--- a/lib/librte_table/rte_table_hash_ext.c\n+++ b/lib/librte_table/rte_table_hash_ext.c\n@@ -104,7 +104,7 @@ struct rte_table_hash {\n \tuint32_t n_keys;\n \tuint32_t n_buckets;\n \tuint32_t n_buckets_ext;\n-\trte_table_hash_op_hash f_hash;\n+\trte_table_hash_op_hash_nomask f_hash;\n \tuint64_t seed;\n \tuint32_t signature_offset;\n \tuint32_t key_offset;\n@@ -688,7 +688,7 @@ static int rte_table_hash_ext_lookup_unoptimized(\n \tstruct bucket *bkt10, *bkt11, *buckets = t->buckets;\t\t\\\n \tuint8_t *key10, *key11;\t\t\t\t\t\t\\\n \tuint64_t bucket_mask = t->bucket_mask;\t\t\t\t\\\n-\trte_table_hash_op_hash f_hash = t->f_hash;\t\t\t\\\n+\trte_table_hash_op_hash_nomask f_hash = t->f_hash;\t\t\t\\\n \tuint64_t seed = t->seed;\t\t\t\t\t\\\n \tuint32_t key_size = t->key_size;\t\t\t\t\\\n \tuint32_t key_offset = t->key_offset;\t\t\t\t\\\ndiff --git a/lib/librte_table/rte_table_hash_key16.c b/lib/librte_table/rte_table_hash_key16.c\nindex 4ed5c78..7f6651c 100644\n--- a/lib/librte_table/rte_table_hash_key16.c\n+++ b/lib/librte_table/rte_table_hash_key16.c\n@@ -86,7 +86,7 @@ struct rte_table_hash {\n \tuint32_t signature_offset;\n \tuint32_t key_offset;\n \tuint64_t key_mask[2];\n-\trte_table_hash_op_hash f_hash;\n+\trte_table_hash_op_hash_nomask f_hash;\n \tuint64_t seed;\n \n \t/* Extendible buckets */\ndiff --git a/lib/librte_table/rte_table_hash_key32.c b/lib/librte_table/rte_table_hash_key32.c\nindex 31fe6fd..f8f6662 100644\n--- a/lib/librte_table/rte_table_hash_key32.c\n+++ b/lib/librte_table/rte_table_hash_key32.c\n@@ -85,7 +85,7 @@ struct rte_table_hash {\n \tuint32_t bucket_size;\n \tuint32_t signature_offset;\n \tuint32_t key_offset;\n-\trte_table_hash_op_hash f_hash;\n+\trte_table_hash_op_hash_nomask f_hash;\n \tuint64_t seed;\n \n \t/* Extendible buckets */\ndiff --git a/lib/librte_table/rte_table_hash_key8.c b/lib/librte_table/rte_table_hash_key8.c\nindex f2b285d..4fbb02e 100644\n--- a/lib/librte_table/rte_table_hash_key8.c\n+++ b/lib/librte_table/rte_table_hash_key8.c\n@@ -83,7 +83,7 @@ struct rte_table_hash {\n \tuint32_t signature_offset;\n \tuint32_t key_offset;\n \tuint64_t key_mask;\n-\trte_table_hash_op_hash f_hash;\n+\trte_table_hash_op_hash_nomask f_hash;\n \tuint64_t seed;\n \n \t/* Extendible buckets */\n@@ -733,7 +733,7 @@ rte_table_hash_entry_delete_key8_ext(\n \tuint64_t hash_offset_buffer11;\t\t\t\t\\\n \tuint64_t signature10, signature11;\t\t\t\\\n \tuint32_t bucket10_index, bucket11_index;\t\t\\\n-\trte_table_hash_op_hash f_hash = f->f_hash;\t\t\\\n+\trte_table_hash_op_hash_nomask f_hash = f->f_hash;\t\t\\\n \tuint64_t seed = f->seed;\t\t\t\t\\\n \tuint32_t key_offset = f->key_offset;\t\t\t\\\n \t\t\t\t\t\t\t\t\\\ndiff --git a/lib/librte_table/rte_table_hash_lru.c b/lib/librte_table/rte_table_hash_lru.c\nindex 0a85123..61050f3 100644\n--- a/lib/librte_table/rte_table_hash_lru.c\n+++ b/lib/librte_table/rte_table_hash_lru.c\n@@ -84,7 +84,7 @@ struct rte_table_hash {\n \tuint32_t entry_size;\n \tuint32_t n_keys;\n \tuint32_t n_buckets;\n-\trte_table_hash_op_hash f_hash;\n+\trte_table_hash_op_hash_nomask f_hash;\n \tuint64_t seed;\n \tuint32_t signature_offset;\n \tuint32_t key_offset;\n@@ -619,7 +619,7 @@ static int rte_table_hash_lru_lookup_unoptimized(\n \tstruct bucket *bkt10, *bkt11, *buckets = t->buckets;\t\\\n \tuint8_t *key10, *key11;\t\t\t\t\t\\\n \tuint64_t bucket_mask = t->bucket_mask;\t\t\t\\\n-\trte_table_hash_op_hash f_hash = t->f_hash;\t\t\\\n+\trte_table_hash_op_hash_nomask f_hash = t->f_hash;\t\t\\\n \tuint64_t seed = t->seed;\t\t\t\t\\\n \tuint32_t key_size = t->key_size;\t\t\t\\\n \tuint32_t key_offset = t->key_offset;\t\t\t\\\n", "prefixes": [ "dpdk-dev", "v3", "07/18" ] }{ "id": 30557, "url": "