summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorFan Zhang <roy.fan.zhang@intel.com>2019-01-10 14:50:11 +0000
committerPablo de Lara <pablo.de.lara.guarch@intel.com>2019-01-10 16:57:22 +0100
commit725d2a7fbf717d9a6189ac9b49bad2b4f5391a60 (patch)
tree8cbcd118956e2125190f4366c087d4317dce0df1 /examples
parent11fdbf1b78660e058a059b02504065935b9ff730 (diff)
downloaddpdk-next-eventdev-725d2a7fbf717d9a6189ac9b49bad2b4f5391a60.zip
dpdk-next-eventdev-725d2a7fbf717d9a6189ac9b49bad2b4f5391a60.tar.gz
dpdk-next-eventdev-725d2a7fbf717d9a6189ac9b49bad2b4f5391a60.tar.xz
cryptodev: change queue pair configure structure
This patch changes the cryptodev queue pair configure structure to enable two mempool passed into cryptodev PMD simutaneously. Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com> Acked-by: Fiona Trahe <fiona.trahe@intel.com> Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com> Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/fips_validation/main.c4
-rw-r--r--examples/ip_pipeline/cryptodev.c2
-rw-r--r--examples/ipsec-secgw/ipsec-secgw.c7
-rw-r--r--examples/l2fwd-crypto/main.c4
-rw-r--r--examples/vhost_crypto/main.c9
5 files changed, 17 insertions, 9 deletions
diff --git a/examples/fips_validation/main.c b/examples/fips_validation/main.c
index e7559c6..384b7a2 100644
--- a/examples/fips_validation/main.c
+++ b/examples/fips_validation/main.c
@@ -39,7 +39,7 @@ static int
cryptodev_fips_validate_app_int(void)
{
struct rte_cryptodev_config conf = {rte_socket_id(), 1};
- struct rte_cryptodev_qp_conf qp_conf = {128};
+ struct rte_cryptodev_qp_conf qp_conf = {128, NULL, NULL};
int ret;
ret = rte_cryptodev_configure(env.dev_id, &conf);
@@ -52,7 +52,7 @@ cryptodev_fips_validate_app_int(void)
return ret;
ret = rte_cryptodev_queue_pair_setup(env.dev_id, 0, &qp_conf,
- rte_socket_id(), env.mpool);
+ rte_socket_id());
if (ret < 0)
return ret;
diff --git a/examples/ip_pipeline/cryptodev.c b/examples/ip_pipeline/cryptodev.c
index c4ba72b..b365810 100644
--- a/examples/ip_pipeline/cryptodev.c
+++ b/examples/ip_pipeline/cryptodev.c
@@ -93,7 +93,7 @@ cryptodev_create(const char *name, struct cryptodev_params *params)
queue_conf.nb_descriptors = params->queue_size;
for (i = 0; i < params->n_queues; i++) {
status = rte_cryptodev_queue_pair_setup(dev_id, i,
- &queue_conf, socket_id, NULL);
+ &queue_conf, socket_id);
if (status < 0)
return NULL;
}
diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec-secgw/ipsec-secgw.c
index 1bc0b5b..a0ff8f7 100644
--- a/examples/ipsec-secgw/ipsec-secgw.c
+++ b/examples/ipsec-secgw/ipsec-secgw.c
@@ -1493,10 +1493,13 @@ cryptodevs_init(void)
cdev_id);
qp_conf.nb_descriptors = CDEV_QUEUE_DESC;
+ qp_conf.mp_session =
+ socket_ctx[dev_conf.socket_id].session_pool;
+ qp_conf.mp_session_private =
+ socket_ctx[dev_conf.socket_id].session_pool;
for (qp = 0; qp < dev_conf.nb_queue_pairs; qp++)
if (rte_cryptodev_queue_pair_setup(cdev_id, qp,
- &qp_conf, dev_conf.socket_id,
- socket_ctx[dev_conf.socket_id].session_pool))
+ &qp_conf, dev_conf.socket_id))
rte_panic("Failed to setup queue %u for "
"cdev_id %u\n", 0, cdev_id);
diff --git a/examples/l2fwd-crypto/main.c b/examples/l2fwd-crypto/main.c
index f12fd26..1df7ba7 100644
--- a/examples/l2fwd-crypto/main.c
+++ b/examples/l2fwd-crypto/main.c
@@ -2443,9 +2443,11 @@ initialize_cryptodevs(struct l2fwd_crypto_options *options, unsigned nb_ports,
}
qp_conf.nb_descriptors = 2048;
+ qp_conf.mp_session = session_pool_socket[socket_id];
+ qp_conf.mp_session_private = session_pool_socket[socket_id];
retval = rte_cryptodev_queue_pair_setup(cdev_id, 0, &qp_conf,
- socket_id, session_pool_socket[socket_id]);
+ socket_id);
if (retval < 0) {
printf("Failed to setup queue pair %u on cryptodev %u",
0, cdev_id);
diff --git a/examples/vhost_crypto/main.c b/examples/vhost_crypto/main.c
index 3deb526..cb30f84 100644
--- a/examples/vhost_crypto/main.c
+++ b/examples/vhost_crypto/main.c
@@ -463,7 +463,7 @@ free_resource(void)
int
main(int argc, char *argv[])
{
- struct rte_cryptodev_qp_conf qp_conf = {NB_CRYPTO_DESCRIPTORS};
+ struct rte_cryptodev_qp_conf qp_conf;
struct rte_cryptodev_config config;
struct rte_cryptodev_info dev_info;
char name[128];
@@ -551,11 +551,14 @@ main(int argc, char *argv[])
options.infos[i] = info;
+ qp_conf.nb_descriptors = NB_CRYPTO_DESCRIPTORS;
+ qp_conf.mp_session = info->sess_pool;
+ qp_conf.mp_session_private = info->sess_pool;
+
for (j = 0; j < dev_info.max_nb_queue_pairs; j++) {
ret = rte_cryptodev_queue_pair_setup(info->cid, j,
&qp_conf, rte_lcore_to_socket_id(
- lo->lcore_id),
- info->sess_pool);
+ lo->lcore_id));
if (ret < 0) {
RTE_LOG(ERR, USER1, "Failed to configure qp\n");
goto error_exit;