Skip to content

Commit

Permalink
app/crypto-perf: fix socket ID default value
Browse files Browse the repository at this point in the history
Due to recent changes to the default device socket ID,
before being used as an index for session mempool list,
the socket ID should be set to 0 if unknown (-1).

Fixes: 7dcd73e ("drivers/bus: set device NUMA node to unknown by default")
Cc: olivier.matz@6wind.com
Cc: stable@dpdk.org

Signed-off-by: Ciara Power <ciara.power@intel.com>
Signed-off-by: 0-day Robot <robot@bytheb.org>
  • Loading branch information
ciarapow authored and ovsrobot committed Jul 5, 2023
1 parent a64a456 commit 2dcf939
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/test-crypto-perf/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,11 @@ main(int argc, char **argv)
cdev_id = enabled_cdevs[cdev_index];

uint8_t socket_id = rte_cryptodev_socket_id(cdev_id);
/* range check the socket_id, negative values become big
* positive ones due to use of unsigned value
*/
if (socket_id >= RTE_MAX_NUMA_NODES)
socket_id = 0;

ctx[i] = cperf_testmap[opts.test].constructor(
session_pool_socket[socket_id].sess_mp,
Expand Down

0 comments on commit 2dcf939

Please sign in to comment.