aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/dpdk/ipsec/ipsec.c
diff options
context:
space:
mode:
authorSergio Gonzalez Monroy <sgmonroy@gmail.com>2019-01-30 11:26:00 +0100
committerDamjan Marion <dmarion@me.com>2019-01-31 22:07:10 +0000
commit35467f112acb21fe1ea287c7d8794b0859f149c0 (patch)
tree2bfe25d2e880c417a144523ebfc84627666cbc8b /src/plugins/dpdk/ipsec/ipsec.c
parent6f70e913c58b81ff40bb980359cfa1f3c88ff150 (diff)
dpdk-ipsec: use single queue pair per crypto resource
Change-Id: I2c796583087c70fbc5cf09e8afd0f2a1f389d346 Signed-off-by: Sergio Gonzalez Monroy <sgmonroy@gmail.com>
Diffstat (limited to 'src/plugins/dpdk/ipsec/ipsec.c')
-rw-r--r--src/plugins/dpdk/ipsec/ipsec.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/plugins/dpdk/ipsec/ipsec.c b/src/plugins/dpdk/ipsec/ipsec.c
index dd64f6db568..520708476a8 100644
--- a/src/plugins/dpdk/ipsec/ipsec.c
+++ b/src/plugins/dpdk/ipsec/ipsec.c
@@ -19,6 +19,7 @@
#include <vlib/node_funcs.h>
#include <dpdk/device/dpdk.h>
+#include <dpdk/buffer.h>
#include <dpdk/ipsec/ipsec.h>
dpdk_crypto_main_t dpdk_crypto_main;
@@ -705,7 +706,7 @@ crypto_scan_devs (u32 n_mains)
continue;
}
- max_res_idx = (dev->max_qp / 2) - 1;
+ max_res_idx = dev->max_qp - 1;
vec_validate (dev->free_resources, max_res_idx);
@@ -714,13 +715,13 @@ crypto_scan_devs (u32 n_mains)
(crypto_resource_t) EMPTY_STRUCT,
CLIB_CACHE_LINE_BYTES);
- for (j = 0; j <= max_res_idx; j++, res_idx++)
+ for (j = 0; j <= max_res_idx; j++)
{
- vec_elt (dev->free_resources, max_res_idx - j) = res_idx;
- res = &dcm->resource[res_idx];
+ vec_elt (dev->free_resources, max_res_idx - j) = res_idx + j;
+ res = &dcm->resource[res_idx + j];
res->dev_id = i;
res->drv_id = drv_id;
- res->qp_id = j * 2;
+ res->qp_id = j;
res->numa = dev->numa;
res->thread_idx = (u16) ~ 0;
}