From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qk0-f170.google.com (mail-qk0-f170.google.com [209.85.220.170]) by dpdk.org (Postfix) with ESMTP id 0577B316B for ; Fri, 9 Dec 2016 12:00:54 +0100 (CET) Received: by mail-qk0-f170.google.com with SMTP id n204so13620631qke.2 for ; Fri, 09 Dec 2016 03:00:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:cc; bh=RcD1tH930vCOi11dRGiXHd0lqS/6CBDkKaAw4D5Xkz8=; b=0dOrnvQteG5k1XdtGdFjtxy84gI4r9tA3Sc3+0Gm02YV9XeJ0TaBeHAXyt5/pJr8dQ G4ifftBusS8DAPIboIIC5BQ1JUSGkfzH66pocX6stbmJUjD2H8i3vQ1znPawRO0P6JfF ZaRvlwZq2d9sQh3w0VOILmziJukCrI5Z3CbJXyW9fISHrl3MmVSlyPrhDlv7D+EEwmA1 9mRm9ehlfhPTG/M7pTzJq8CkvF1ZvDW+gGUn+6Vb6UlVRyEgWV3r3xqBzQspSLdRe39F kh7NViBZEO/ZVVVdvOy1Bn4Zd81YiZpNyzfo80rt6rI7l/PSFVSYoWiJHbJNJhoGX2km OdZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=RcD1tH930vCOi11dRGiXHd0lqS/6CBDkKaAw4D5Xkz8=; b=IF2RJ8UEXOjQKmhEQvVjYaTRytjlhlS2sEKoSAKqD/T6RG2Uv9tA1V+UbJ2Gb0tYsm JIU6dTbvUFl70xdlDtgt7gdYJlBDg/aDk6PxFBvcealKWPgyYi/k6K8nZD4bQIs7WdZa ilMGqugcmtP63RvZAckREC7CcQLnaj+fbTcO+CkP8wF0Ci6q+roBsVIP2Yd9gQktX09y wPxS6nKCOiSFoDiG+D6xToMOjHfXNEeHUYlmHl53Byi9ZuQIvYM4uvQTLvwfBtD0z/MO CUjgTnlOXa1+8yRElgzF6/QQiTzSNpVvBs4eiFP+oLj8paS0rM57PD5UFwsKRBTlHBxE QX9w== X-Gm-Message-State: AKaTC03Wfm/bppEbsGDtEg0ttxVAkNCc1bg8mICQm9TmDD50tAEEbMWq6bQNsCfhdgimrC9lFuOsZUXQbQ18/g== X-Received: by 10.55.42.197 with SMTP id q66mr68517742qkq.198.1481281254448; Fri, 09 Dec 2016 03:00:54 -0800 (PST) MIME-Version: 1.0 Received: by 10.140.29.137 with HTTP; Fri, 9 Dec 2016 03:00:53 -0800 (PST) From: Nubin Stanley Date: Fri, 9 Dec 2016 16:30:53 +0530 Message-ID: To: "Trahe, Fiona" , users@dpdk.org Cc: martin.varghese@nokia.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-users] AES GCM PMD Driver IV length support X-BeenThere: users@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK usage discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Dec 2016 11:00:55 -0000 Hi Fiona Thank you for the info. And, I am adding the mailing list again. Sorry, I missed earlier. Regards Nubin Stanley On Fri, Dec 9, 2016 at 3:41 PM, Trahe, Fiona wrote: > I=E2=80=99m looking at version 16.11 > > I think that code accepting 16 bytes padded and the 15th byte set may be > removed in next release so only 12 bytes iv will be accepted. > > So keep an eye out for that patch as you=E2=80=99ll have to revert back. > > Btw- it=E2=80=99s better to keep these mails on the forum, with inline an= swers, > cause others may have the same problem and benefit from this J > > > > *From:* Nubin Stanley [mailto:nubinstanley@gmail.com] > *Sent:* Friday, December 9, 2016 8:22 AM > *To:* Trahe, Fiona > *Subject:* Re: [dpdk-users] AES GCM PMD Driver IV length support > > > > Hi Fiona > > Thanks for the quick response. > > It seems the DPDK version I am using is different (16.07). > > > > The sanity code in the PMD code does not accept an IV len of 12. > > > > if (op->cipher.iv.length !=3D 16 && op->cipher.iv.length !=3D 0) { > > GCM_LOG_ERR("iv"); > > return -1; > > } > > > > Anyways, I have circumvented the problem by padding the IV data in my > application and it works. > > > > * iv_pad_len =3D RTE_ALIGN_CEIL(entry->iv.length, 16);* > > * op->sym->cipher.iv.data =3D rte_malloc("iv", iv_pad_len, 0);* > > * memcpy(op->sym->cipher.iv.data, entry->iv.data, entry->iv.length);* > > * op->sym->cipher.iv.phys_addr =3D > rte_malloc_virt2phy(op->sym->cipher.iv.data);* > > * op->sym->cipher.iv.length =3D iv_pad_len;* > > * op->sym->cipher.iv.data[15] =3D 1;* > > > > Could you please let me know the version of DPDK you are using. > > Thanks again for the support. > > > > Regards > > Nubin Stanley > > > > On Thu, Dec 8, 2016 at 4:26 PM, Trahe, Fiona > wrote: > > Hi Nubin, > > > > -----Original Message----- > > From: users [mailto:users-bounces@dpdk.org] On Behalf Of Nubin Stanley > > Sent: Thursday, December 8, 2016 9:21 AM > > To: users@dpdk.org > > Cc: martin.varghese@nokia.com > > Subject: [dpdk-users] AES GCM PMD Driver IV length support > > > > Hi All > > > > > > > > I see that the only IV size supported in AES GCM driver is 16bytes. For > > using AES-GCM-128 in IPsec, the IV length has to be 12 bytes ( 4 > (salt) > > + 8 (iv)). > > > > > > How should I handle this IPsec case with AES GCM PMD driver. > > > > > > > > .op =3D RTE_CRYPTO_OP_TYPE_SYMMETRIC, > > > > {.sym =3D { > > > > .xform_type =3D RTE_CRYPTO_SYM_XFORM_CIPHER, > > > > {.cipher =3D { > > > > .algo =3D RTE_CRYPTO_CIPHER_AES_GCM, > > > > .block_size =3D 16, > > > > .key_size =3D { > > > > .min =3D 16, > > > > .max =3D 16, > > > > .increment =3D 0 > > > > }, > > > > .iv_size =3D { > > > > .min =3D 16, > > > > .max =3D 16, > > > > .increment =3D 0 > > > > } > > > > }, } > > > > }, } > > > > > > > > Regards, > > Nubin Stanley > > I found the following code in the PMD to handle an iv length of 12, so > this looks like a bug in the capability data. > /* sanity checks */ > if (op->cipher.iv.length !=3D 16 && op->cipher.iv.length !=3D 12 = && > op->cipher.iv.length !=3D 0) { > GCM_LOG_ERR("iv"); > return -1; > } > > /* > * GCM working in 12B IV mode =3D> 16B pre-counter block we need > * to set BE LSB to 1, driver expects that 16B is allocated > */ > if (op->cipher.iv.length =3D=3D 12) { > op->cipher.iv.data[15] =3D 1; > } > > Have you tried passing a 12-byte iv to the driver ? > > > > > > -- > > Nubin Stanley > Electronics and Biomedical Engineering > Batch of 2009 > Model Engineering College, Kochi > Phone : +918147742665 <081477%2042665> > Email : nubinstanley@gmail.com > --=20 Nubin Stanley Electronics and Biomedical Engineering Batch of 2009 Model Engineering College, Kochi Phone : +918147742665 Email : nubinstanley@gmail.com