[dpdk-dev] [PATCH v2] crypto/virtio: fix iv physical address

De Lara Guarch, Pablo pablo.de.lara.guarch at intel.com
Thu Jul 5 12:53:51 CEST 2018


Hi Jianjay,


> -----Original Message-----
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Zhoujian (jay)
> Sent: Tuesday, July 3, 2018 1:29 PM
> To: Zhang, Roy Fan <roy.fan.zhang at intel.com>; dev at dpdk.org
> Cc: De Lara Guarch, Pablo <pablo.de.lara.guarch at intel.com>; stable at dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v2] crypto/virtio: fix iv physical address
> 
> > -----Original Message-----
> > From: Fan Zhang [mailto:roy.fan.zhang at intel.com]
> > Sent: Tuesday, June 26, 2018 10:11 AM
> > To: dev at dpdk.org
> > Cc: pablo.de.lara.guarch at intel.com; Zhoujian (jay)
> > <jianjay.zhou at huawei.com>; stable at dpdk.org
> > Subject: [PATCH v2] crypto/virtio: fix iv physical address
> >
> > The physical address of IV required by Virtio was computed using
> > crypto operations' physical address plus the offset. However not all
> > crypto ops will have physical address field initialized and compute it runtimely
> is costly.
> > This patch fixes this problem by adding iv field in
> > virtio_crypto_op_cookie and does a memcpy of iv instead.
> >
> > Fixes: 82adb12a1fce ("crypto/virtio: support burst enqueue/dequeue")
> > Cc: stable at dpdk.org
> >
> > Signed-off-by: Fan Zhang <roy.fan.zhang at intel.com>
> > ---
> >
> > v2:
> > - change max iv size to 16
> > - use branch to avoid unnecessary memcpy
> >
> >  drivers/crypto/virtio/virtio_cryptodev.c |  6 ++++++
> > drivers/crypto/virtio/virtio_cryptodev.h |  3 +++
> >  drivers/crypto/virtio/virtio_rxtx.c      | 14 +++++++++++++-
> >  3 files changed, 22 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/crypto/virtio/virtio_cryptodev.c
> > b/drivers/crypto/virtio/virtio_cryptodev.c
> > index df88953f6..6ffa7619c 100644
> > --- a/drivers/crypto/virtio/virtio_cryptodev.c
> > +++ b/drivers/crypto/virtio/virtio_cryptodev.c
> > @@ -1223,6 +1223,12 @@ virtio_crypto_sym_pad_op_ctrl_req(
> >  	/* Get cipher xform from crypto xform chain */
> >  	cipher_xform = virtio_crypto_get_cipher_xform(xform);
> >  	if (cipher_xform) {
> > +		if (cipher_xform->iv.length > VIRTIO_CRYPTO_MAX_IV_SIZE) {
> > +			VIRTIO_CRYPTO_SESSION_LOG_ERR(
> > +				"cipher IV cannot longer than %u",
> 
> Hi Fan,
> 
> As I mentioned in V1, do you agree to use "cipher IV length" or "cipher IV size"
> instead of "cipher IV" here?

Fan is out of office this week. Since this is a minor change,
I can apply it and make that change on the fly.

Thanks,
Pablo

> 
> Apart from that,
> 
> Reviewed-by: <jianjay.zhou at huawei.com>



More information about the dev mailing list