All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dmytro Semenets <dmitry.semenets@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
	Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>
Subject: [RFC PATCH v3 05/10] tools/light: pci: describe [MAKE|REVERT]_ASSIGNABLE commands
Date: Sun, 15 Jan 2023 13:31:06 +0200	[thread overview]
Message-ID: <20230115113111.1207605-6-dmitry.semenets@gmail.com> (raw)
In-Reply-To: <20230115113111.1207605-1-dmitry.semenets@gmail.com>

From: Volodymyr Babchuk <volodymyr_babchuk@epam.com>

Add protocol for two more commands, one to make a PCI device
assignable, and other - to revert its state back.

Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
---
 tools/include/pcid.h | 38 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 38 insertions(+)

diff --git a/tools/include/pcid.h b/tools/include/pcid.h
index 452bdc11cf..118f8105cf 100644
--- a/tools/include/pcid.h
+++ b/tools/include/pcid.h
@@ -98,6 +98,44 @@
 #define PCID_CMD_LIST_ASSIGNABLE        "list_assignable"
 #define PCID_MSG_FIELD_DEVICES          "devices"
 
+/*
+ *******************************************************************************
+ * Make device assignable
+ *
+ * This command makes given device assignable by ensuring that OS
+ * will not try to access it.
+ *
+ * Request (see other mandatory fields above):
+ *  - "cmd" field of the request must be set to "make_assignable".
+ *  - "sbdf" SBDF of the device in format defined by PCID_SBDF_FMT.
+ *  - "rebind" = true if daemon needs to save original driver name,
+ *    so device later can be rebound back.
+ *
+ * Response (see other mandatory fields above):
+ *  - "resp" field of the response must be set to "make_assignable".
+ */
+#define PCID_CMD_MAKE_ASSIGNABLE        "make_assignable"
+#define PCID_MSG_FIELD_REBIND           "rebind"
+
+/*
+ *******************************************************************************
+ * Revert device from assignable state
+ *
+ * This command reverts effect of "make_assignable" command. Basically,
+ * now device can be used by OS again.
+ *
+ * Request (see other mandatory fields above):
+ *  - "cmd" field of the request must be set to "revert_assignable".
+ *  - "sbdf" SBDF of the device in format defined by PCID_SBDF_FMT.
+ *  - "rebind" = true if daemon needs to rebind device back to it's
+ *    original driver, which name was saved by "make_assignable" command
+ *
+ * Response (see other mandatory fields above):
+ *  - "resp" field of the response must be set to "revert_assignable".
+ */
+#define PCID_CMD_REVERT_ASSIGNABLE      "revert_assignable"
+
+
 int libxl_pcid_process(libxl_ctx *ctx);
 
 #endif /* PCID_H */
-- 
2.34.1



  parent reply	other threads:[~2023-01-15 11:31 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-15 11:31 [RFC PATCH v3 00/10] PCID server Dmytro Semenets
2023-01-15 11:31 ` [RFC PATCH v3 01/10] tools: allow vchan XenStore paths more then 64 bytes long Dmytro Semenets
2023-01-15 11:31 ` [RFC PATCH v3 02/10] tools/libs/light: Add vchan support to libxl Dmytro Semenets
2023-01-15 11:31 ` [RFC PATCH v3 03/10] tools/xl: Add pcid daemon to xl Dmytro Semenets
2023-01-31 16:34   ` Anthony PERARD
2023-01-15 11:31 ` [RFC PATCH v3 04/10] tools/libs/light: pcid: implement list_assignable command Dmytro Semenets
2023-01-15 11:31 ` Dmytro Semenets [this message]
2023-01-15 11:31 ` [RFC PATCH v3 06/10] tools/light: pci: move assign/revert logic to pcid Dmytro Semenets
2023-01-15 11:31 ` [RFC PATCH v3 07/10] tools/libs/light: pcid: implement is_device_assigned command Dmytro Semenets
2023-01-15 11:31 ` [RFC PATCH v3 08/10] tools/libs/light: pcid: implement reset_device command Dmytro Semenets
2023-01-15 11:31 ` [RFC PATCH v3 09/10] tools/libs/light: pcid: implement resource_list command Dmytro Semenets
2023-01-15 11:31 ` [RFC PATCH v3 10/10] tools/libs/light: pcid: implement write_bdf command Dmytro Semenets
2023-01-31 16:17 ` [RFC PATCH v3 00/10] PCID server Anthony PERARD

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=20230115113111.1207605-6-dmitry.semenets@gmail.com \
    --to=dmitry.semenets@gmail.com \
    --cc=anthony.perard@citrix.com \
    --cc=volodymyr_babchuk@epam.com \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.