From mboxrd@z Thu Jan 1 00:00:00 1970 From: bugzilla@dpdk.org Subject: [Bug 78] Mismatch between return value and documentation for `rte_hash_lookup_data` (cuckoo hashing implementation) Date: Mon, 06 Aug 2018 16:49:21 +0000 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable To: dev@dpdk.org Return-path: List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" https://bugs.dpdk.org/show_bug.cgi?id=3D78 Bug ID: 78 Summary: Mismatch between return value and documentation for `rte_hash_lookup_data` (cuckoo hashing implementation) Product: DPDK Version: 18.05 Hardware: All OS: All Status: CONFIRMED Severity: minor Priority: Normal Component: doc Assignee: dev@dpdk.org Reporter: t-pehous@microsoft.com Target Milestone: --- Documentation for `rte_hash_lookup_data` specifies that this method returns= 0 on successful data lookup or positive error code on not-found / wrong parameters. In reality it returns positive index of found data on success = and negative error on error, in essence it behaves the same as (i.e. the same = as=20 rte_hash_lookup while also (correctly) populating the data pointer). rte_cuckoo_hash.c: 733 ```c int rte_hash_lookup_data(const struct rte_hash *h, const void *key, void **data= ) { RETURN_IF_TRUE(((h =3D=3D NULL) || (key =3D=3D NULL)), -EIN= VAL); return __rte_hash_lookup_with_hash(h, key, rte_hash_hash(h, key), data); } ``` Rte_cuckoo_hash.c: 693 ```c static inline int32_t __rte_hash_lookup_with_hash(const struct rte_hash *h, const void *key, =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20 hash_sig_t sig, void **data) { ... /* * Return in= dex where key is stored, * subtracti= ng the first dummy index */ return bkt->key_idx[i] - 1; ``` DPDK version 18.05 release. --=20 You are receiving this mail because: You are the assignee for the bug.=