hash: use ordered loads only if signature matches
authorHonnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Tue, 2 Jul 2019 21:16:33 +0000 (16:16 -0500)
committerThomas Monjalon <thomas@monjalon.net>
Mon, 8 Jul 2019 18:00:23 +0000 (20:00 +0200)
commit4d9ca3ed213320eaef0d8a7e95b3b00c2d70800b
tree48a99c962dadf9d7814dd918791ce90cf6accdb0
parent9c0a9024bef2fc59bef7f19ce01b5c0f3329a003
hash: use ordered loads only if signature matches

Relaxed signature comparison is done first. Further ordered loads
are done only if the signature matches. Any false positives are
caught by the full key comparison. This provides performance
benefits as load-acquire is executed only when required.

Fixes: e605a1d36 ("hash: add lock-free r/w concurrency")
Cc: stable@dpdk.org
Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Tested-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Yipeng Wang <yipeng1.wang@intel.com>
lib/librte_hash/rte_cuckoo_hash.c