Netdev Archive on lore.kernel.org
 help / color / Atom feed
* [pull request][net-next 0/3] Mellanox, mlx5 build cleanup 2019-09-10
@ 2019-09-10 21:45 Saeed Mahameed
  2019-09-10 21:45 ` [net-next 1/3] net/mlx5: Fix rt's type in dr_action_create_reformat_action Saeed Mahameed
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Saeed Mahameed @ 2019-09-10 21:45 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, Saeed Mahameed

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

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

* [net-next 1/3] net/mlx5: Fix rt's type in dr_action_create_reformat_action
  2019-09-10 21:45 [pull request][net-next 0/3] Mellanox, mlx5 build cleanup 2019-09-10 Saeed Mahameed
@ 2019-09-10 21:45 ` Saeed Mahameed
  2019-09-10 21:46 ` [net-next 2/3] net/mlx5: Fix addr's type in mlx5dr_icm_dm Saeed Mahameed
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Saeed Mahameed @ 2019-09-10 21:45 UTC (permalink / raw)
  To: David S. Miller
  Cc: netdev, Nathan Chancellor, Austin Kim, Arnd Bergmann, Saeed Mahameed

From: Nathan Chancellor <natechancellor@gmail.com>

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")
Link: https://github.com/ClangBuiltLinux/linux/issues/652
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Reported-by: Austin Kim <austindh.kim@gmail.com>
Reported-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/steering/dr_action.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_action.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_action.c
index a02f87f85c17..7d81a7735de5 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_action.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_action.c
@@ -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;
-- 
2.21.0


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

* [net-next 2/3] net/mlx5: Fix addr's type in mlx5dr_icm_dm
  2019-09-10 21:45 [pull request][net-next 0/3] Mellanox, mlx5 build cleanup 2019-09-10 Saeed Mahameed
  2019-09-10 21:45 ` [net-next 1/3] net/mlx5: Fix rt's type in dr_action_create_reformat_action Saeed Mahameed
@ 2019-09-10 21:46 ` Saeed Mahameed
  2019-09-10 21:46 ` [net-next 3/3] net/mlx5: FWTrace, Reduce stack usage Saeed Mahameed
  2019-09-11  8:27 ` [pull request][net-next 0/3] Mellanox, mlx5 build cleanup 2019-09-10 David Miller
  3 siblings, 0 replies; 5+ messages in thread
From: Saeed Mahameed @ 2019-09-10 21:46 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, Nathan Chancellor, Arnd Bergmann, Saeed Mahameed

From: Nathan Chancellor <natechancellor@gmail.com>

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")
Link: https://github.com/ClangBuiltLinux/linux/issues/653
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Reported-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/steering/dr_icm_pool.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_icm_pool.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_icm_pool.c
index e76f61e7555e..913f1e5aaaf2 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_icm_pool.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_icm_pool.c
@@ -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;
 };
 
-- 
2.21.0


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

* [net-next 3/3] net/mlx5: FWTrace, Reduce stack usage
  2019-09-10 21:45 [pull request][net-next 0/3] Mellanox, mlx5 build cleanup 2019-09-10 Saeed Mahameed
  2019-09-10 21:45 ` [net-next 1/3] net/mlx5: Fix rt's type in dr_action_create_reformat_action Saeed Mahameed
  2019-09-10 21:46 ` [net-next 2/3] net/mlx5: Fix addr's type in mlx5dr_icm_dm Saeed Mahameed
@ 2019-09-10 21:46 ` Saeed Mahameed
  2019-09-11  8:27 ` [pull request][net-next 0/3] Mellanox, mlx5 build cleanup 2019-09-10 David Miller
  3 siblings, 0 replies; 5+ messages in thread
From: Saeed Mahameed @ 2019-09-10 21:46 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, Saeed Mahameed, Arnd Bergmann

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")
Reported-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c b/drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c
index 2011eaf15cc5..94d7b69a95c7 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c
@@ -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];
 
-- 
2.21.0


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

* Re: [pull request][net-next 0/3] Mellanox, mlx5 build cleanup 2019-09-10
  2019-09-10 21:45 [pull request][net-next 0/3] Mellanox, mlx5 build cleanup 2019-09-10 Saeed Mahameed
                   ` (2 preceding siblings ...)
  2019-09-10 21:46 ` [net-next 3/3] net/mlx5: FWTrace, Reduce stack usage Saeed Mahameed
@ 2019-09-11  8:27 ` David Miller
  3 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2019-09-11  8:27 UTC (permalink / raw)
  To: saeedm; +Cc: netdev

From: Saeed Mahameed <saeedm@mellanox.com>
Date: Tue, 10 Sep 2019 21:45:57 +0000

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

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

end of thread, back to index

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-10 21:45 [pull request][net-next 0/3] Mellanox, mlx5 build cleanup 2019-09-10 Saeed Mahameed
2019-09-10 21:45 ` [net-next 1/3] net/mlx5: Fix rt's type in dr_action_create_reformat_action Saeed Mahameed
2019-09-10 21:46 ` [net-next 2/3] net/mlx5: Fix addr's type in mlx5dr_icm_dm Saeed Mahameed
2019-09-10 21:46 ` [net-next 3/3] net/mlx5: FWTrace, Reduce stack usage Saeed Mahameed
2019-09-11  8:27 ` [pull request][net-next 0/3] Mellanox, mlx5 build cleanup 2019-09-10 David Miller

Netdev Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/netdev/0 netdev/git/0.git
	git clone --mirror https://lore.kernel.org/netdev/1 netdev/git/1.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 netdev netdev/ https://lore.kernel.org/netdev \
		netdev@vger.kernel.org netdev@archiver.kernel.org
	public-inbox-index netdev


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.netdev


AGPL code for this site: git clone https://public-inbox.org/ public-inbox