DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [Bug 78] Mismatch between return value and documentation for `rte_hash_lookup_data` (cuckoo hashing implementation)
@ 2018-08-06 16:49 bugzilla
  2018-08-07 17:34 ` bugzilla
  0 siblings, 1 reply; 2+ messages in thread
From: bugzilla @ 2018-08-06 16:49 UTC (permalink / raw)
  To: dev

https://bugs.dpdk.org/show_bug.cgi?id=78

            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 
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 == NULL) || (key == NULL)), -EINVAL);
                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,
                                                                               
hash_sig_t sig, void **data) {
                ...
                                                                /*
                                                                * Return index
where key is stored,
                                                                * subtracting
the first dummy index
                                                                */
                                                                return
bkt->key_idx[i] - 1; ```

DPDK version 18.05 release.

-- 
You are receiving this mail because:
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [dpdk-dev] [Bug 78] Mismatch between return value and documentation for `rte_hash_lookup_data` (cuckoo hashing implementation)
  2018-08-06 16:49 [dpdk-dev] [Bug 78] Mismatch between return value and documentation for `rte_hash_lookup_data` (cuckoo hashing implementation) bugzilla
@ 2018-08-07 17:34 ` bugzilla
  0 siblings, 0 replies; 2+ messages in thread
From: bugzilla @ 2018-08-07 17:34 UTC (permalink / raw)
  To: dev

https://bugs.dpdk.org/show_bug.cgi?id=78

Ajit Khaparde (ajit.khaparde@broadcom.com) changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|IN_PROGRESS                 |RESOLVED
                 CC|                            |ajit.khaparde@broadcom.com
         Resolution|---                         |FIXED

--- Comment #2 from Ajit Khaparde (ajit.khaparde@broadcom.com) ---
Thanks Pablo. Since the patch has been accepted, I am resolving this.

-- 
You are receiving this mail because:
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-08-07 17:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-06 16:49 [dpdk-dev] [Bug 78] Mismatch between return value and documentation for `rte_hash_lookup_data` (cuckoo hashing implementation) bugzilla
2018-08-07 17:34 ` bugzilla

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).