From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 854171B3BC for ; Wed, 20 Mar 2019 18:52:35 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Mar 2019 10:52:34 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,249,1549958400"; d="scan'208";a="143696910" Received: from irsmsx108.ger.corp.intel.com ([163.33.3.3]) by orsmga002.jf.intel.com with ESMTP; 20 Mar 2019 10:52:33 -0700 Received: from irsmsx112.ger.corp.intel.com ([169.254.1.167]) by IRSMSX108.ger.corp.intel.com ([169.254.11.7]) with mapi id 14.03.0415.000; Wed, 20 Mar 2019 17:52:32 +0000 From: "De Lara Guarch, Pablo" To: "Zhang, Roy Fan" , "dev@dpdk.org" CC: "akhil.goyal@nxp.com" , "Trahe, Fiona" , "Luse, Paul E" Thread-Topic: [PATCH v2 1/3] crypto/aesni_mb: enable out of place processing Thread-Index: AQHUz1n7gHT59FijcE650/U2tKGeo6YU66nw Date: Wed, 20 Mar 2019 17:52:32 +0000 Message-ID: References: <20190228113619.76782-1-roy.fan.zhang@intel.com> <20190228113619.76782-2-roy.fan.zhang@intel.com> In-Reply-To: <20190228113619.76782-2-roy.fan.zhang@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMjE1Nzg4ZmEtOTkxYS00YmEwLWFhN2ItMmQwNTEwNGE3YTgwIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiblpjRktOVmNLRmZITjQ2MEVuU01cL3hyTnUrNTBBeEs3VTJqR251ZEtKb2FsM0YrQXFjenNOeFRyWUQwN1dlVTcifQ== x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-originating-ip: [163.33.239.182] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v2 1/3] crypto/aesni_mb: enable out of place processing 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, 20 Mar 2019 17:52:36 -0000 > -----Original Message----- > From: Zhang, Roy Fan > Sent: Thursday, February 28, 2019 11:36 AM > To: dev@dpdk.org > Cc: akhil.goyal@nxp.com; Zhang, Roy Fan ; De > Lara Guarch, Pablo ; Trahe, Fiona > ; Luse, Paul E > Subject: [PATCH v2 1/3] crypto/aesni_mb: enable out of place processing >=20 > Add out-of-place processing, i.e. different source and destination m_bufs= , > plus related capability update, tests and documentation. >=20 > Signed-off-by: Fiona Trahe > Signed-off-by: Paul Luse > Signed-off-by: Fan Zhang > --- > drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c | 98 > ++++++++++++++++++++++-------- > 1 file changed, 71 insertions(+), 27 deletions(-) >=20 > diff --git a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c > b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c > index 48d6ac002..9ff49b3fa 100644 > --- a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c > +++ b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c > @@ -739,6 +739,56 @@ get_session(struct aesni_mb_qp *qp, struct > rte_crypto_op *op) > return sess; > } >=20 > +static inline uint64_t > +auth_start_offset(struct rte_crypto_op *op, struct aesni_mb_session > *session, > + uint32_t oop) > +{ > + struct rte_mbuf *m_src, *m_dst; > + uint8_t *p_src, *p_dst; > + uint64_t u_src, u_dst; > + uint32_t cipher_end, auth_end; > + > + /* Only cipher then hash needs special calculation. */ > + if (!oop || session->chain_order !=3D CIPHER_HASH) > + return op->sym->auth.data.offset; > + > + m_src =3D op->sym->m_src; > + m_dst =3D op->sym->m_dst; > + > + p_src =3D rte_pktmbuf_mtod(m_src, uint8_t *); > + p_dst =3D rte_pktmbuf_mtod(m_dst, uint8_t *); > + u_src =3D (uint64_t)p_src; > + u_dst =3D (uint64_t)p_dst + op->sym->auth.data.offset; Better to use (uintptr_t) instead of uint64_t. ... > - > - memcpy(odata, rte_pktmbuf_mtod(op->sym->m_src, void*), > - rte_pktmbuf_data_len(op->sym->m_src)); > - } else { > + if (!op->sym->m_dst || op->sym->m_dst =3D=3D op->sym->m_src) { Better to add parenthesis on the second part of this "or" condition. Apart from this: Acked-by: Pablo de Lara From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 0E901A00E6 for ; Wed, 20 Mar 2019 18:52:40 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 263021B3D2; Wed, 20 Mar 2019 18:52:37 +0100 (CET) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 854171B3BC for ; Wed, 20 Mar 2019 18:52:35 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Mar 2019 10:52:34 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,249,1549958400"; d="scan'208";a="143696910" Received: from irsmsx108.ger.corp.intel.com ([163.33.3.3]) by orsmga002.jf.intel.com with ESMTP; 20 Mar 2019 10:52:33 -0700 Received: from irsmsx112.ger.corp.intel.com ([169.254.1.167]) by IRSMSX108.ger.corp.intel.com ([169.254.11.7]) with mapi id 14.03.0415.000; Wed, 20 Mar 2019 17:52:32 +0000 From: "De Lara Guarch, Pablo" To: "Zhang, Roy Fan" , "dev@dpdk.org" CC: "akhil.goyal@nxp.com" , "Trahe, Fiona" , "Luse, Paul E" Thread-Topic: [PATCH v2 1/3] crypto/aesni_mb: enable out of place processing Thread-Index: AQHUz1n7gHT59FijcE650/U2tKGeo6YU66nw Date: Wed, 20 Mar 2019 17:52:32 +0000 Message-ID: References: <20190228113619.76782-1-roy.fan.zhang@intel.com> <20190228113619.76782-2-roy.fan.zhang@intel.com> In-Reply-To: <20190228113619.76782-2-roy.fan.zhang@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMjE1Nzg4ZmEtOTkxYS00YmEwLWFhN2ItMmQwNTEwNGE3YTgwIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiblpjRktOVmNLRmZITjQ2MEVuU01cL3hyTnUrNTBBeEs3VTJqR251ZEtKb2FsM0YrQXFjenNOeFRyWUQwN1dlVTcifQ== x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-originating-ip: [163.33.239.182] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v2 1/3] crypto/aesni_mb: enable out of place processing 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Message-ID: <20190320175232.TC1QRiHOghm-Pkp5EgFi4Hn0f0dSznQRWL5p0L3YdSU@z> > -----Original Message----- > From: Zhang, Roy Fan > Sent: Thursday, February 28, 2019 11:36 AM > To: dev@dpdk.org > Cc: akhil.goyal@nxp.com; Zhang, Roy Fan ; De > Lara Guarch, Pablo ; Trahe, Fiona > ; Luse, Paul E > Subject: [PATCH v2 1/3] crypto/aesni_mb: enable out of place processing >=20 > Add out-of-place processing, i.e. different source and destination m_bufs= , > plus related capability update, tests and documentation. >=20 > Signed-off-by: Fiona Trahe > Signed-off-by: Paul Luse > Signed-off-by: Fan Zhang > --- > drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c | 98 > ++++++++++++++++++++++-------- > 1 file changed, 71 insertions(+), 27 deletions(-) >=20 > diff --git a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c > b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c > index 48d6ac002..9ff49b3fa 100644 > --- a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c > +++ b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c > @@ -739,6 +739,56 @@ get_session(struct aesni_mb_qp *qp, struct > rte_crypto_op *op) > return sess; > } >=20 > +static inline uint64_t > +auth_start_offset(struct rte_crypto_op *op, struct aesni_mb_session > *session, > + uint32_t oop) > +{ > + struct rte_mbuf *m_src, *m_dst; > + uint8_t *p_src, *p_dst; > + uint64_t u_src, u_dst; > + uint32_t cipher_end, auth_end; > + > + /* Only cipher then hash needs special calculation. */ > + if (!oop || session->chain_order !=3D CIPHER_HASH) > + return op->sym->auth.data.offset; > + > + m_src =3D op->sym->m_src; > + m_dst =3D op->sym->m_dst; > + > + p_src =3D rte_pktmbuf_mtod(m_src, uint8_t *); > + p_dst =3D rte_pktmbuf_mtod(m_dst, uint8_t *); > + u_src =3D (uint64_t)p_src; > + u_dst =3D (uint64_t)p_dst + op->sym->auth.data.offset; Better to use (uintptr_t) instead of uint64_t. ... > - > - memcpy(odata, rte_pktmbuf_mtod(op->sym->m_src, void*), > - rte_pktmbuf_data_len(op->sym->m_src)); > - } else { > + if (!op->sym->m_dst || op->sym->m_dst =3D=3D op->sym->m_src) { Better to add parenthesis on the second part of this "or" condition. Apart from this: Acked-by: Pablo de Lara