cryptodev: free memzone when releasing device
authorJunxiao Shi <git@mail1.yoursunny.com>
Fri, 28 Jun 2019 19:11:03 +0000 (13:11 -0600)
committerAkhil Goyal <akhil.goyal@nxp.com>
Fri, 5 Jul 2019 13:28:14 +0000 (15:28 +0200)
commitb482a57863da77ba42d815f30067b22be7c83fae
tree923302f3d9c067c9c585d826e36fe233f6f11ac9
parent00f846ca9c95ae3331f17799630d7ec849ef6f97
cryptodev: free memzone when releasing device

When a cryptodev is created in a primary process,
rte_cryptodev_data_alloc reserves a memzone.
However, this memzone was not released when the cryptodev
is uninitialized. After that, new cryptodev cannot be
created due to memzone name conflict.

This commit frees the memzone when a cryptodev is
uninitialized, fixing this bug. This approach is chosen
instead of keeping and reusing the old memzone, because
the new cryptodev could belong to a different NUMA socket.

Also, rte_cryptodev_data pointer is now properly recorded
in cryptodev_globals.data array.

Bugzilla ID: 105

Signed-off-by: Junxiao Shi <git@mail1.yoursunny.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
lib/librte_cryptodev/rte_cryptodev.c