From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id BAB423254 for ; Tue, 5 Sep 2017 10:49:49 +0200 (CEST) Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Sep 2017 01:49:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,479,1498546800"; d="scan'208";a="147563661" Received: from irsmsx106.ger.corp.intel.com ([163.33.3.31]) by fmsmga005.fm.intel.com with ESMTP; 05 Sep 2017 01:49:48 -0700 Received: from irsmsx155.ger.corp.intel.com (163.33.192.3) by IRSMSX106.ger.corp.intel.com (163.33.3.31) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 5 Sep 2017 09:49:47 +0100 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.167]) by irsmsx155.ger.corp.intel.com ([169.254.14.70]) with mapi id 14.03.0319.002; Tue, 5 Sep 2017 09:49:47 +0100 From: "De Lara Guarch, Pablo" To: "Zhang, Roy Fan" CC: "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH 1/8] crypto/aesni_gcm: do not append digest Thread-Index: AQHTGDWZSk9xzzOZx06Nt4PL2N4l3qKkii2AgAGNBtA= Date: Tue, 5 Sep 2017 08:49:47 +0000 Message-ID: References: <20170818072103.1416-1-pablo.de.lara.guarch@intel.com> <20170818072103.1416-2-pablo.de.lara.guarch@intel.com> <9F7182E3F746AB4EA17801C148F3C60433038538@IRSMSX101.ger.corp.intel.com> In-Reply-To: <9F7182E3F746AB4EA17801C148F3C60433038538@IRSMSX101.ger.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.0.116 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 1/8] crypto/aesni_gcm: do not append digest 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: Tue, 05 Sep 2017 08:49:50 -0000 Hi Fan, > -----Original Message----- > From: Zhang, Roy Fan > Sent: Monday, September 4, 2017 11:08 AM > To: De Lara Guarch, Pablo > Cc: dev@dpdk.org; Zhang, Roy Fan > Subject: RE: [dpdk-dev] [PATCH 1/8] crypto/aesni_gcm: do not append > digest >=20 > Hi Pablo, >=20 > Thanks for the patch. It is very good idea of allocating only necessary b= uffer > for digests in the operation. > Comments inline: >=20 > > -----Original Message----- > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Pablo de Lara > > Sent: Friday, August 18, 2017 8:21 AM > > To: Doherty, Declan ; > > jerin.jacob@caviumnetworks.com > > Cc: dev@dpdk.org; De Lara Guarch, Pablo > > > > Subject: [dpdk-dev] [PATCH 1/8] crypto/aesni_gcm: do not append digest > > > > When performing an authentication verification, the PMD was using > > memory at the end of the input buffer, to store temporarily the digest. > > This operation requires the buffer to have enough tailroom unnecessaril= y. > > Instead, memory is allocated for each queue pair, to store temporarily > > the digest generated by the driver, so it can be compared with the one > > provided in the crypto operation, without needing to touch the input > buffer. > > > > Signed-off-by: Pablo de Lara > > --- > > drivers/crypto/aesni_gcm/aesni_gcm_pmd.c | 31 +++++-----------= ----- > --- > > drivers/crypto/aesni_gcm/aesni_gcm_pmd_private.h | 7 ++++++ > > 2 files changed, 13 insertions(+), 25 deletions(-) > > > > diff --git a/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c > > b/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c > > index d9c91d0..ae670a7 100644 > > --- a/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c > > +++ b/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c > > @@ -298,14 +298,7 @@ process_gcm_crypto_op(struct aesni_gcm_qp > *qp, > > struct rte_crypto_op *op, > > sym_op->aead.digest.data, > > (uint64_t)session->digest_length); > > } else if (session->op =3D=3D > > AESNI_GCM_OP_AUTHENTICATED_DECRYPTION) { > > - uint8_t *auth_tag =3D (uint8_t > > *)rte_pktmbuf_append(sym_op->m_dst ? > > - sym_op->m_dst : sym_op->m_src, > > - session->digest_length); > > - > > - if (!auth_tag) { > > - GCM_LOG_ERR("auth_tag"); > > - return -1; > > - } >=20 > qp->tmp_digest has already the data type of uint8_t*, the casting is not > necessary here. Although the "&" here seems to be wrong. auth_tag didn't > point to qp->tmp_digest but a buffer with the address as &qp->tmp_digest. Thanks for spotting this! Will send a v2 soon. Pablo