65 lines
2.3 KiB
Diff
65 lines
2.3 KiB
Diff
From f12ee1269f04a5f4ab5c18326004af32da4061ae Mon Sep 17 00:00:00 2001
|
|
From: Aya Levin <ayal@mellanox.com>
|
|
Date: Wed, 10 Jul 2019 14:03:19 +0300
|
|
Subject: [PATCH] devlink: Change devlink health dump show command to dumpit
|
|
|
|
Although devlink health dump show command is given per reporter, it
|
|
returns large amounts of data. Trying to use the doit cb results in
|
|
OUT-OF-BUFFER error. This complementary patch raises the DUMP flag in
|
|
order to invoke the dumpit cb. We're safe as no existing drivers
|
|
implement the dump health reporter option yet.
|
|
|
|
Fixes: 041e6e651a8e ("devlink: Add devlink health dump show command")
|
|
Signed-off-by: Aya Levin <ayal@mellanox.com>
|
|
Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
|
|
Acked-by: Jiri Pirko <jiri@mellanox.com>
|
|
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
|
|
(cherry picked from commit b4d97ef57fd4b7669971ed209065a72d115dffc2)
|
|
Signed-off-by: Phil Sutter <psutter@redhat.com>
|
|
---
|
|
devlink/devlink.c | 12 ++++++++----
|
|
1 file changed, 8 insertions(+), 4 deletions(-)
|
|
|
|
diff --git a/devlink/devlink.c b/devlink/devlink.c
|
|
index 5618ba26d6fb3..9c338cb4ccc84 100644
|
|
--- a/devlink/devlink.c
|
|
+++ b/devlink/devlink.c
|
|
@@ -6072,13 +6072,13 @@ static int cmd_fmsg_object_cb(const struct nlmsghdr *nlh, void *data)
|
|
return MNL_CB_OK;
|
|
}
|
|
|
|
-static int cmd_health_object_common(struct dl *dl, uint8_t cmd)
|
|
+static int cmd_health_object_common(struct dl *dl, uint8_t cmd, uint16_t flags)
|
|
{
|
|
struct fmsg_cb_data data;
|
|
struct nlmsghdr *nlh;
|
|
int err;
|
|
|
|
- nlh = mnlg_msg_prepare(dl->nlg, cmd, NLM_F_REQUEST | NLM_F_ACK);
|
|
+ nlh = mnlg_msg_prepare(dl->nlg, cmd, flags | NLM_F_REQUEST | NLM_F_ACK);
|
|
|
|
err = dl_argv_parse_put(nlh, dl,
|
|
DL_OPT_HANDLE | DL_OPT_HEALTH_REPORTER_NAME, 0);
|
|
@@ -6093,12 +6093,16 @@ static int cmd_health_object_common(struct dl *dl, uint8_t cmd)
|
|
|
|
static int cmd_health_dump_show(struct dl *dl)
|
|
{
|
|
- return cmd_health_object_common(dl, DEVLINK_CMD_HEALTH_REPORTER_DUMP_GET);
|
|
+ return cmd_health_object_common(dl,
|
|
+ DEVLINK_CMD_HEALTH_REPORTER_DUMP_GET,
|
|
+ NLM_F_DUMP);
|
|
}
|
|
|
|
static int cmd_health_diagnose(struct dl *dl)
|
|
{
|
|
- return cmd_health_object_common(dl, DEVLINK_CMD_HEALTH_REPORTER_DIAGNOSE);
|
|
+ return cmd_health_object_common(dl,
|
|
+ DEVLINK_CMD_HEALTH_REPORTER_DIAGNOSE,
|
|
+ 0);
|
|
}
|
|
|
|
static int cmd_health_recover(struct dl *dl)
|
|
--
|
|
2.22.0
|
|
|