> -----Original Message----- > From: Ravi Kumar [mailto:ravi1.ku...@amd.com] > Sent: Thursday, May 3, 2018 6:57 AM > To: dev@dpdk.org > Cc: De Lara Guarch, Pablo <pablo.de.lara.gua...@intel.com>; > tho...@monjalon.net; hemant.agra...@nxp.com > Subject: [PATCH 2/2] crypto/ccp: change to command line option from compile > time > > CCP PMD supports authentication offload to either of CCP or CPU. The earlier > version of patch provided this option as compile time. This patch changes this > option from compile time to run time. User can pass "ccp_auth_opt=1" as an > additional argument to vdev parameter to enable authentication operations on > CPU. > > Signed-off-by: Ravi Kumar <ravi1.ku...@amd.com>
... > +++ b/drivers/crypto/ccp/ccp_pmd_ops.c > @@ -13,7 +13,6 @@ > #include "ccp_crypto.h" > > static const struct rte_cryptodev_capabilities ccp_pmd_capabilities[] = { > -#ifdef > RTE_LIBRTE_PMD_CCP_CPU_AUTH > { /* MD5 HMAC */ > .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC, > {.sym = { > @@ -35,7 +34,6 @@ static const struct rte_cryptodev_capabilities > ccp_pmd_capabilities[] = { > }, } > }, } > }, > -#endif MD5 won't be supported unless the auth_opt is enabled. I would suggest doing something similar to what QAT does. You can have an array with the base capabilities and another one for the extended ones (with MD5). When "auth_opt" is enabled, you can have the combination of both. When it is not, then you can just have the base capabilities. > { /* SHA1 */ > .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC, > {.sym = { ... > RTE_LOG(INFO, PMD, "Initialising %s on NUMA node %d\n", name, > - init_params.socket_id); > + init_params.def_p.socket_id); > RTE_LOG(INFO, PMD, "Max number of queue pairs = %d\n", > - init_params.max_nb_queue_pairs); > + init_params.def_p.max_nb_queue_pairs); > RTE_LOG(INFO, PMD, "Max number of sessions = %d\n", > - init_params.max_nb_sessions); > + init_params.def_p.max_nb_sessions); > + RTE_LOG(INFO, PMD, "Authentication offload to %s\n", > + ((init_params.auth_opt == 0) ? "CCP" : "CPU")); > + snprintf(die_num, 20, "die_num-%d", init_params.die_num); > + RTE_LOG(INFO, PMD, "Combining %s CCP devices\n", > + ((init_params.die_num == -1) ? "all" : die_num)); > > rc = cryptodev_ccp_create(name, vdev, &init_params); > if (rc) > -- > 2.7.4 You are adding new parameters, so you should extend the parameters registration at the bottom of this file: RTE_PMD_REGISTER_PARAM_STRING(CRYPTODEV_NAME_CCP_PMD, "max_nb_queue_pairs=<int> max_nb_sessions=<int> socket_id=<int>");