net/mlx5: Fix crdump chunks print
authorMoshe Shemesh <moshe@mellanox.com>
Sun, 14 Jul 2019 11:06:40 +0000 (14:06 +0300)
committerSaeed Mahameed <saeedm@mellanox.com>
Thu, 22 Aug 2019 20:38:47 +0000 (13:38 -0700)
Crdump repeats itself every chunk of 256bytes.
That is due to bug of missing progressing offset while copying the data
from buffer to devlink_fmsg.

Fixes: 9b1f29823605 ("net/mlx5: Add support for FW fatal reporter dump")
Signed-off-by: Moshe Shemesh <moshe@mellanox.com>
Reviewed-by: Eran Ben Elisha <eranbe@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/health.c

index 9314777d99e3f1e542e9cb5d4aa6960ac3849a10..cc5887f52679e16b02fd7a36002fab551acb359a 100644 (file)
@@ -590,7 +590,8 @@ mlx5_fw_fatal_reporter_dump(struct devlink_health_reporter *reporter,
                        data_size = crdump_size - offset;
                else
                        data_size = MLX5_CR_DUMP_CHUNK_SIZE;
-               err = devlink_fmsg_binary_put(fmsg, cr_data, data_size);
+               err = devlink_fmsg_binary_put(fmsg, (char *)cr_data + offset,
+                                             data_size);
                if (err)
                        goto free_data;
        }