example/vhost_crypto: fix incorrect fetch size
diff mbox series

Message ID 20191126095410.72395-1-roy.fan.zhang@intel.com
State Deferred
Delegated to: Maxime Coquelin
Headers show
Series
  • example/vhost_crypto: fix incorrect fetch size
Related show

Checks

Context Check Description
ci/travis-robot success Travis build: passed
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-compilation success Compile Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/Intel-compilation success Compilation OK
ci/checkpatch success coding style OK

Commit Message

Fan Zhang Nov. 26, 2019, 9:54 a.m. UTC
Coverity issue: 343401

Fixes: f5188211c721 ("examples/vhost_crypto: add sample application")
Cc: roy.fan.zhang@intel.com

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
---
 examples/vhost_crypto/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Maxime Coquelin Jan. 14, 2020, 9:30 a.m. UTC | #1
Hi Fan,

On 11/26/19 10:54 AM, Fan Zhang wrote:
> Coverity issue: 343401
> 
> Fixes: f5188211c721 ("examples/vhost_crypto: add sample application")
> Cc: roy.fan.zhang@intel.com
> 
> Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
> ---
>  examples/vhost_crypto/main.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/examples/vhost_crypto/main.c b/examples/vhost_crypto/main.c
> index 1d7ba9419..5d80bcaca 100644
> --- a/examples/vhost_crypto/main.c
> +++ b/examples/vhost_crypto/main.c
> @@ -387,7 +387,7 @@ vhost_crypto_worker(void *arg)
>  				continue;
>  
>  			for (j = 0; j < NB_VIRTIO_QUEUES; j++) {
> -				to_fetch = RTE_MIN(burst_size,
> +				to_fetch = RTE_MAX(burst_size,
>  						(NB_CRYPTO_DESCRIPTORS -
>  						info->nb_inflight_ops));
>  				fetched = rte_vhost_crypto_fetch_requests(
> 

Could you please add a commit message to explain the change?
With just the patch context, this fix looks weird.

Thanks!
Maxime
Fan Zhang Jan. 29, 2020, 10:21 a.m. UTC | #2
Hi Maxime,

Sorry for the late reply.
This patch is incorrect. I have sent the correct version http://patchwork.dpdk.org/patch/65302/

Regards,
Fan

> -----Original Message-----
> From: Maxime Coquelin <maxime.coquelin@redhat.com>
> Sent: Tuesday, January 14, 2020 9:30 AM
> To: Zhang, Roy Fan <roy.fan.zhang@intel.com>; dev@dpdk.org
> Subject: Re: [PATCH] example/vhost_crypto: fix incorrect fetch size
> 
> Hi Fan,
> 
> On 11/26/19 10:54 AM, Fan Zhang wrote:
> > Coverity issue: 343401
> >
> > Fixes: f5188211c721 ("examples/vhost_crypto: add sample application")
> > Cc: roy.fan.zhang@intel.com
> >
> > Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
> > ---
> >  examples/vhost_crypto/main.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/examples/vhost_crypto/main.c
> > b/examples/vhost_crypto/main.c index 1d7ba9419..5d80bcaca 100644
> > --- a/examples/vhost_crypto/main.c
> > +++ b/examples/vhost_crypto/main.c
> > @@ -387,7 +387,7 @@ vhost_crypto_worker(void *arg)
> >  				continue;
> >
> >  			for (j = 0; j < NB_VIRTIO_QUEUES; j++) {
> > -				to_fetch = RTE_MIN(burst_size,
> > +				to_fetch = RTE_MAX(burst_size,
> >  						(NB_CRYPTO_DESCRIPTORS
> -
> >  						info->nb_inflight_ops));
> >  				fetched = rte_vhost_crypto_fetch_requests(
> >
> 
> Could you please add a commit message to explain the change?
> With just the patch context, this fix looks weird.
> 
> Thanks!
> Maxime

Patch
diff mbox series

diff --git a/examples/vhost_crypto/main.c b/examples/vhost_crypto/main.c
index 1d7ba9419..5d80bcaca 100644
--- a/examples/vhost_crypto/main.c
+++ b/examples/vhost_crypto/main.c
@@ -387,7 +387,7 @@  vhost_crypto_worker(void *arg)
 				continue;
 
 			for (j = 0; j < NB_VIRTIO_QUEUES; j++) {
-				to_fetch = RTE_MIN(burst_size,
+				to_fetch = RTE_MAX(burst_size,
 						(NB_CRYPTO_DESCRIPTORS -
 						info->nb_inflight_ops));
 				fetched = rte_vhost_crypto_fetch_requests(