examples/l2fwd-crypto: fix session mempool size
authorPablo de Lara <pablo.de.lara.guarch@intel.com>
Thu, 19 Jul 2018 08:39:58 +0000 (09:39 +0100)
committerPablo de Lara <pablo.de.lara.guarch@intel.com>
Mon, 23 Jul 2018 23:48:10 +0000 (01:48 +0200)
commit6ae3fb9df66e32e378a36f7169524861bc373a18
treeb0bba51cf694347689603dcba7124f01296cf67f
parenta6fde4f19421f14fcda2d798d49cb6ef70667c11
examples/l2fwd-crypto: fix session mempool size

The session mempool size for this application depends
on the number of crypto devices that are capable
of performing the operation given by the parameters on the app.

However, previously this calculation was done before all devices
were checked, resulting in an incorrect number of sessions
required.

Now the calculation of the devices to be used is done first
(checking the capabilities of the enabled devices),
followed by the creation of the session pool, resulting
in a correct number of objects needed for the sessions
to be created.

Fixes: e3bcb99a5e13 ("examples/l2fwd-crypto: limit number of sessions")

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
examples/l2fwd-crypto/main.c