crypto: fixed async frame enqueue race condition 47/30247/2
authorPiotrX Kleski <piotrx.kleski@intel.com>
Tue, 24 Nov 2020 08:26:26 +0000 (08:26 +0000)
committerDamjan Marion <dmarion@me.com>
Fri, 4 Dec 2020 22:52:16 +0000 (22:52 +0000)
commitef69b5103438ec099cf080b54a88a5333b1c055b
treee73b6cc9af90b469627b1552a967fae8c8367e57
parent270f5235c04250ee3aafc78bce75f506e9847834
crypto: fixed async frame enqueue race condition

Type: fix

To avoid race condition happening in async crypto engines,
async frame state and thread index set should happen before enqueue.
In addition as the enqueue handler already returns the enqueue status,
when an enqueue is failed, the async crypto engine shall not worry
about setting the async frame state but let the submit_open_frame function
to do just that.

Signed-off-by: PiotrX Kleski <piotrx.kleski@intel.com>
Reviewed-by: Fan Zhang <roy.fan.zhang@intel.com>
Change-Id: Ic1b0c94478b3cfd5fab98657218bbd70c46a220a
src/plugins/crypto_sw_scheduler/main.c
src/plugins/dpdk/cryptodev/cryptodev.c
src/vnet/crypto/crypto.h