summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorAnoob Joseph <anoobj@marvell.com>2019-06-25 11:09:24 +0530
committerAkhil Goyal <akhil.goyal@nxp.com>2019-07-05 15:03:25 +0200
commitc9030ae382eb942485dfa4e7657b4953bc77b2a9 (patch)
tree55fe831f384c679c6fb8ae6321a77b5eeb321145 /examples
parent5f2ea5533a9371f93df64f065dba72107d2f6a5f (diff)
downloaddpdk-c9030ae382eb942485dfa4e7657b4953bc77b2a9.zip
dpdk-c9030ae382eb942485dfa4e7657b4953bc77b2a9.tar.gz
dpdk-c9030ae382eb942485dfa4e7657b4953bc77b2a9.tar.xz
cryptodev: add feature flags to disable
Adding a new field, ff_disable, to allow applications to control the features enabled on the crypto device. This would allow for efficient usage of HW/SW offloads. Signed-off-by: Anoob Joseph <anoobj@marvell.com> Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/fips_validation/fips_dev_self_test.c6
-rw-r--r--examples/fips_validation/main.c2
-rw-r--r--examples/ip_pipeline/cryptodev.c1
-rw-r--r--examples/ipsec-secgw/ipsec-secgw.c1
-rw-r--r--examples/l2fwd-crypto/main.c1
-rw-r--r--examples/vhost_crypto/main.c1
6 files changed, 10 insertions, 2 deletions
diff --git a/examples/fips_validation/fips_dev_self_test.c b/examples/fips_validation/fips_dev_self_test.c
index 444bbaa..17e8597 100644
--- a/examples/fips_validation/fips_dev_self_test.c
+++ b/examples/fips_validation/fips_dev_self_test.c
@@ -1557,12 +1557,16 @@ fips_dev_auto_test_uninit(uint8_t dev_id,
static int
fips_dev_auto_test_init(uint8_t dev_id, struct fips_dev_auto_test_env *env)
{
- struct rte_cryptodev_config conf = {rte_cryptodev_socket_id(dev_id), 1};
struct rte_cryptodev_qp_conf qp_conf = {128, NULL, NULL};
uint32_t sess_sz = rte_cryptodev_sym_get_private_session_size(dev_id);
+ struct rte_cryptodev_config conf;
char name[128];
int ret;
+ conf.socket_id = rte_cryptodev_socket_id(dev_id);
+ conf.nb_queue_pairs = 1;
+ conf.ff_disable = 0;
+
ret = rte_cryptodev_configure(dev_id, &conf);
if (ret < 0)
return ret;
diff --git a/examples/fips_validation/main.c b/examples/fips_validation/main.c
index aef4505..8135340 100644
--- a/examples/fips_validation/main.c
+++ b/examples/fips_validation/main.c
@@ -48,7 +48,7 @@ struct cryptodev_fips_validate_env {
static int
cryptodev_fips_validate_app_int(void)
{
- struct rte_cryptodev_config conf = {rte_socket_id(), 1};
+ struct rte_cryptodev_config conf = {rte_socket_id(), 1, 0};
struct rte_cryptodev_qp_conf qp_conf = {128, NULL, NULL};
uint32_t sess_sz = rte_cryptodev_sym_get_private_session_size(
env.dev_id);
diff --git a/examples/ip_pipeline/cryptodev.c b/examples/ip_pipeline/cryptodev.c
index ac1e38d..ab5e926 100644
--- a/examples/ip_pipeline/cryptodev.c
+++ b/examples/ip_pipeline/cryptodev.c
@@ -95,6 +95,7 @@ cryptodev_create(const char *name, struct cryptodev_params *params)
dev_conf.socket_id = socket_id;
dev_conf.nb_queue_pairs = params->n_queues;
+ dev_conf.ff_disable = 0;
status = rte_cryptodev_configure(dev_id, &dev_conf);
if (status < 0)
diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec-secgw/ipsec-secgw.c
index 6c626fa..931e5ea 100644
--- a/examples/ipsec-secgw/ipsec-secgw.c
+++ b/examples/ipsec-secgw/ipsec-secgw.c
@@ -1720,6 +1720,7 @@ cryptodevs_init(void)
dev_conf.socket_id = rte_cryptodev_socket_id(cdev_id);
dev_conf.nb_queue_pairs = qp;
+ dev_conf.ff_disable = RTE_CRYPTODEV_FF_ASYMMETRIC_CRYPTO;
uint32_t dev_max_sess = cdev_info.sym.max_nb_sessions;
if (dev_max_sess != 0 && dev_max_sess < CDEV_MP_NB_OBJS)
diff --git a/examples/l2fwd-crypto/main.c b/examples/l2fwd-crypto/main.c
index e282cb7..b2f2011 100644
--- a/examples/l2fwd-crypto/main.c
+++ b/examples/l2fwd-crypto/main.c
@@ -2256,6 +2256,7 @@ initialize_cryptodevs(struct l2fwd_crypto_options *options, unsigned nb_ports,
struct rte_cryptodev_config conf = {
.nb_queue_pairs = 1,
.socket_id = socket_id,
+ .ff_disable = RTE_CRYPTODEV_FF_SECURITY,
};
rte_cryptodev_info_get(cdev_id, &dev_info);
diff --git a/examples/vhost_crypto/main.c b/examples/vhost_crypto/main.c
index cfb9dfd..1d7ba94 100644
--- a/examples/vhost_crypto/main.c
+++ b/examples/vhost_crypto/main.c
@@ -516,6 +516,7 @@ main(int argc, char *argv[])
config.nb_queue_pairs = dev_info.max_nb_queue_pairs;
config.socket_id = rte_lcore_to_socket_id(lo->lcore_id);
+ config.ff_disable = RTE_CRYPTODEV_FF_SECURITY;
ret = rte_cryptodev_configure(info->cid, &config);
if (ret < 0) {