diff options
author | Janne Peltonen <janne.peltonen@nokia.com> | 2020-09-24 16:11:42 +0300 |
---|---|---|
committer | Matias Elo <matias.elo@nokia.com> | 2020-10-01 10:54:48 +0300 |
commit | 79244082fb6b524944f1faf2def23edd26828d84 (patch) | |
tree | 97480f3592b24efedcafdd1a56e1b891738e2170 /platform/linux-dpdk/odp_crypto.c | |
parent | b659ac7dfc219626e6d58f62119bfbf1ead1c15f (diff) |
linux-dpdk: crypto: fix tracking of the number of queue pairs
When recording the number of configured queue pairs for each crypto device
in global init, the code indexes enabled_crypto_dev_qpairs[] by an
internal loop counter instead of device id. Later, when selecting the
queue for crypto operation enqueueing, the code indexes the table using
device id. As a result, under certain circumstances the code attempts
to use an uninitialized queue pair and crashes.
Fix the problem by always indexing the table using the device id.
Signed-off-by: Janne Peltonen <janne.peltonen@nokia.com>
Reviewed-by: Matias Elo <matias.elo@nokia.com>
Diffstat (limited to 'platform/linux-dpdk/odp_crypto.c')
-rw-r--r-- | platform/linux-dpdk/odp_crypto.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/platform/linux-dpdk/odp_crypto.c b/platform/linux-dpdk/odp_crypto.c index e0cb28622..a700a7e15 100644 --- a/platform/linux-dpdk/odp_crypto.c +++ b/platform/linux-dpdk/odp_crypto.c @@ -451,8 +451,7 @@ int _odp_crypto_init_global(void) global->enabled_crypto_dev_ids[global->enabled_crypto_devs] = cdev_id; - global->enabled_crypto_dev_qpairs[global->enabled_crypto_devs] = - nb_queue_pairs; + global->enabled_crypto_dev_qpairs[cdev_id] = nb_queue_pairs; global->enabled_crypto_devs++; } |