Skip to contentSkip to conversation

vdpa/mlx5: fix return value check of mkey create

PATCH Applied Bing Zhao 3 participants 7 messages Nov 12, 2021 – Nov 16, 2021

Subsystems (2)
lore
Share & tools
lore

Bing Zhao

author
#0 lore raw

PATCH 1/1 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")
---
 drivers/vdpa/mlx5/mlx5_vdpa_lm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/vdpa/mlx5/mlx5_vdpa_lm.c +1 -1
index e65e4faa47..43a2b98255 100644
@@ -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;
 	}
Signature · 1 line
2.27.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines

-----Original Message-----
From: Bing Zhao <[email protected]>
Sent: Friday, November 12, 2021 10:43 PM
To: [email protected]; [email protected]
Cc: [email protected]; [email protected]
Subject: [PATCH] vdpa/mlx5: fix return value check of mkey create

Quoted 7 lines

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:

Quoted 24 lines
---
 drivers/vdpa/mlx5/mlx5_vdpa_lm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/vdpa/mlx5/mlx5_vdpa_lm.c +1 -1
index e65e4faa47..43a2b98255 100644
@@ -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

author
#2 lore raw

Hi Chenbo,

Quoted 29 lines

-----Original Message-----
From: Xia, Chenbo <[email protected]>
Sent: Tuesday, November 16, 2021 3:54 PM
To: Bing Zhao <[email protected]>; Slava Ovsiienko <[email protected]>; Matan Azrad <[email protected]>
Cc: [email protected]; Raslan Darawsheh <[email protected]>
Subject: RE: [PATCH] vdpa/mlx5: fix return value check of mkey create

External email: Use caution opening links or attachments

Quoted 8 lines

-----Original Message-----
From: Bing Zhao <[email protected]>
Sent: Friday, November 12, 2021 10:43 PM
To: [email protected]; [email protected]
Cc: [email protected]; [email protected]
Subject: [PATCH] vdpa/mlx5: fix return value check of mkey create

The return value of "mlx5_os_wrapped_mkey_create" is checked in

the

Quoted 6 lines

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")

Quoted 8 lines

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

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

creation")

With this fixed:

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

Quoted 17 lines
Quoted 14 lines
---
 drivers/vdpa/mlx5/mlx5_vdpa_lm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/vdpa/mlx5/mlx5_vdpa_lm.c +0 -0
index e65e4faa47..43a2b98255 100644

drivers/vdpa/mlx5/mlx5_vdpa_lm.c mlx5_vdpa_dirty_bitmap_set(struct mlx5_vdpa_priv · line 48

Quoted 2 lines
drivers/vdpa/mlx5/mlx5_vdpa_lm.c +0 -0
@@ -47,7 +47,7 @@ mlx5_vdpa_dirty_bitmap_set(struct mlx5_vdpa_priv
 *priv, uint64_t log_base,
                                            (void

*)(uintptr_t)log_base,

Quoted 11 lines

drivers/vdpa/mlx5/mlx5_vdpa_lm.c mlx5_vdpa_dirty_bitmap_set(struct mlx5_vdpa_priv *priv, uint64_t log_base,

Quoted 6 lines
drivers/vdpa/mlx5/mlx5_vdpa_lm.c +1 -1
                                            log_size, &priv-
 lm_mr);
 
-     if (!ret) {
+     if (ret) {
              DRV_LOG(ERR, "Failed to allocate wrapped MR for

lm.");

Quoted 4 lines
              return -1;
      }

--
2.27.0

BR. Bing

#3 lore raw
Quoted 46 lines

-----Original Message-----
From: Bing Zhao <[email protected]>
Sent: Tuesday, November 16, 2021 4:01 PM
To: Xia, Chenbo <[email protected]>; Slava Ovsiienko <[email protected]>; Matan Azrad <[email protected]>; [email protected]
Cc: [email protected]; Raslan Darawsheh <[email protected]>
Subject: RE: [PATCH] vdpa/mlx5: fix return value check of mkey create

Hi Chenbo,

Quoted 34 lines

-----Original Message-----
From: Xia, Chenbo <[email protected]>
Sent: Tuesday, November 16, 2021 3:54 PM
To: Bing Zhao <[email protected]>; Slava Ovsiienko <[email protected]>; Matan Azrad <[email protected]>
Cc: [email protected]; Raslan Darawsheh <[email protected]>
Subject: RE: [PATCH] vdpa/mlx5: fix return value check of mkey create

External email: Use caution opening links or attachments

Quoted 8 lines

-----Original Message-----
From: Bing Zhao <[email protected]>
Sent: Friday, November 12, 2021 10:43 PM
To: [email protected]; [email protected]
Cc: [email protected]; [email protected]
Subject: [PATCH] vdpa/mlx5: fix return value check of mkey create

The return value of "mlx5_os_wrapped_mkey_create" is checked in

the

Quoted 6 lines

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")

Quoted 6 lines
Quoted 3 lines

With this fixed:

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

author
#4 lore raw

Hi,

Quoted 63 lines

-----Original Message-----
From: Xia, Chenbo <[email protected]>
Sent: Tuesday, November 16, 2021 4:05 PM
To: Bing Zhao <[email protected]>; Slava Ovsiienko <[email protected]>; Matan Azrad <[email protected]>; [email protected]
Cc: [email protected]; Raslan Darawsheh <[email protected]>
Subject: RE: [PATCH] vdpa/mlx5: fix return value check of mkey create

External email: Use caution opening links or attachments

Quoted 8 lines

-----Original Message-----
From: Bing Zhao <[email protected]>
Sent: Tuesday, November 16, 2021 4:01 PM
To: Xia, Chenbo <[email protected]>; Slava Ovsiienko <[email protected]>; Matan Azrad <[email protected]>; [email protected]
Cc: [email protected]; Raslan Darawsheh <[email protected]>
Subject: RE: [PATCH] vdpa/mlx5: fix return value check of mkey

create

Quoted 22 lines

Hi Chenbo,

Quoted 18 lines

-----Original Message-----
From: Xia, Chenbo <[email protected]>
Sent: Tuesday, November 16, 2021 3:54 PM
To: Bing Zhao <[email protected]>; Slava Ovsiienko <[email protected]>; Matan Azrad <[email protected]>
Cc: [email protected]; Raslan Darawsheh <[email protected]>
Subject: RE: [PATCH] vdpa/mlx5: fix return value check of mkey create

External email: Use caution opening links or attachments

Quoted 6 lines

-----Original Message-----
From: Bing Zhao <[email protected]>
Sent: Friday, November 12, 2021 10:43 PM
To: [email protected]; [email protected]
Cc: [email protected]; [email protected]
Subject: [PATCH] vdpa/mlx5: fix return value check of mkey

create

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

The return value of "mlx5_os_wrapped_mkey_create" is checked

in

Quoted 4 lines
Quoted 4 lines

the

Quoted 3 lines

caller. A zero means success without any error.

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

a

Quoted 10 lines
Quoted 10 lines
Quoted 3 lines

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")

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines

With this fixed:

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.

Quoted 3 lines

Thanks,
Chenbo

BR. Bing

#5 lore raw
In reply to Bing Zhao
Quoted 20 lines · Bing Zhao

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")
---
  drivers/vdpa/mlx5/mlx5_vdpa_lm.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/vdpa/mlx5/mlx5_vdpa_lm.c +0 -0
index e65e4faa47..43a2b98255 100644

drivers/vdpa/mlx5/mlx5_vdpa_lm.c mlx5_vdpa_dirty_bitmap_set(struct mlx5_vdpa_priv *priv, uint64_t log_base, · line 53

Quoted 8 lines
drivers/vdpa/mlx5/mlx5_vdpa_lm.c +1 -1
@@ -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

author
#6 lore raw

Hi Maxime,

Quoted 45 lines

-----Original Message-----
From: Maxime Coquelin <[email protected]>
Sent: Tuesday, November 16, 2021 6:25 PM
To: Bing Zhao <[email protected]>; Slava Ovsiienko <[email protected]>; Matan Azrad <[email protected]>
Cc: [email protected]; Raslan Darawsheh <[email protected]>
Subject: Re: [PATCH] vdpa/mlx5: fix return value check of mkey create

External email: Use caution opening links or attachments

Quoted 1 line · Bing Zhao

The return value of "mlx5_os_wrapped_mkey_create" is checked in

the

Quoted 6 lines

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")

drivers/vdpa/mlx5/mlx5_vdpa_lm.c mlx5_vdpa_dirty_bitmap_set(struct mlx5_vdpa_priv

Quoted 13 lines
---
  drivers/vdpa/mlx5/mlx5_vdpa_lm.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/vdpa/mlx5/mlx5_vdpa_lm.c +0 -0
index e65e4faa47..43a2b98255 100644
@@ -47,7 +47,7 @@ mlx5_vdpa_dirty_bitmap_set(struct mlx5_vdpa_priv

*priv, uint64_t log_base,

drivers/vdpa/mlx5/mlx5_vdpa_lm.c mlx5_vdpa_dirty_bitmap_set(struct mlx5_vdpa_priv · line 47

Quoted 1 line
drivers/vdpa/mlx5/mlx5_vdpa_lm.c +0 -0
                                            (void

*)(uintptr_t)log_base,

drivers/vdpa/mlx5/mlx5_vdpa_lm.c mlx5_vdpa_dirty_bitmap_set(struct mlx5_vdpa_priv *priv, uint64_t log_base,

Quoted 6 lines
drivers/vdpa/mlx5/mlx5_vdpa_lm.c +1 -1
                                            log_size, &priv-
 lm_mr);
 
-     if (!ret) {
+     if (ret) {
              DRV_LOG(ERR, "Failed to allocate wrapped MR for

lm.");

Quoted 8 lines
Quoted 3 lines
drivers/vdpa/mlx5/mlx5_vdpa_lm.c +0 -0
              return -1;
      }

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

Thanks,
Maxime

Thank you.

BR. Bing