hash: fix tuple adjustment
authorVladimir Medvedkin <vladimir.medvedkin@intel.com>
Thu, 6 May 2021 11:40:22 +0000 (12:40 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Mon, 10 May 2021 13:31:42 +0000 (15:31 +0200)
commitbe81f77d807720f01e72e38502c2ca613b36b726
tree06a0b4345684b6301582f64437aea00ec5aef661
parentb81bf1efe3ff7bf6bedf4dcce1e3fb90ac9c8d3c
hash: fix tuple adjustment

rte_thash_adjust_tuple() uses random to generate a new subtuple if
fn() callback reports about collision. In some cases random changes
the subtuple in a way that after complementary bits are applied the
original tuple is obtained. This patch replaces random with subtuple
increment.

Fixes: 28ebff11c2dc ("hash: add predictable RSS")
Cc: vladimir.medvedkin@intel.com
Reported-by: David Marchand <david.marchand@redhat.com>
Signed-off-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
Acked-by: Yipeng Wang <yipeng1.wang@intel.com>
Tested-by: Stanislaw Kardach <kda@semihalf.com>
Reviewed-by: Stanislaw Kardach <kda@semihalf.com>
lib/hash/rte_thash.c