From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 683975901 for ; Mon, 22 Feb 2016 19:56:49 +0100 (CET) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga102.jf.intel.com with ESMTP; 22 Feb 2016 10:56:26 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,485,1449561600"; d="scan'208";a="908795968" Received: from irsmsx106.ger.corp.intel.com ([163.33.3.31]) by fmsmga001.fm.intel.com with ESMTP; 22 Feb 2016 10:56:26 -0800 Received: from irsmsx101.ger.corp.intel.com ([169.254.1.113]) by IRSMSX106.ger.corp.intel.com ([169.254.8.197]) with mapi id 14.03.0248.002; Mon, 22 Feb 2016 18:56:25 +0000 From: "Trahe, Fiona" To: "Doherty, Declan" , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v2 2/2] cryptodev: change burst API to be crypto op oriented Thread-Index: AQHRawVpIpCpTkLZR0OC4mP5hHX+ZZ84bAiA Date: Mon, 22 Feb 2016 18:56:24 +0000 Message-ID: <348A99DA5F5B7549AA880327E580B43588F711CA@IRSMSX101.ger.corp.intel.com> References: <1454159235-5175-1-git-send-email-declan.doherty@intel.com> <1455879670-31446-1-git-send-email-declan.doherty@intel.com> <1455879670-31446-3-git-send-email-declan.doherty@intel.com> In-Reply-To: <1455879670-31446-3-git-send-email-declan.doherty@intel.com> Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYzU2NzU1NGMtNzc4Ny00MTUzLWFkMTgtZWMxNzE2ZGE4NTE5IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6ImZGbmd6aTZSa1RUOTVWUUQ5d3dMUW9sdG9JbnlLSkdBYzZ5dEFjMVdKSVE9In0= x-ctpclassification: CTP_IC x-originating-ip: [163.33.239.181] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v2 2/2] cryptodev: change burst API to be crypto op oriented X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Feb 2016 18:56:49 -0000 Hi Declan, Bug + fix below > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Declan Doherty > Sent: Friday, February 19, 2016 11:01 AM > To: dev@dpdk.org > Subject: [dpdk-dev] [PATCH v2 2/2] cryptodev: change burst API to be cryp= to op > oriented >=20 > This patch modifies the crypto burst enqueue/dequeue APIs to operate on b= ursts > rte_crypto_op's rather than the current implementation which operates on > rte_mbuf bursts, this simplifies the burst processing in the crypto PMDs = and the > use of crypto operations in general. >=20 > This change set also continues the separation of the symmetric operation > parameters > from the more general operation parameters, this will simplify the integr= ation of > asymmetric crypto operations in the future. >=20 > As well as the changes to the crypto APIs this patch adds functions for m= anaging > rte_crypto_op pools to the cryptodev API. It modifies the existing PMDs, = unit > tests and sample application to work with the modified APIs. >=20 > Finally this change set removes the now unused rte_mbuf_offload library. > >Signed-off-by: Declan Doherty diff --git a/lib/librte_cryptodev/rte_crypto.h b/lib/librte_cryptodev/rte_c= rypto.h //snip + * Returns a pointer to the private data of a crypto operation if + * that operation has enough capacity for requested size. + * + * @param op crypto operation. + * @param size size of space requested in private data. + * + * @returns + * - if sufficient space available returns pointer to start of private dat= a + * - if insufficient space returns NULL + */ +static inline void * +__rte_crypto_op_get_priv_data(struct rte_crypto_op *op, uint32_t size) +{ + uint32_t priv_size; + + if (likely(op->mempool !=3D NULL)) { + priv_size =3D __rte_crypto_op_get_priv_data_size(op->mempool); + + if (likely(priv_size >=3D size)) + return (void *)((op + 1) + + sizeof(struct rte_crypto_sym_op)); Jumping by rte_crypto_op increments, should be byte increments, i.e. return (void *)((uint8_t *)(op + 1) + sizeof(struct rte_crypto_sym_op)); + } + + return NULL; +}