Skip to contentSkip to conversation

Mellanox, mlx5 build cleanup 2019-09-10

GIT PULL New Saeed Mahameed 2 participants 5 messages Sep 10, 2019 – Sep 11, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

Hi Dave,

This series provides three build warnings cleanup patches for mlx5, Originally i wanted to wait a bit more and attach more patches to this series, but apparently this can't wait since already 3 different patches for the same fix were submitted this week :).

For more information please see tag log below.

Please pull and let me know if there is any problem.

Thanks,
Saeed.

---
The following changes since commit 074be7fd99a29ff36dcb2c036b3b31a6b670b3cf:

Merge branch 'nfp-implement-firmware-loading-policy' (2019-09-10 17:29:27 +0100)

are available in the Git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux.git tags/mlx5-updates-2019-09-10

for you to fetch changes up to fa355bb1b0373e7fe087cfc830b1b0b9b6130388:

net/mlx5: FWTrace, Reduce stack usage (2019-09-10 13:43:27 -0700)

----------------------------------------------------------------
mlx5-updates-2019-09-10

Misc build warnings cleanup for mlx5:

1) Reduce stack usage in FW trace
2) Fix addr's type in mlx5dr_icm_dm
3) Fix rt's type in dr_action_create_reformat_action

----------------------------------------------------------------
Nathan Chancellor (2):
net/mlx5: Fix rt's type in dr_action_create_reformat_action net/mlx5: Fix addr's type in mlx5dr_icm_dm

Saeed Mahameed (1):
net/mlx5: FWTrace, Reduce stack usage

 drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c       | 7 ++++---
 drivers/net/ethernet/mellanox/mlx5/core/steering/dr_action.c   | 2 +-
 drivers/net/ethernet/mellanox/mlx5/core/steering/dr_icm_pool.c | 2 +-
 3 files changed, 6 insertions(+), 5 deletions(-)
#1 lore raw

PATCH 1/3 net/mlx5: Fix rt's type in dr_action_create_reformat_action

From: Nathan Chancellor <[email protected]>

clang warns:

drivers/net/ethernet/mellanox/mlx5/core/steering/dr_action.c:1080:9:
warning: implicit conversion from enumeration type 'enum mlx5_reformat_ctx_type' to different enumeration type 'enum mlx5dr_action_type' [-Wenum-conversion]

                        rt = MLX5_REFORMAT_TYPE_L2_TO_L2_TUNNEL;
                           ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

drivers/net/ethernet/mellanox/mlx5/core/steering/dr_action.c:1082:9:
warning: implicit conversion from enumeration type 'enum mlx5_reformat_ctx_type' to different enumeration type 'enum mlx5dr_action_type' [-Wenum-conversion]

                        rt = MLX5_REFORMAT_TYPE_L2_TO_L3_TUNNEL;
                           ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

drivers/net/ethernet/mellanox/mlx5/core/steering/dr_action.c:1084:51:
warning: implicit conversion from enumeration type 'enum mlx5dr_action_type' to different enumeration type 'enum mlx5_reformat_ctx_type' [-Wenum-conversion]

                ret = mlx5dr_cmd_create_reformat_ctx(dmn->mdev, rt, data_sz, data,
                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~            ^~

3 warnings generated.

Use the right type for rt, which is mlx5_reformat_ctx_type so there are no warnings about mismatched types.

Fixes 9db810ed2d37 ("net/mlx5: DR, Expose steering action functionality")
---
 drivers/net/ethernet/mellanox/mlx5/core/steering/dr_action.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/mellanox/mlx5/core/steering/dr_action.c +1 -1
index a02f87f85c17..7d81a7735de5 100644
@@ -1074,7 +1074,7 @@ dr_action_create_reformat_action(struct mlx5dr_domain *dmn,
 	case DR_ACTION_TYP_L2_TO_TNL_L2:
 	case DR_ACTION_TYP_L2_TO_TNL_L3:
 	{
-		enum mlx5dr_action_type rt;
+		enum mlx5_reformat_ctx_type rt;
 
 		if (action->action_type == DR_ACTION_TYP_L2_TO_TNL_L2)
 			rt = MLX5_REFORMAT_TYPE_L2_TO_L2_TUNNEL;
Signature · 1 line
2.21.0
#2 lore raw

PATCH 2/3 net/mlx5: Fix addr's type in mlx5dr_icm_dm

In reply to Saeed Mahameed

From: Nathan Chancellor <[email protected]>

clang errors when CONFIG_PHYS_ADDR_T_64BIT is not set:

drivers/net/ethernet/mellanox/mlx5/core/steering/dr_icm_pool.c:121:8:
error: incompatible pointer types passing 'u64 *' (aka 'unsigned long long *') to parameter of type 'phys_addr_t *' (aka 'unsigned int *') [-Werror,-Wincompatible-pointer-types]

                                   &icm_mr->dm.addr, &icm_mr->dm.obj_id);
                                   ^~~~~~~~~~~~~~~~
include/linux/mlx5/driver.h:1092:39: note: passing argument to parameter
'addr' here
                         u64 length, u16 uid, phys_addr_t *addr, u32 *obj_id);
                                                           ^

1 error generated.

Use phys_addr_t for addr's type in mlx5dr_icm_dm, which won't change anything with 64-bit builds because phys_addr_t is u64 when CONFIG_PHYS_ADDR_T_64BIT is set, which is always when CONFIG_64BIT is set.

Fixes 29cf8febd185 ("net/mlx5: DR, ICM pool memory allocator")
---
 drivers/net/ethernet/mellanox/mlx5/core/steering/dr_icm_pool.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/mellanox/mlx5/core/steering/dr_icm_pool.c +1 -1
index e76f61e7555e..913f1e5aaaf2 100644
@@ -53,7 +53,7 @@ struct mlx5dr_icm_pool {
 struct mlx5dr_icm_dm {
 	u32 obj_id;
 	enum mlx5_sw_icm_type type;
-	u64 addr;
+	phys_addr_t addr;
 	size_t length;
 };
 
Signature · 1 line
2.21.0
#3 lore raw

PATCH 3/3 net/mlx5: FWTrace, Reduce stack usage

In reply to Saeed Mahameed

Mark mlx5_tracer_print_trace as noinline as the function only uses 512 bytes on the stack to avoid the following build warning:

drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c:660:13: error: stack frame size of 1032 bytes in function 'mlx5_fw_tracer_handle_traces' [-Werror,-Wframe-larger-than=]

Fixes 70dd6fdb8987 ("net/mlx5: FW tracer, parse traces and kernel tracing support")
---
 drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c +4 -3
index 2011eaf15cc5..94d7b69a95c7 100644
@@ -553,9 +553,10 @@ static void mlx5_fw_tracer_save_trace(struct mlx5_fw_tracer *tracer,
 	mutex_unlock(&tracer->st_arr.lock);
 }
 
-static void mlx5_tracer_print_trace(struct tracer_string_format *str_frmt,
-				    struct mlx5_core_dev *dev,
-				    u64 trace_timestamp)
+static noinline
+void mlx5_tracer_print_trace(struct tracer_string_format *str_frmt,
+			     struct mlx5_core_dev *dev,
+			     u64 trace_timestamp)
 {
 	char	tmp[512];
 
Signature · 1 line
2.21.0
maintainer
#4 lore raw
In reply to Saeed Mahameed

From: Saeed Mahameed <[email protected]>
Date: Tue, 10 Sep 2019 21:45:57 +0000

Quoted 8 lines

This series provides three build warnings cleanup patches for mlx5, Originally i wanted to wait a bit more and attach more patches to this series, but apparently this can't wait since already 3 different patches for the same fix were submitted this week :).

For more information please see tag log below.

Please pull and let me know if there is any problem.

Pulled, thanks.