[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200130225913.1671982-19-jacob.e.keller@intel.com>
Date: Thu, 30 Jan 2020 14:59:13 -0800
From: Jacob Keller <jacob.e.keller@...el.com>
To: netdev@...r.kernel.org
Cc: jiri@...nulli.us, valex@...lanox.com, linyunsheng@...wei.com,
lihong.yang@...el.com, Jacob Keller <jacob.e.keller@...el.com>
Subject: [RFC PATCH 3/3] devlink: stop requiring snapshot for regions
The region dump and region read commands currently require the snapshot
to work. Recent changes to the kernel have enabled optionally
supporting direct read of a region's contents without a snapshot id.
Enable this by allowing the read and dump commands to execute without
a snapshot id. On older kernels, this will return -EINVAL as the kernel
will reject such a command. On newer kernels, this will directly read
the region contents without taking a snapshot. If a region does not
support direct read, it will return -EOPNOTSUPP.
Signed-off-by: Jacob Keller <jacob.e.keller@...el.com>
---
devlink/devlink.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/devlink/devlink.c b/devlink/devlink.c
index ac1ad8aa0769..9f9e8ea09bf5 100644
--- a/devlink/devlink.c
+++ b/devlink/devlink.c
@@ -6311,8 +6311,8 @@ static int cmd_region_dump(struct dl *dl)
nlh = mnlg_msg_prepare(dl->nlg, DEVLINK_CMD_REGION_READ,
NLM_F_REQUEST | NLM_F_ACK | NLM_F_DUMP);
- err = dl_argv_parse_put(nlh, dl, DL_OPT_HANDLE_REGION |
- DL_OPT_REGION_SNAPSHOT_ID, 0);
+ err = dl_argv_parse_put(nlh, dl, DL_OPT_HANDLE_REGION,
+ DL_OPT_REGION_SNAPSHOT_ID);
if (err)
return err;
@@ -6333,8 +6333,8 @@ static int cmd_region_read(struct dl *dl)
NLM_F_REQUEST | NLM_F_ACK | NLM_F_DUMP);
err = dl_argv_parse_put(nlh, dl, DL_OPT_HANDLE_REGION |
- DL_OPT_REGION_ADDRESS | DL_OPT_REGION_LENGTH |
- DL_OPT_REGION_SNAPSHOT_ID, 0);
+ DL_OPT_REGION_ADDRESS | DL_OPT_REGION_LENGTH,
+ DL_OPT_REGION_SNAPSHOT_ID);
if (err)
return err;
--
2.25.0.rc1
Powered by blists - more mailing lists