From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id A45BB8E5F for ; Wed, 9 May 2018 10:34:57 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 May 2018 01:34:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,381,1520924400"; d="scan'208";a="57155474" Received: from irsmsx107.ger.corp.intel.com ([163.33.3.99]) by orsmga002.jf.intel.com with ESMTP; 09 May 2018 01:34:53 -0700 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.150]) by IRSMSX107.ger.corp.intel.com ([169.254.10.141]) with mapi id 14.03.0319.002; Wed, 9 May 2018 09:34:53 +0100 From: "De Lara Guarch, Pablo" To: Ravi Kumar , "dev@dpdk.org" CC: "thomas@monjalon.net" , "hemant.agrawal@nxp.com" Thread-Topic: [PATCH 2/2] crypto/ccp: change to command line option from compile time Thread-Index: AQHT4qOvnCR9LdiV/UuayVFWE7i/xKQnGcAg Date: Wed, 9 May 2018 08:34:52 +0000 Message-ID: References: <1525327041-128382-1-git-send-email-Ravi1.kumar@amd.com> <1525327041-128382-2-git-send-email-Ravi1.kumar@amd.com> In-Reply-To: <1525327041-128382-2-git-send-email-Ravi1.kumar@amd.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNGFkZTgxZTUtYjRjMi00MjIwLWFiZDYtZmU1ODNiMzczOGY3IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6IkVMSjA0Nko5c05mQ2MxWm1XN1lLY1wvUG02VUxZdGtrUTZrZGc0Uk92bmRJPSJ9 x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.200.100 dlp-reaction: no-action x-originating-ip: [163.33.239.180] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH 2/2] crypto/ccp: change to command line option from compile time X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 May 2018 08:34:58 -0000 > -----Original Message----- > From: Ravi Kumar [mailto:Ravi1.kumar@amd.com] > Sent: Thursday, May 3, 2018 6:57 AM > To: dev@dpdk.org > Cc: De Lara Guarch, Pablo ; > thomas@monjalon.net; hemant.agrawal@nxp.com > Subject: [PATCH 2/2] crypto/ccp: change to command line option from compi= le > time >=20 > CCP PMD supports authentication offload to either of CCP or CPU. The earl= ier > 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=3D1" as= an > additional argument to vdev parameter to enable authentication operations= on > CPU. >=20 > Signed-off-by: Ravi Kumar ... > +++ b/drivers/crypto/ccp/ccp_pmd_ops.c > @@ -13,7 +13,6 @@ > #include "ccp_crypto.h" >=20 > static const struct rte_cryptodev_capabilities ccp_pmd_capabilities[] = =3D { -#ifdef > RTE_LIBRTE_PMD_CCP_CPU_AUTH > { /* MD5 HMAC */ > .op =3D RTE_CRYPTO_OP_TYPE_SYMMETRIC, > {.sym =3D { > @@ -35,7 +34,6 @@ static const struct rte_cryptodev_capabilities > ccp_pmd_capabilities[] =3D { > }, } > }, } > }, > -#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 =3D RTE_CRYPTO_OP_TYPE_SYMMETRIC, > {.sym =3D { ... > 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 =3D %d\n", > - init_params.max_nb_queue_pairs); > + init_params.def_p.max_nb_queue_pairs); > RTE_LOG(INFO, PMD, "Max number of sessions =3D %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 =3D=3D 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 =3D=3D -1) ? "all" : die_num)); >=20 > rc =3D cryptodev_ccp_create(name, vdev, &init_params); > if (rc) > -- > 2.7.4 You are adding new parameters, so you should extend the parameters registra= tion at the bottom of this file: RTE_PMD_REGISTER_PARAM_STRING(CRYPTODEV_NAME_CCP_PMD, "max_nb_queue_pairs=3D max_nb_sessions=3D socket_id=3D");