Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/5887/?format=api
https://patches.dpdk.org/api/patches/5887/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/1435530330-10132-3-git-send-email-pablo.de.lara.guarch@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": "<1435530330-10132-3-git-send-email-pablo.de.lara.guarch@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1435530330-10132-3-git-send-email-pablo.de.lara.guarch@intel.com", "date": "2015-06-28T22:25:21", "name": "[dpdk-dev,v3,02/11] hash: move rte_hash structure to C file and make it internal", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "d08ecaebe86e7431cf36603b1cbf8a264829c0a3", "submitter": { "id": 9, "url": "https://patches.dpdk.org/api/people/9/?format=api", "name": "De Lara Guarch, Pablo", "email": "pablo.de.lara.guarch@intel.com" }, "delegate": null, "mbox": "https://patches.dpdk.org/project/dpdk/patch/1435530330-10132-3-git-send-email-pablo.de.lara.guarch@intel.com/mbox/", "series": [], "comments": "https://patches.dpdk.org/api/patches/5887/comments/", "check": "pending", "checks": "https://patches.dpdk.org/api/patches/5887/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 [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id 36F70C5CA;\n\tMon, 29 Jun 2015 00:25:37 +0200 (CEST)", "from mga02.intel.com (mga02.intel.com [134.134.136.20])\n\tby dpdk.org (Postfix) with ESMTP id 315E6C510\n\tfor <dev@dpdk.org>; Mon, 29 Jun 2015 00:25:33 +0200 (CEST)", "from fmsmga001.fm.intel.com ([10.253.24.23])\n\tby orsmga101.jf.intel.com with ESMTP; 28 Jun 2015 15:25:31 -0700", "from irvmail001.ir.intel.com ([163.33.26.43])\n\tby fmsmga001.fm.intel.com with ESMTP; 28 Jun 2015 15:25:31 -0700", "from sivswdev02.ir.intel.com (sivswdev02.ir.intel.com\n\t[10.237.217.46])\n\tby irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id\n\tt5SMPUrE030613; Sun, 28 Jun 2015 23:25:30 +0100", "from sivswdev02.ir.intel.com (localhost [127.0.0.1])\n\tby sivswdev02.ir.intel.com with ESMTP id t5SMPU09010180;\n\tSun, 28 Jun 2015 23:25:30 +0100", "(from pdelarax@localhost)\n\tby sivswdev02.ir.intel.com with id t5SMPUs0010176;\n\tSun, 28 Jun 2015 23:25:30 +0100" ], "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.13,695,1427785200\"; d=\"scan'208\";a=\"736499437\"", "From": "Pablo de Lara <pablo.de.lara.guarch@intel.com>", "To": "dev@dpdk.org", "Date": "Sun, 28 Jun 2015 23:25:21 +0100", "Message-Id": "<1435530330-10132-3-git-send-email-pablo.de.lara.guarch@intel.com>", "X-Mailer": "git-send-email 1.7.4.1", "In-Reply-To": "<1435530330-10132-1-git-send-email-pablo.de.lara.guarch@intel.com>", "References": "<1435269919-7007-1-git-send-email-pablo.de.lara.guarch@intel.com>\n\t<1435530330-10132-1-git-send-email-pablo.de.lara.guarch@intel.com>", "Subject": "[dpdk-dev] [PATCH v3 02/11] hash: move rte_hash structure to C file\n\tand make it internal", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "Precedence": "list", "List-Id": "patches and discussions about DPDK <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": "rte_hash structure should not be a public structure,\nand therefore it should be moved to the C file and be declared\nas internal.\n\nThis patch also removes part of a unit test that was checking\na field of the structure.\n\nSigned-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>\n---\n app/test/test_hash.c | 6 +-----\n lib/librte_hash/rte_hash.c | 30 +++++++++++++++++++++++++++++-\n lib/librte_hash/rte_hash.h | 37 +++++--------------------------------\n 3 files changed, 35 insertions(+), 38 deletions(-)", "diff": "diff --git a/app/test/test_hash.c b/app/test/test_hash.c\nindex 4ecb11b..4300de9 100644\n--- a/app/test/test_hash.c\n+++ b/app/test/test_hash.c\n@@ -1,7 +1,7 @@\n /*-\n * BSD LICENSE\n *\n- * Copyright(c) 2010-2014 Intel Corporation. All rights reserved.\n+ * Copyright(c) 2010-2015 Intel Corporation. All rights reserved.\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n@@ -1110,10 +1110,6 @@ test_hash_creation_with_good_parameters(void)\n \t\tprintf(\"Creating hash with null hash_func failed\\n\");\n \t\treturn -1;\n \t}\n-\tif (handle->hash_func == NULL) {\n-\t\tprintf(\"Hash function should have been DEFAULT_HASH_FUNC\\n\");\n-\t\treturn -1;\n-\t}\n \n \t/* this test is trying to create a hash with the same name as previous one.\n \t * this should return a pointer to the hash we previously created.\ndiff --git a/lib/librte_hash/rte_hash.c b/lib/librte_hash/rte_hash.c\nindex 67dff5b..5100a75 100644\n--- a/lib/librte_hash/rte_hash.c\n+++ b/lib/librte_hash/rte_hash.c\n@@ -1,7 +1,7 @@\n /*-\n * BSD LICENSE\n *\n- * Copyright(c) 2010-2014 Intel Corporation. All rights reserved.\n+ * Copyright(c) 2010-2015 Intel Corporation. All rights reserved.\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n@@ -92,6 +92,27 @@ EAL_REGISTER_TAILQ(rte_hash_tailq)\n /* The high bit is always set in real signatures */\n #define NULL_SIGNATURE 0\n \n+struct rte_hash {\n+\tchar name[RTE_HASH_NAMESIZE];\t/**< Name of the hash. */\n+\tuint32_t entries;\t\t/**< Total table entries. */\n+\tuint32_t bucket_entries;\t/**< Bucket entries. */\n+\tuint32_t key_len;\t\t/**< Length of hash key. */\n+\trte_hash_function hash_func;\t/**< Function used to calculate hash. */\n+\tuint32_t hash_func_init_val;\t/**< Init value used by hash_func. */\n+\tuint32_t num_buckets;\t\t/**< Number of buckets in table. */\n+\tuint32_t bucket_bitmask;\t/**< Bitmask for getting bucket index\n+\t\t\t\t\t\t\tfrom hash signature. */\n+\thash_sig_t sig_msb;\t/**< MSB is always set in valid signatures. */\n+\tuint8_t *sig_tbl;\t/**< Flat array of hash signature buckets. */\n+\tuint32_t sig_tbl_bucket_size;\t/**< Signature buckets may be padded for\n+\t\t\t\t\t alignment reasons, and this is the\n+\t\t\t\t\t bucket size used by sig_tbl. */\n+\tuint8_t *key_tbl;\t/**< Flat array of key value buckets. */\n+\tuint32_t key_tbl_key_size;\t/**< Keys may be padded for alignment\n+\t\t\t\t\t reasons, and this is the key size\n+\t\t\t\t\t used\tby key_tbl. */\n+};\n+\n /* Returns a pointer to the first signature in specified bucket. */\n static inline hash_sig_t *\n get_sig_tbl_bucket(const struct rte_hash *h, uint32_t bucket_index)\n@@ -291,6 +312,13 @@ rte_hash_free(struct rte_hash *h)\n \trte_free(te);\n }\n \n+hash_sig_t\n+rte_hash_hash(const struct rte_hash *h, const void *key)\n+{\n+\t/* calc hash result by key */\n+\treturn h->hash_func(key, h->key_len, h->hash_func_init_val);\n+}\n+\n static inline int32_t\n __rte_hash_add_key_with_hash(const struct rte_hash *h,\n \t\t\t\tconst void *key, hash_sig_t sig)\ndiff --git a/lib/librte_hash/rte_hash.h b/lib/librte_hash/rte_hash.h\nindex 821a9d4..79827a6 100644\n--- a/lib/librte_hash/rte_hash.h\n+++ b/lib/librte_hash/rte_hash.h\n@@ -1,7 +1,7 @@\n /*-\n * BSD LICENSE\n *\n- * Copyright(c) 2010-2014 Intel Corporation. All rights reserved.\n+ * Copyright(c) 2010-2015 Intel Corporation. All rights reserved.\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n@@ -40,9 +40,6 @@\n * RTE Hash Table\n */\n \n-#include <stdint.h>\n-#include <sys/queue.h>\n-\n #ifdef __cplusplus\n extern \"C\" {\n #endif\n@@ -84,27 +81,8 @@ struct rte_hash_parameters {\n \tint socket_id;\t\t\t/**< NUMA Socket ID for memory. */\n };\n \n-/** A hash table structure. */\n-struct rte_hash {\n-\tchar name[RTE_HASH_NAMESIZE];\t/**< Name of the hash. */\n-\tuint32_t entries;\t\t/**< Total table entries. */\n-\tuint32_t bucket_entries;\t/**< Bucket entries. */\n-\tuint32_t key_len;\t\t/**< Length of hash key. */\n-\trte_hash_function hash_func;\t/**< Function used to calculate hash. */\n-\tuint32_t hash_func_init_val;\t/**< Init value used by hash_func. */\n-\tuint32_t num_buckets;\t\t/**< Number of buckets in table. */\n-\tuint32_t bucket_bitmask;\t/**< Bitmask for getting bucket index\n-\t\t\t\t\t\t\tfrom hash signature. */\n-\thash_sig_t sig_msb;\t/**< MSB is always set in valid signatures. */\n-\tuint8_t *sig_tbl;\t/**< Flat array of hash signature buckets. */\n-\tuint32_t sig_tbl_bucket_size;\t/**< Signature buckets may be padded for\n-\t\t\t\t\t alignment reasons, and this is the\n-\t\t\t\t\t bucket size used by sig_tbl. */\n-\tuint8_t *key_tbl;\t/**< Flat array of key value buckets. */\n-\tuint32_t key_tbl_key_size;\t/**< Keys may be padded for alignment\n-\t\t\t\t\t reasons, and this is the key size\n-\t\t\t\t\t used\tby key_tbl. */\n-};\n+/** @internal A hash table structure. */\n+struct rte_hash;\n \n /**\n * Create a new hash table.\n@@ -262,7 +240,6 @@ int32_t\n rte_hash_lookup_with_hash(const struct rte_hash *h,\n \t\t\t\tconst void *key, hash_sig_t sig);\n \n-\n /**\n * Calc a hash value by key. This operation is not multi-process safe.\n *\n@@ -273,12 +250,8 @@ rte_hash_lookup_with_hash(const struct rte_hash *h,\n * @return\n * - hash value\n */\n-static inline hash_sig_t\n-rte_hash_hash(const struct rte_hash *h, const void *key)\n-{\n-\t/* calc hash result by key */\n-\treturn h->hash_func(key, h->key_len, h->hash_func_init_val);\n-}\n+hash_sig_t\n+rte_hash_hash(const struct rte_hash *h, const void *key);\n \n #define rte_hash_lookup_multi rte_hash_lookup_bulk\n /**\n", "prefixes": [ "dpdk-dev", "v3", "02/11" ] }{ "id": 5887, "url": "