DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Zhang, Roy Fan" <roy.fan.zhang@intel.com>
To: David Marchand <david.marchand@redhat.com>,
	"dev@dpdk.org" <dev@dpdk.org>
Cc: "Poczatek, Jakub" <jakub.poczatek@intel.com>,
	Maxime Coquelin <maxime.coquelin@redhat.com>,
	"Xia, Chenbo" <chenbo.xia@intel.com>
Subject: RE: [PATCH] vhost/crypto: fix descriptor processing
Date: Wed, 22 Jun 2022 16:34:46 +0000	[thread overview]
Message-ID: <MW5PR11MB580919E05F0385550020EDA3B8B29@MW5PR11MB5809.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20220622153020.2598037-1-david.marchand@redhat.com>

> -----Original Message-----
> From: David Marchand <david.marchand@redhat.com>
> Sent: Wednesday, June 22, 2022 4:30 PM
> To: dev@dpdk.org
> Cc: Zhang, Roy Fan <roy.fan.zhang@intel.com>; Poczatek, Jakub
> <jakub.poczatek@intel.com>; Maxime Coquelin
> <maxime.coquelin@redhat.com>; Xia, Chenbo <chenbo.xia@intel.com>
> Subject: [PATCH] vhost/crypto: fix descriptor processing
> 
> copy_data was returning a pointer to an increased (off by one) descriptor.
> Subsequent calls to copy_data in the library were then failing.
> Fix this by incrementing the descriptor only if there is some left data
> to copy.
> 
> Fixes: 7287660a21e0 ("vhost/crypto: fix build with GCC 12")
> 
> Reported-by: Jakub Poczatek <jakub.poczatek@intel.com>
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> ---
>  lib/vhost/vhost_crypto.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/lib/vhost/vhost_crypto.c b/lib/vhost/vhost_crypto.c
> index 96ffb82a5d..54946f46d9 100644
> --- a/lib/vhost/vhost_crypto.c
> +++ b/lib/vhost/vhost_crypto.c
> @@ -610,8 +610,7 @@ copy_data(void *data, struct vhost_crypto_data_req
> *vc_req,
>  			return -1;
>  		left -= copied;
>  		data = RTE_PTR_ADD(data, copied);
> -		desc++;
> -	} while (desc < head + max_n_descs && left != 0);
> +	} while (left != 0 && ++desc < head + max_n_descs);
> 
>  	if (unlikely(left != 0))
>  		return -1;
> --
> 2.36.1
Thanks David. 
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>


  parent reply	other threads:[~2022-06-22 16:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-22 15:30 David Marchand
2022-06-22 15:34 ` Maxime Coquelin
2022-06-22 16:34 ` Zhang, Roy Fan [this message]
2022-06-22 17:14 ` Maxime Coquelin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=MW5PR11MB580919E05F0385550020EDA3B8B29@MW5PR11MB5809.namprd11.prod.outlook.com \
    --to=roy.fan.zhang@intel.com \
    --cc=chenbo.xia@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=jakub.poczatek@intel.com \
    --cc=maxime.coquelin@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).