vdpa/mlx5: fix return value check of mkey create

Message ID 20211112144245.9389-1-bingz@nvidia.com (mailing list archive)
State Accepted, archived
Delegated to: Maxime Coquelin
Headers
Series vdpa/mlx5: fix return value check of mkey create |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/github-robot: build success github build: passed
ci/iol-broadcom-Functional success Functional Testing PASS
ci/intel-Testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS

Commit Message

Bing Zhao Nov. 12, 2021, 2:42 p.m. UTC
  The return value of "mlx5_os_wrapped_mkey_create" is checked in the
caller. A zero means success without any error.

The typo in the if-condition should be fixed in case there is a
misjudgment.

Fixes: f26e06d97d57 ("vdpa/mlx5: workaround dirty bitmap MR creation")

Signed-off-by: Bing Zhao <bingz@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
 drivers/vdpa/mlx5/mlx5_vdpa_lm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Chenbo Xia Nov. 16, 2021, 7:54 a.m. UTC | #1
> -----Original Message-----
> From: Bing Zhao <bingz@nvidia.com>
> Sent: Friday, November 12, 2021 10:43 PM
> To: viacheslavo@nvidia.com; matan@nvidia.com
> Cc: dev@dpdk.org; rasland@nvidia.com
> Subject: [PATCH] vdpa/mlx5: fix return value check of mkey create
> 
> The return value of "mlx5_os_wrapped_mkey_create" is checked in the
> caller. A zero means success without any error.
> 
> The typo in the if-condition should be fixed in case there is a
> misjudgment.
> 
> Fixes: f26e06d97d57 ("vdpa/mlx5: workaround dirty bitmap MR creation")

Wrong commit id, should be the one in main tree:

Fixes: 398ea8450c53 ("vdpa/mlx5: workaround dirty bitmap MR creation")

With this fixed:

Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>

> 
> Signed-off-by: Bing Zhao <bingz@nvidia.com>
> Acked-by: Matan Azrad <matan@nvidia.com>
> ---
>  drivers/vdpa/mlx5/mlx5_vdpa_lm.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/vdpa/mlx5/mlx5_vdpa_lm.c
> b/drivers/vdpa/mlx5/mlx5_vdpa_lm.c
> index e65e4faa47..43a2b98255 100644
> --- a/drivers/vdpa/mlx5/mlx5_vdpa_lm.c
> +++ b/drivers/vdpa/mlx5/mlx5_vdpa_lm.c
> @@ -47,7 +47,7 @@ mlx5_vdpa_dirty_bitmap_set(struct mlx5_vdpa_priv *priv,
> uint64_t log_base,
>  					      (void *)(uintptr_t)log_base,
>  					      log_size, &priv->lm_mr);
> 
> -	if (!ret) {
> +	if (ret) {
>  		DRV_LOG(ERR, "Failed to allocate wrapped MR for lm.");
>  		return -1;
>  	}
> --
> 2.27.0
  
Bing Zhao Nov. 16, 2021, 8:01 a.m. UTC | #2
Hi Chenbo,


> -----Original Message-----
> From: Xia, Chenbo <chenbo.xia@intel.com>
> Sent: Tuesday, November 16, 2021 3:54 PM
> To: Bing Zhao <bingz@nvidia.com>; Slava Ovsiienko
> <viacheslavo@nvidia.com>; Matan Azrad <matan@nvidia.com>
> Cc: dev@dpdk.org; Raslan Darawsheh <rasland@nvidia.com>
> Subject: RE: [PATCH] vdpa/mlx5: fix return value check of mkey
> create
> 
> External email: Use caution opening links or attachments
> 
> 
> > -----Original Message-----
> > From: Bing Zhao <bingz@nvidia.com>
> > Sent: Friday, November 12, 2021 10:43 PM
> > To: viacheslavo@nvidia.com; matan@nvidia.com
> > Cc: dev@dpdk.org; rasland@nvidia.com
> > Subject: [PATCH] vdpa/mlx5: fix return value check of mkey create
> >
> > The return value of "mlx5_os_wrapped_mkey_create" is checked in
> the
> > caller. A zero means success without any error.
> >
> > The typo in the if-condition should be fixed in case there is a
> > misjudgment.
> >
> > Fixes: f26e06d97d57 ("vdpa/mlx5: workaround dirty bitmap MR
> creation")
> 
> Wrong commit id, should be the one in main tree:
> 
> Fixes: 398ea8450c53 ("vdpa/mlx5: workaround dirty bitmap MR
> creation")
> 
> With this fixed:
> 
> Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>

Thanks for the comments.
Is there any need to send a v2 or Maxime will help on this?

> 
> >
> > Signed-off-by: Bing Zhao <bingz@nvidia.com>
> > Acked-by: Matan Azrad <matan@nvidia.com>
> > ---
> >  drivers/vdpa/mlx5/mlx5_vdpa_lm.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/vdpa/mlx5/mlx5_vdpa_lm.c
> > b/drivers/vdpa/mlx5/mlx5_vdpa_lm.c
> > index e65e4faa47..43a2b98255 100644
> > --- a/drivers/vdpa/mlx5/mlx5_vdpa_lm.c
> > +++ b/drivers/vdpa/mlx5/mlx5_vdpa_lm.c
> > @@ -47,7 +47,7 @@ mlx5_vdpa_dirty_bitmap_set(struct mlx5_vdpa_priv
> > *priv, uint64_t log_base,
> >                                             (void
> *)(uintptr_t)log_base,
> >                                             log_size, &priv-
> >lm_mr);
> >
> > -     if (!ret) {
> > +     if (ret) {
> >               DRV_LOG(ERR, "Failed to allocate wrapped MR for
> lm.");
> >               return -1;
> >       }
> > --
> > 2.27.0

BR. Bing
  
Chenbo Xia Nov. 16, 2021, 8:04 a.m. UTC | #3
> -----Original Message-----
> From: Bing Zhao <bingz@nvidia.com>
> Sent: Tuesday, November 16, 2021 4:01 PM
> To: Xia, Chenbo <chenbo.xia@intel.com>; Slava Ovsiienko
> <viacheslavo@nvidia.com>; Matan Azrad <matan@nvidia.com>;
> maxime.coquelin@redhat.com
> Cc: dev@dpdk.org; Raslan Darawsheh <rasland@nvidia.com>
> Subject: RE: [PATCH] vdpa/mlx5: fix return value check of mkey create
> 
> Hi Chenbo,
> 
> 
> > -----Original Message-----
> > From: Xia, Chenbo <chenbo.xia@intel.com>
> > Sent: Tuesday, November 16, 2021 3:54 PM
> > To: Bing Zhao <bingz@nvidia.com>; Slava Ovsiienko
> > <viacheslavo@nvidia.com>; Matan Azrad <matan@nvidia.com>
> > Cc: dev@dpdk.org; Raslan Darawsheh <rasland@nvidia.com>
> > Subject: RE: [PATCH] vdpa/mlx5: fix return value check of mkey
> > create
> >
> > External email: Use caution opening links or attachments
> >
> >
> > > -----Original Message-----
> > > From: Bing Zhao <bingz@nvidia.com>
> > > Sent: Friday, November 12, 2021 10:43 PM
> > > To: viacheslavo@nvidia.com; matan@nvidia.com
> > > Cc: dev@dpdk.org; rasland@nvidia.com
> > > Subject: [PATCH] vdpa/mlx5: fix return value check of mkey create
> > >
> > > The return value of "mlx5_os_wrapped_mkey_create" is checked in
> > the
> > > caller. A zero means success without any error.
> > >
> > > The typo in the if-condition should be fixed in case there is a
> > > misjudgment.
> > >
> > > Fixes: f26e06d97d57 ("vdpa/mlx5: workaround dirty bitmap MR
> > creation")
> >
> > Wrong commit id, should be the one in main tree:
> >
> > Fixes: 398ea8450c53 ("vdpa/mlx5: workaround dirty bitmap MR
> > creation")
> >
> > With this fixed:
> >
> > Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
> 
> Thanks for the comments.
> Is there any need to send a v2 or Maxime will help on this?

I think it can be fixed when applying.

Thanks,
Chenbo
  
Bing Zhao Nov. 16, 2021, 8:13 a.m. UTC | #4
Hi,

> -----Original Message-----
> From: Xia, Chenbo <chenbo.xia@intel.com>
> Sent: Tuesday, November 16, 2021 4:05 PM
> To: Bing Zhao <bingz@nvidia.com>; Slava Ovsiienko
> <viacheslavo@nvidia.com>; Matan Azrad <matan@nvidia.com>;
> maxime.coquelin@redhat.com
> Cc: dev@dpdk.org; Raslan Darawsheh <rasland@nvidia.com>
> Subject: RE: [PATCH] vdpa/mlx5: fix return value check of mkey
> create
> 
> External email: Use caution opening links or attachments
> 
> 
> > -----Original Message-----
> > From: Bing Zhao <bingz@nvidia.com>
> > Sent: Tuesday, November 16, 2021 4:01 PM
> > To: Xia, Chenbo <chenbo.xia@intel.com>; Slava Ovsiienko
> > <viacheslavo@nvidia.com>; Matan Azrad <matan@nvidia.com>;
> > maxime.coquelin@redhat.com
> > Cc: dev@dpdk.org; Raslan Darawsheh <rasland@nvidia.com>
> > Subject: RE: [PATCH] vdpa/mlx5: fix return value check of mkey
> create
> >
> > Hi Chenbo,
> >
> >
> > > -----Original Message-----
> > > From: Xia, Chenbo <chenbo.xia@intel.com>
> > > Sent: Tuesday, November 16, 2021 3:54 PM
> > > To: Bing Zhao <bingz@nvidia.com>; Slava Ovsiienko
> > > <viacheslavo@nvidia.com>; Matan Azrad <matan@nvidia.com>
> > > Cc: dev@dpdk.org; Raslan Darawsheh <rasland@nvidia.com>
> > > Subject: RE: [PATCH] vdpa/mlx5: fix return value check of mkey
> > > create
> > >
> > > External email: Use caution opening links or attachments
> > >
> > >
> > > > -----Original Message-----
> > > > From: Bing Zhao <bingz@nvidia.com>
> > > > Sent: Friday, November 12, 2021 10:43 PM
> > > > To: viacheslavo@nvidia.com; matan@nvidia.com
> > > > Cc: dev@dpdk.org; rasland@nvidia.com
> > > > Subject: [PATCH] vdpa/mlx5: fix return value check of mkey
> create
> > > >
> > > > The return value of "mlx5_os_wrapped_mkey_create" is checked
> in
> > > the
> > > > caller. A zero means success without any error.
> > > >
> > > > The typo in the if-condition should be fixed in case there is
> a
> > > > misjudgment.
> > > >
> > > > Fixes: f26e06d97d57 ("vdpa/mlx5: workaround dirty bitmap MR
> > > creation")
> > >
> > > Wrong commit id, should be the one in main tree:
> > >
> > > Fixes: 398ea8450c53 ("vdpa/mlx5: workaround dirty bitmap MR
> > > creation")
> > >
> > > With this fixed:
> > >
> > > Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
> >
> > Thanks for the comments.
> > Is there any need to send a v2 or Maxime will help on this?
> 
> I think it can be fixed when applying.

Then that's good. Thank you.
Please let me know whenever a v2 is needed.

> 
> Thanks,
> Chenbo

BR. Bing
  
Maxime Coquelin Nov. 16, 2021, 10:24 a.m. UTC | #5
On 11/12/21 15:42, Bing Zhao wrote:
> The return value of "mlx5_os_wrapped_mkey_create" is checked in the
> caller. A zero means success without any error.
> 
> The typo in the if-condition should be fixed in case there is a
> misjudgment.
> 
> Fixes: f26e06d97d57 ("vdpa/mlx5: workaround dirty bitmap MR creation")
> 
> Signed-off-by: Bing Zhao <bingz@nvidia.com>
> Acked-by: Matan Azrad <matan@nvidia.com>
> ---
>   drivers/vdpa/mlx5/mlx5_vdpa_lm.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/vdpa/mlx5/mlx5_vdpa_lm.c b/drivers/vdpa/mlx5/mlx5_vdpa_lm.c
> index e65e4faa47..43a2b98255 100644
> --- a/drivers/vdpa/mlx5/mlx5_vdpa_lm.c
> +++ b/drivers/vdpa/mlx5/mlx5_vdpa_lm.c
> @@ -47,7 +47,7 @@ mlx5_vdpa_dirty_bitmap_set(struct mlx5_vdpa_priv *priv, uint64_t log_base,
>   					      (void *)(uintptr_t)log_base,
>   					      log_size, &priv->lm_mr);
>   
> -	if (!ret) {
> +	if (ret) {
>   		DRV_LOG(ERR, "Failed to allocate wrapped MR for lm.");
>   		return -1;
>   	}
> 

Applied to dpdk-next-virtio/main with Fixes tag fixed.

Thanks,
Maxime
  
Bing Zhao Nov. 16, 2021, 10:25 a.m. UTC | #6
Hi Maxime,

> -----Original Message-----
> From: Maxime Coquelin <maxime.coquelin@redhat.com>
> Sent: Tuesday, November 16, 2021 6:25 PM
> To: Bing Zhao <bingz@nvidia.com>; Slava Ovsiienko
> <viacheslavo@nvidia.com>; Matan Azrad <matan@nvidia.com>
> Cc: dev@dpdk.org; Raslan Darawsheh <rasland@nvidia.com>
> Subject: Re: [PATCH] vdpa/mlx5: fix return value check of mkey
> create
> 
> External email: Use caution opening links or attachments
> 
> 
> On 11/12/21 15:42, Bing Zhao wrote:
> > The return value of "mlx5_os_wrapped_mkey_create" is checked in
> the
> > caller. A zero means success without any error.
> >
> > The typo in the if-condition should be fixed in case there is a
> > misjudgment.
> >
> > Fixes: f26e06d97d57 ("vdpa/mlx5: workaround dirty bitmap MR
> creation")
> >
> > Signed-off-by: Bing Zhao <bingz@nvidia.com>
> > Acked-by: Matan Azrad <matan@nvidia.com>
> > ---
> >   drivers/vdpa/mlx5/mlx5_vdpa_lm.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/vdpa/mlx5/mlx5_vdpa_lm.c
> > b/drivers/vdpa/mlx5/mlx5_vdpa_lm.c
> > index e65e4faa47..43a2b98255 100644
> > --- a/drivers/vdpa/mlx5/mlx5_vdpa_lm.c
> > +++ b/drivers/vdpa/mlx5/mlx5_vdpa_lm.c
> > @@ -47,7 +47,7 @@ mlx5_vdpa_dirty_bitmap_set(struct mlx5_vdpa_priv
> *priv, uint64_t log_base,
> >                                             (void
> *)(uintptr_t)log_base,
> >                                             log_size, &priv-
> >lm_mr);
> >
> > -     if (!ret) {
> > +     if (ret) {
> >               DRV_LOG(ERR, "Failed to allocate wrapped MR for
> lm.");
> >               return -1;
> >       }
> >
> 
> Applied to dpdk-next-virtio/main with Fixes tag fixed.
> 
> Thanks,
> Maxime

Thank you.

BR. Bing
  

Patch

diff --git a/drivers/vdpa/mlx5/mlx5_vdpa_lm.c b/drivers/vdpa/mlx5/mlx5_vdpa_lm.c
index e65e4faa47..43a2b98255 100644
--- a/drivers/vdpa/mlx5/mlx5_vdpa_lm.c
+++ b/drivers/vdpa/mlx5/mlx5_vdpa_lm.c
@@ -47,7 +47,7 @@  mlx5_vdpa_dirty_bitmap_set(struct mlx5_vdpa_priv *priv, uint64_t log_base,
 					      (void *)(uintptr_t)log_base,
 					      log_size, &priv->lm_mr);
 
-	if (!ret) {
+	if (ret) {
 		DRV_LOG(ERR, "Failed to allocate wrapped MR for lm.");
 		return -1;
 	}