DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/mlx5: remove redundant size calculation macro
@ 2019-05-15 10:11 Dekel Peled
  2019-05-15 10:11 ` Dekel Peled
  2019-05-26 19:23 ` Shahaf Shuler
  0 siblings, 2 replies; 3+ messages in thread
From: Dekel Peled @ 2019-05-15 10:11 UTC (permalink / raw)
  To: yskoh, shahafs; +Cc: dev, orika

Patch [1] added, among other definitions, the macro MLX5_ST_SZ_DB.
Patch [2] added later the macro MLX5_ST_SZ_BYTES, which is exactly
the same macro with a different name.
Each of these macros was used in very few places.

This patch removes the definition of MLX5_ST_SZ_DB, and replaces it
with MLX5_ST_SZ_BYTES wherever it was used.
Macro MLX5_ST_SZ_BYTES was preffered since it is the same macro
name used in kernel code, see [3].

[1] http://patches.dpdk.org/patch/45254/
[2] http://patches.dpdk.org/patch/49403/
[3] https://lists.openwall.net/netdev/2014/10/02/75

Signed-off-by: Dekel Peled <dekelp@mellanox.com>
---
 drivers/net/mlx5/mlx5_flow_dv.c | 4 ++--
 drivers/net/mlx5/mlx5_prm.h     | 1 -
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index cf255ca..b9f42d6 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -2486,7 +2486,7 @@ struct field_modify_info modify_tcp[] = {
 				   "not enough memory to create flow");
 		return NULL;
 	}
-	flow->dv.value.size = MLX5_ST_SZ_DB(fte_match_param);
+	flow->dv.value.size = MLX5_ST_SZ_BYTES(fte_match_param);
 	return flow;
 }
 
@@ -2510,7 +2510,7 @@ struct field_modify_info modify_tcp[] = {
 	uint8_t *v = match_value;
 	unsigned int i;
 
-	for (i = 0; i < MLX5_ST_SZ_DB(fte_match_param); ++i) {
+	for (i = 0; i < MLX5_ST_SZ_BYTES(fte_match_param); ++i) {
 		if (v[i] & ~m[i]) {
 			DRV_LOG(ERR,
 				"match_value differs from match_criteria"
diff --git a/drivers/net/mlx5/mlx5_prm.h b/drivers/net/mlx5/mlx5_prm.h
index 8c42380..602a5ac 100644
--- a/drivers/net/mlx5/mlx5_prm.h
+++ b/drivers/net/mlx5/mlx5_prm.h
@@ -378,7 +378,6 @@ struct mlx5_modification_cmd {
 #define __mlx5_mask16(typ, fld) ((u16)((1ull << __mlx5_bit_sz(typ, fld)) - 1))
 #define MLX5_ST_SZ_BYTES(typ) (sizeof(struct mlx5_ifc_##typ##_bits) / 8)
 #define MLX5_ST_SZ_DW(typ) (sizeof(struct mlx5_ifc_##typ##_bits) / 32)
-#define MLX5_ST_SZ_DB(typ) (sizeof(struct mlx5_ifc_##typ##_bits) / 8)
 #define MLX5_BYTE_OFF(typ, fld) (__mlx5_bit_off(typ, fld) / 8)
 #define MLX5_ADDR_OF(typ, p, fld) ((char *)(p) + MLX5_BYTE_OFF(typ, fld))
 
-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [dpdk-dev] [PATCH] net/mlx5: remove redundant size calculation macro
  2019-05-15 10:11 [dpdk-dev] [PATCH] net/mlx5: remove redundant size calculation macro Dekel Peled
@ 2019-05-15 10:11 ` Dekel Peled
  2019-05-26 19:23 ` Shahaf Shuler
  1 sibling, 0 replies; 3+ messages in thread
From: Dekel Peled @ 2019-05-15 10:11 UTC (permalink / raw)
  To: yskoh, shahafs; +Cc: dev, orika

Patch [1] added, among other definitions, the macro MLX5_ST_SZ_DB.
Patch [2] added later the macro MLX5_ST_SZ_BYTES, which is exactly
the same macro with a different name.
Each of these macros was used in very few places.

This patch removes the definition of MLX5_ST_SZ_DB, and replaces it
with MLX5_ST_SZ_BYTES wherever it was used.
Macro MLX5_ST_SZ_BYTES was preffered since it is the same macro
name used in kernel code, see [3].

[1] http://patches.dpdk.org/patch/45254/
[2] http://patches.dpdk.org/patch/49403/
[3] https://lists.openwall.net/netdev/2014/10/02/75

Signed-off-by: Dekel Peled <dekelp@mellanox.com>
---
 drivers/net/mlx5/mlx5_flow_dv.c | 4 ++--
 drivers/net/mlx5/mlx5_prm.h     | 1 -
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index cf255ca..b9f42d6 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -2486,7 +2486,7 @@ struct field_modify_info modify_tcp[] = {
 				   "not enough memory to create flow");
 		return NULL;
 	}
-	flow->dv.value.size = MLX5_ST_SZ_DB(fte_match_param);
+	flow->dv.value.size = MLX5_ST_SZ_BYTES(fte_match_param);
 	return flow;
 }
 
@@ -2510,7 +2510,7 @@ struct field_modify_info modify_tcp[] = {
 	uint8_t *v = match_value;
 	unsigned int i;
 
-	for (i = 0; i < MLX5_ST_SZ_DB(fte_match_param); ++i) {
+	for (i = 0; i < MLX5_ST_SZ_BYTES(fte_match_param); ++i) {
 		if (v[i] & ~m[i]) {
 			DRV_LOG(ERR,
 				"match_value differs from match_criteria"
diff --git a/drivers/net/mlx5/mlx5_prm.h b/drivers/net/mlx5/mlx5_prm.h
index 8c42380..602a5ac 100644
--- a/drivers/net/mlx5/mlx5_prm.h
+++ b/drivers/net/mlx5/mlx5_prm.h
@@ -378,7 +378,6 @@ struct mlx5_modification_cmd {
 #define __mlx5_mask16(typ, fld) ((u16)((1ull << __mlx5_bit_sz(typ, fld)) - 1))
 #define MLX5_ST_SZ_BYTES(typ) (sizeof(struct mlx5_ifc_##typ##_bits) / 8)
 #define MLX5_ST_SZ_DW(typ) (sizeof(struct mlx5_ifc_##typ##_bits) / 32)
-#define MLX5_ST_SZ_DB(typ) (sizeof(struct mlx5_ifc_##typ##_bits) / 8)
 #define MLX5_BYTE_OFF(typ, fld) (__mlx5_bit_off(typ, fld) / 8)
 #define MLX5_ADDR_OF(typ, p, fld) ((char *)(p) + MLX5_BYTE_OFF(typ, fld))
 
-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [dpdk-dev] [PATCH] net/mlx5: remove redundant size calculation macro
  2019-05-15 10:11 [dpdk-dev] [PATCH] net/mlx5: remove redundant size calculation macro Dekel Peled
  2019-05-15 10:11 ` Dekel Peled
@ 2019-05-26 19:23 ` Shahaf Shuler
  1 sibling, 0 replies; 3+ messages in thread
From: Shahaf Shuler @ 2019-05-26 19:23 UTC (permalink / raw)
  To: Shahaf Shuler, Yongseok Koh; +Cc: dev, Ori Kam, Dekel Peled

From: Dekel Peled <dekelp@mellanox.com>

>Patch [1] added, among other definitions, the macro MLX5_ST_SZ_DB.
>Patch [2] added later the macro MLX5_ST_SZ_BYTES, which is exactly
>the same macro with a different name.
>Each of these macros was used in very few places.
>
>This patch removes the definition of MLX5_ST_SZ_DB, and replaces it
>with MLX5_ST_SZ_BYTES wherever it was used.
>Macro MLX5_ST_SZ_BYTES was preffered since it is the same macro
>name used in kernel code, see [3].
>
>[1] http://patches.dpdk.org/patch/45254/
>[2] http://patches.dpdk.org/patch/49403/
>[3] https://lists.openwall.net/netdev/2014/10/02/75
>
>Signed-off-by: Dekel Peled <dekelp@mellanox.com>

Applied to next-net-mlx, thanks.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-05-26 19:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-15 10:11 [dpdk-dev] [PATCH] net/mlx5: remove redundant size calculation macro Dekel Peled
2019-05-15 10:11 ` Dekel Peled
2019-05-26 19:23 ` Shahaf Shuler

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