Blame SOURCES/0099-netdrv-net-mlx5-Dump-of-fw_fatal-use-updated-devlink.patch

d8f823
From c3c632a540ceec478b466227dd94d1ff5be82e26 Mon Sep 17 00:00:00 2001
d8f823
From: Alaa Hleihel <ahleihel@redhat.com>
d8f823
Date: Sun, 10 May 2020 15:04:19 -0400
d8f823
Subject: [PATCH 099/312] [netdrv] net/mlx5: Dump of fw_fatal use updated
d8f823
 devlink binary interface
d8f823
d8f823
Message-id: <20200510150452.10307-55-ahleihel@redhat.com>
d8f823
Patchwork-id: 306679
d8f823
Patchwork-instance: patchwork
d8f823
O-Subject: [RHEL8.3 BZ 1789380 v2 54/87] net/mlx5: Dump of fw_fatal use updated devlink binary interface
d8f823
Bugzilla: 1789380
d8f823
RH-Acked-by: Kamal Heib <kheib@redhat.com>
d8f823
RH-Acked-by: Jarod Wilson <jarod@redhat.com>
d8f823
RH-Acked-by: Tony Camuso <tcamuso@redhat.com>
d8f823
RH-Acked-by: Jonathan Toppins <jtoppins@redhat.com>
d8f823
d8f823
Bugzilla: http://bugzilla.redhat.com/1789380
d8f823
Upstream: v5.5-rc1
d8f823
d8f823
commit d4e82cf4df300368e8d271a2caf14611a5e176a6
d8f823
Author: Aya Levin <ayal@mellanox.com>
d8f823
Date:   Tue Nov 12 14:07:50 2019 +0200
d8f823
d8f823
    net/mlx5: Dump of fw_fatal use updated devlink binary interface
d8f823
d8f823
    Remove redundant code from fw_fatal reporter's dump callback. Use
d8f823
    updated devlink interface of binary fmsg pair which breaks the output
d8f823
    into chunks internally.
d8f823
d8f823
    Signed-off-by: Aya Levin <ayal@mellanox.com>
d8f823
    Acked-by: Jiri Pirko <jiri@mellanox.com>
d8f823
    Acked-by: Saeed Mahameed <saeedm@mellanox.com>
d8f823
    Signed-off-by: David S. Miller <davem@davemloft.net>
d8f823
d8f823
Signed-off-by: Alaa Hleihel <ahleihel@redhat.com>
d8f823
Signed-off-by: Frantisek Hrbata <fhrbata@redhat.com>
d8f823
---
d8f823
 drivers/net/ethernet/mellanox/mlx5/core/health.c | 18 +-----------------
d8f823
 1 file changed, 1 insertion(+), 17 deletions(-)
d8f823
d8f823
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/health.c b/drivers/net/ethernet/mellanox/mlx5/core/health.c
d8f823
index c07f3154437c..d6b0a4ef9daf 100644
d8f823
--- a/drivers/net/ethernet/mellanox/mlx5/core/health.c
d8f823
+++ b/drivers/net/ethernet/mellanox/mlx5/core/health.c
d8f823
@@ -552,7 +552,6 @@ mlx5_fw_fatal_reporter_recover(struct devlink_health_reporter *reporter,
d8f823
 	return mlx5_health_try_recover(dev);
d8f823
 }
d8f823
 
d8f823
-#define MLX5_CR_DUMP_CHUNK_SIZE 256
d8f823
 static int
d8f823
 mlx5_fw_fatal_reporter_dump(struct devlink_health_reporter *reporter,
d8f823
 			    struct devlink_fmsg *fmsg, void *priv_ctx)
d8f823
@@ -560,8 +559,6 @@ mlx5_fw_fatal_reporter_dump(struct devlink_health_reporter *reporter,
d8f823
 	struct mlx5_core_dev *dev = devlink_health_reporter_priv(reporter);
d8f823
 	u32 crdump_size = dev->priv.health.crdump_size;
d8f823
 	u32 *cr_data;
d8f823
-	u32 data_size;
d8f823
-	u32 offset;
d8f823
 	int err;
d8f823
 
d8f823
 	if (!mlx5_core_is_pf(dev))
d8f823
@@ -582,20 +579,7 @@ mlx5_fw_fatal_reporter_dump(struct devlink_health_reporter *reporter,
d8f823
 			goto free_data;
d8f823
 	}
d8f823
 
d8f823
-	err = devlink_fmsg_arr_pair_nest_start(fmsg, "crdump_data");
d8f823
-	if (err)
d8f823
-		goto free_data;
d8f823
-	for (offset = 0; offset < crdump_size; offset += data_size) {
d8f823
-		if (crdump_size - offset < MLX5_CR_DUMP_CHUNK_SIZE)
d8f823
-			data_size = crdump_size - offset;
d8f823
-		else
d8f823
-			data_size = MLX5_CR_DUMP_CHUNK_SIZE;
d8f823
-		err = devlink_fmsg_binary_put(fmsg, (char *)cr_data + offset,
d8f823
-					      data_size);
d8f823
-		if (err)
d8f823
-			goto free_data;
d8f823
-	}
d8f823
-	err = devlink_fmsg_arr_pair_nest_end(fmsg);
d8f823
+	err = devlink_fmsg_binary_pair_put(fmsg, "crdump_data", cr_data, crdump_size);
d8f823
 
d8f823
 free_data:
d8f823
 	kvfree(cr_data);
d8f823
-- 
d8f823
2.13.6
d8f823