Skip to contentSkip to conversation

vdpa/mlx5: Directly assign memory key

PATCH Superseded Eli Cohen 2 participants 3 messages Feb 2, 2023 – Feb 5, 2023

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Eli Cohen

author
#0 lore raw

PATCH 1/1 vdpa/mlx5: Directly assign memory key

When creating a memory key, the key value should be assigned to the passed pointer and not or'ed to.

This fix has is required but had no real impact so far.

Fixes 29064bfdabd5 ("vdpa/mlx5: Add support library for mlx5 VDPA implementation")
---
 drivers/vdpa/mlx5/core/resources.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/vdpa/mlx5/core/resources.c +1 -1
index 9800f9bec225..45ad41287a31 100644
@@ -213,7 +213,7 @@ int mlx5_vdpa_create_mkey(struct mlx5_vdpa_dev *mvdev, u32 *mkey, u32 *in,
 		return err;
 
 	mkey_index = MLX5_GET(create_mkey_out, lout, mkey_index);
-	*mkey |= mlx5_idx_to_mkey(mkey_index);
+	*mkey = mlx5_idx_to_mkey(mkey_index);
 	return 0;
 }
 
Signature · 1 line
2.38.1
#1 lore raw
Quoted 4 lines · Eli Cohen

When creating a memory key, the key value should be assigned to the passed pointer and not or'ed to.

This fix has is required but had no real impact so far.

I don't get what this sentence says. Both grammar and general meaning elude me.

Quoted 21 lines
Fixes 29064bfdabd5 ("vdpa/mlx5: Add support library for mlx5 VDPA implementation")
---
 drivers/vdpa/mlx5/core/resources.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/vdpa/mlx5/core/resources.c +1 -1
index 9800f9bec225..45ad41287a31 100644
@@ -213,7 +213,7 @@ int mlx5_vdpa_create_mkey(struct mlx5_vdpa_dev *mvdev, u32 *mkey, u32 *in,
 		return err;
 
 	mkey_index = MLX5_GET(create_mkey_out, lout, mkey_index);
-	*mkey |= mlx5_idx_to_mkey(mkey_index);
+	*mkey = mlx5_idx_to_mkey(mkey_index);
 	return 0;
 }
 
Signature · 1 line
2.38.1

_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

author
#2 lore raw
Quoted 7 lines · Michael S. Tsirkin
Quoted 4 lines · Eli Cohen

When creating a memory key, the key value should be assigned to the passed pointer and not or'ed to.

This fix has is required but had no real impact so far.

I don't get what this sentence says. Both grammar and general meaning elude me.

And I can't blame you for that.

Re-sending...

Quoted 22 lines
Quoted 22 lines
Fixes 29064bfdabd5 ("vdpa/mlx5: Add support library for mlx5 VDPA implementation")
---
  drivers/vdpa/mlx5/core/resources.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/vdpa/mlx5/core/resources.c +1 -1
index 9800f9bec225..45ad41287a31 100644
@@ -213,7 +213,7 @@ int mlx5_vdpa_create_mkey(struct mlx5_vdpa_dev *mvdev, u32 *mkey, u32 *in,
  		return err;
 
  	mkey_index = MLX5_GET(create_mkey_out, lout, mkey_index);
-	*mkey |= mlx5_idx_to_mkey(mkey_index);
+	*mkey = mlx5_idx_to_mkey(mkey_index);
  	return 0;
  }
 
Signature · 1 line
2.38.1