netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Keller, Jacob E" <jacob.e.keller@intel.com>
To: Jiri Pirko <jiri@resnulli.us>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	Jakub Kicinski <kuba@kernel.org>
Subject: RE: [iproute2] devlink: add support for DEVLINK_CMD_REGION_NEW
Date: Tue, 28 Apr 2020 17:17:17 +0000	[thread overview]
Message-ID: <02874ECE860811409154E81DA85FBB58B6CF63CB@FMSMSX102.amr.corp.intel.com> (raw)
In-Reply-To: <20200428054321.GZ6581@nanopsycho.orion>



> -----Original Message-----
> From: netdev-owner@vger.kernel.org <netdev-owner@vger.kernel.org> On
> Behalf Of Jiri Pirko
> Sent: Monday, April 27, 2020 10:43 PM
> To: Keller, Jacob E <jacob.e.keller@intel.com>
> Cc: netdev@vger.kernel.org; Jakub Kicinski <kuba@kernel.org>
> Subject: Re: [iproute2] devlink: add support for DEVLINK_CMD_REGION_NEW
> 
> Tue, Apr 28, 2020 at 04:05:12AM CEST, jacob.e.keller@intel.com wrote:
> >Add support to request that a new snapshot be taken immediately for
> >a devlink region. To avoid confusion, the desired snapshot id must be
> >provided.
> >
> >Note that if a region does not support snapshots on demand, the kernel
> >will reject the request with -EOPNOTSUP.
> >
> >Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
> >---
> > devlink/devlink.c | 20 ++++++++++++++++++++
> > 1 file changed, 20 insertions(+)
> >
> >diff --git a/devlink/devlink.c b/devlink/devlink.c
> >index 67e6e64181f9..c750ee1ec6d3 100644
> >--- a/devlink/devlink.c
> >+++ b/devlink/devlink.c
> >@@ -6362,10 +6362,27 @@ static int cmd_region_read(struct dl *dl)
> > 	return err;
> > }
> >
> >+static int cmd_region_snapshot_new(struct dl *dl)
> >+{
> >+	struct nlmsghdr *nlh;
> >+	int err;
> >+
> >+	nlh = mnlg_msg_prepare(dl->nlg, DEVLINK_CMD_REGION_NEW,
> >+			NLM_F_REQUEST | NLM_F_ACK);
> >+
> >+	err = dl_argv_parse_put(nlh, dl, DL_OPT_HANDLE_REGION |
> >+				DL_OPT_REGION_SNAPSHOT_ID, 0);
> >+	if (err)
> >+		return err;
> >+
> >+	return _mnlg_socket_sndrcv(dl->nlg, nlh, NULL, NULL);
> >+}
> >+
> > static void cmd_region_help(void)
> > {
> > 	pr_err("Usage: devlink region show [ DEV/REGION ]\n");
> > 	pr_err("       devlink region del DEV/REGION snapshot SNAPSHOT_ID\n");
> >+	pr_err("       devlink region new DEV/REGION [snapshot
> SNAPSHOT_ID]\n");
> 
> Same as for "del", snapshot id is mandatory. You should not have it in "[]".
> 

Ah, right!

> 
> > 	pr_err("       devlink region dump DEV/REGION [ snapshot SNAPSHOT_ID
> ]\n");
> > 	pr_err("       devlink region read DEV/REGION [ snapshot SNAPSHOT_ID ]
> address ADDRESS length LENGTH\n");
> > }
> >@@ -6389,6 +6406,9 @@ static int cmd_region(struct dl *dl)
> > 	} else if (dl_argv_match(dl, "read")) {
> > 		dl_arg_inc(dl);
> > 		return cmd_region_read(dl);
> >+	} else if (dl_argv_match(dl, "new")) {
> >+		dl_arg_inc(dl);
> >+		return cmd_region_snapshot_new(dl);
> > 	}
> > 	pr_err("Command \"%s\" not found\n", dl_argv(dl));
> > 	return -ENOENT;
> >--
> >2.25.2
> >

      reply	other threads:[~2020-04-28 17:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-28  2:05 [iproute2] devlink: add support for DEVLINK_CMD_REGION_NEW Jacob Keller
2020-04-28  5:43 ` Jiri Pirko
2020-04-28 17:17   ` Keller, Jacob E [this message]

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=02874ECE860811409154E81DA85FBB58B6CF63CB@FMSMSX102.amr.corp.intel.com \
    --to=jacob.e.keller@intel.com \
    --cc=jiri@resnulli.us \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).