From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from youngberry.canonical.com (youngberry.canonical.com [91.189.89.112]) by dpdk.org (Postfix) with ESMTP id 5F55E4C9D for ; Tue, 14 Aug 2018 13:09:48 +0200 (CEST) Received: from 1.general.paelzer.uk.vpn ([10.172.196.172] helo=lap.fritz.box) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1fpXAj-0000wO-Dx; Tue, 14 Aug 2018 11:07:33 +0000 From: Christian Ehrhardt To: Pablo de Lara Cc: Petr Houska , dpdk stable Date: Tue, 14 Aug 2018 13:06:44 +0200 Message-Id: <20180814110651.25277-41-christian.ehrhardt@canonical.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180814110651.25277-1-christian.ehrhardt@canonical.com> References: <20180814110651.25277-1-christian.ehrhardt@canonical.com> Subject: [dpdk-stable] patch 'hash: fix doxygen of return values' has been queued to stable release 18.05.1 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Aug 2018 11:09:48 -0000 Hi, FYI, your patch has been queued to stable release 18.05.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 08/16/18. So please shout if anyone has objections. Thanks. Christian Ehrhardt --- >>From 8ade816d20b07670a2e8f3f595b710d0a0f36b96 Mon Sep 17 00:00:00 2001 From: Pablo de Lara Date: Tue, 7 Aug 2018 03:00:04 +0100 Subject: [PATCH] hash: fix doxygen of return values [ upstream commit f9975d333a8d51e4c15961f56a554914288768aa ] rte_hash_lookup_data() and rte_hash_lookup_with_hash_data() functions return the index of the table where the key is stored when this is found, and not 0 as the Doxygen currently states. Also, these functions, and rte_hash_get_key_with_position() return negative values when keys are not found (-EINVAL and -ENOENT), where the minus sign was missing. Bugzilla ID: 78 Fixes: 473d1bebce43 ("hash: allow to store data in hash table") Fixes: 6dc34e0afe7a ("hash: retrieve a key given its position") Reported-by: Petr Houska Signed-off-by: Pablo de Lara --- lib/librte_hash/rte_hash.h | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/lib/librte_hash/rte_hash.h b/lib/librte_hash/rte_hash.h index f71ca9fbf..ed5c134b1 100644 --- a/lib/librte_hash/rte_hash.h +++ b/lib/librte_hash/rte_hash.h @@ -254,8 +254,8 @@ rte_hash_del_key_with_hash(const struct rte_hash *h, const void *key, hash_sig_t * Output containing a pointer to the key * @return * - 0 if retrieved successfully - * - EINVAL if the parameters are invalid. - * - ENOENT if no valid key is found in the given position. + * - -EINVAL if the parameters are invalid. + * - -ENOENT if no valid key is found in the given position. */ int rte_hash_get_key_with_position(const struct rte_hash *h, const int32_t position, @@ -272,9 +272,11 @@ rte_hash_get_key_with_position(const struct rte_hash *h, const int32_t position, * @param data * Output with pointer to data returned from the hash table. * @return - * 0 if successful lookup - * - EINVAL if the parameters are invalid. - * - ENOENT if the key is not found. + * - A positive value that can be used by the caller as an offset into an + * array of user data. This value is unique for this key, and is the same + * value that was returned when the key was added. + * - -EINVAL if the parameters are invalid. + * - -ENOENT if the key is not found. */ int rte_hash_lookup_data(const struct rte_hash *h, const void *key, void **data); @@ -293,9 +295,11 @@ rte_hash_lookup_data(const struct rte_hash *h, const void *key, void **data); * @param data * Output with pointer to data returned from the hash table. * @return - * 0 if successful lookup - * - EINVAL if the parameters are invalid. - * - ENOENT if the key is not found. + * - A positive value that can be used by the caller as an offset into an + * array of user data. This value is unique for this key, and is the same + * value that was returned when the key was added. + * - -EINVAL if the parameters are invalid. + * - -ENOENT if the key is not found. */ int rte_hash_lookup_with_hash_data(const struct rte_hash *h, const void *key, -- 2.17.1