Netdev Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Igor Russkikh <irusskikh@marvell.com>
To: <netdev@vger.kernel.org>
Cc: "David S . Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
Ariel Elior <aelior@marvell.com>,
Michal Kalderon <mkalderon@marvell.com>,
Igor Russkikh <irusskikh@marvell.com>,
"Alexander Lobakin" <alobakin@marvell.com>,
Michal Kalderon <michal.kalderon@marvell.com>
Subject: [PATCH v6 net-next 08/10] qed: implement devlink dump
Date: Thu, 20 Aug 2020 21:52:02 +0300 [thread overview]
Message-ID: <20200820185204.652-9-irusskikh@marvell.com> (raw)
In-Reply-To: <20200820185204.652-1-irusskikh@marvell.com>
Gather and push out full device dump to devlink.
Device dump is the same as with `ethtool -d`, but now its generated
exactly at the moment bad thing happens.
Signed-off-by: Igor Russkikh <irusskikh@marvell.com>
Signed-off-by: Alexander Lobakin <alobakin@marvell.com>
Signed-off-by: Michal Kalderon <michal.kalderon@marvell.com>
---
drivers/net/ethernet/qlogic/qed/qed_devlink.c | 43 +++++++++++++++++++
1 file changed, 43 insertions(+)
diff --git a/drivers/net/ethernet/qlogic/qed/qed_devlink.c b/drivers/net/ethernet/qlogic/qed/qed_devlink.c
index bc4e40f135ff..cf7f4da68e69 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_devlink.c
+++ b/drivers/net/ethernet/qlogic/qed/qed_devlink.c
@@ -6,6 +6,7 @@
#include <linux/kernel.h>
#include <linux/qed/qed_if.h>
+#include <linux/vmalloc.h>
#include "qed.h"
#include "qed_devlink.h"
@@ -32,6 +33,47 @@ int qed_report_fatal_error(struct devlink *devlink, enum qed_hw_err_type err_typ
return 0;
}
+static int
+qed_fw_fatal_reporter_dump(struct devlink_health_reporter *reporter,
+ struct devlink_fmsg *fmsg, void *priv_ctx,
+ struct netlink_ext_ack *extack)
+{
+ struct qed_devlink *qdl = devlink_health_reporter_priv(reporter);
+ struct qed_fw_fatal_ctx *fw_fatal_ctx = priv_ctx;
+ struct qed_dev *cdev = qdl->cdev;
+ u32 dbg_data_buf_size;
+ u8 *p_dbg_data_buf;
+ int err;
+
+ /* Having context means that was a dump request after fatal,
+ * so we enable extra debugging while gathering the dump,
+ * just in case
+ */
+ cdev->print_dbg_data = fw_fatal_ctx ? true : false;
+
+ dbg_data_buf_size = qed_dbg_all_data_size(cdev);
+ p_dbg_data_buf = vzalloc(dbg_data_buf_size);
+ if (!p_dbg_data_buf) {
+ DP_NOTICE(cdev,
+ "Failed to allocate memory for a debug data buffer\n");
+ return -ENOMEM;
+ }
+
+ err = qed_dbg_all_data(cdev, p_dbg_data_buf);
+ if (err) {
+ DP_NOTICE(cdev, "Failed to obtain debug data\n");
+ vfree(p_dbg_data_buf);
+ return err;
+ }
+
+ err = devlink_fmsg_binary_pair_put(fmsg, "dump_data",
+ p_dbg_data_buf, dbg_data_buf_size);
+
+ vfree(p_dbg_data_buf);
+
+ return err;
+}
+
static int
qed_fw_fatal_reporter_recover(struct devlink_health_reporter *reporter,
void *priv_ctx,
@@ -48,6 +90,7 @@ qed_fw_fatal_reporter_recover(struct devlink_health_reporter *reporter,
static const struct devlink_health_reporter_ops qed_fw_fatal_reporter_ops = {
.name = "fw_fatal",
.recover = qed_fw_fatal_reporter_recover,
+ .dump = qed_fw_fatal_reporter_dump,
};
#define QED_REPORTER_FW_GRACEFUL_PERIOD 1200000
--
2.17.1
next prev parent reply other threads:[~2020-08-20 18:53 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-20 18:51 [PATCH v6 net-next 00/10] qed: introduce devlink health support Igor Russkikh
2020-08-20 18:51 ` [PATCH v6 net-next 01/10] qed: move out devlink logic into a new file Igor Russkikh
2020-08-21 17:56 ` Jesse Brandeburg
2020-08-20 18:51 ` [PATCH v6 net-next 02/10] qed/qede: make devlink survive recovery Igor Russkikh
2020-08-21 18:18 ` Jesse Brandeburg
2020-08-20 18:51 ` [PATCH v6 net-next 03/10] qed: fix kconfig help entries Igor Russkikh
2020-08-20 18:51 ` [PATCH v6 net-next 04/10] qed: implement devlink info request Igor Russkikh
2020-08-21 17:32 ` Jakub Kicinski
2020-08-23 10:57 ` [EXT] " Igor Russkikh
2020-08-20 18:51 ` [PATCH v6 net-next 05/10] qed: health reporter init deinit seq Igor Russkikh
2020-08-21 17:34 ` Jakub Kicinski
2020-08-20 18:52 ` [PATCH v6 net-next 06/10] qed: use devlink logic to report errors Igor Russkikh
2020-08-21 17:34 ` Jakub Kicinski
2020-08-20 18:52 ` [PATCH v6 net-next 07/10] qed*: make use of devlink recovery infrastructure Igor Russkikh
2020-08-21 17:35 ` Jakub Kicinski
2020-08-20 18:52 ` Igor Russkikh [this message]
2020-08-20 18:52 ` [PATCH v6 net-next 09/10] qed: align adjacent indent Igor Russkikh
2020-08-21 19:40 ` Jesse Brandeburg
2020-08-20 18:52 ` [PATCH v6 net-next 10/10] qede: make driver reliable on unload after failures Igor Russkikh
2020-08-21 19:54 ` [PATCH v6 net-next 00/10] qed: introduce devlink health support Jesse Brandeburg
2020-08-21 20:37 ` [EXT] " Igor Russkikh
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200820185204.652-9-irusskikh@marvell.com \
--to=irusskikh@marvell.com \
--cc=aelior@marvell.com \
--cc=alobakin@marvell.com \
--cc=davem@davemloft.net \
--cc=kuba@kernel.org \
--cc=michal.kalderon@marvell.com \
--cc=mkalderon@marvell.com \
--cc=netdev@vger.kernel.org \
--subject='Re: [PATCH v6 net-next 08/10] qed: implement devlink dump' \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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).