All of lore.kernel.org
 help / color / mirror / Atom feed
From: Max Gurtovoy <mgurtovoy@nvidia.com>
To: jasowang@redhat.com, virtio-comment@lists.oasis-open.org,
	mst@redhat.com, cohuck@redhat.com,
	virtio-dev@lists.oasis-open.org
Cc: oren@nvidia.com, parav@nvidia.com, shahafs@nvidia.com,
	aadam@redhat.com, virtio@lists.oasis-open.org,
	eperezma@redhat.com, Max Gurtovoy <mgurtovoy@nvidia.com>
Subject: [PATCH v6 2/5] Introduce admin command set
Date: Sun, 31 Jul 2022 18:43:51 +0300	[thread overview]
Message-ID: <20220731154354.15698-3-mgurtovoy@nvidia.com> (raw)
In-Reply-To: <20220731154354.15698-1-mgurtovoy@nvidia.com>

This command set is used for essential administrative and management
operations.

Admin commands should be submitted to a well defined management
interface.

Reviewed-by: Parav Pandit <parav@nvidia.com>
Signed-off-by: Max Gurtovoy <mgurtovoy@nvidia.com>
---
 admin.tex   | 82 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 content.tex |  2 ++
 2 files changed, 84 insertions(+)
 create mode 100644 admin.tex

diff --git a/admin.tex b/admin.tex
new file mode 100644
index 0000000..d14f8f7
--- /dev/null
+++ b/admin.tex
@@ -0,0 +1,82 @@
+\section{Administration command set}\label{sec:Basic Facilities of a Virtio Device / Administration command set}
+
+The Administration command set (also known as Admin command set) defines the commands that can be issued using a management interface.
+This mechanism, for example, can be used by a system administrator that wants to configure a device before it is initialized by its driver.
+
+All the Admin commands are of the following form:
+
+\begin{lstlisting}
+struct virtio_admin_cmd {
+        /* Device-readable part */
+        le16 command;
+        /*
+         * 0 - Self
+         * 1 - SR-IOV
+         * 2 - 65535 are reserved
+         */
+        le16 group_id;
+        le64 group_member_id;
+        /* reserved for common cmd fields */
+        u8 reserved[12];
+        u8 command_specific_data[];
+
+        /* Device-writable part */
+        u8 status;
+        u8 command_specific_error;
+        u8 command_specific_result[];
+};
+\end{lstlisting}
+
+The following table describes the generic Admin status codes:
+
+\begin{tabular}{|l|l|l|}
+\hline
+Opcode & Status & Description \\
+\hline \hline
+00h   & VIRTIO_ADMIN_STATUS_OK    & successful completion  \\
+\hline
+01h   & VIRTIO_ADMIN_STATUS_CS_ERR    & command specific error  \\
+\hline
+02h   & VIRTIO_ADMIN_STATUS_COMMAND_UNSUPPORTED    & unsupported or invalid opcode  \\
+\hline
+03h   & VIRTIO_ADMIN_STATUS_INVALID_FIELD    & invalid field was set  \\
+\hline
+04h   & VIRTIO_ADMIN_STATUS_INVALID_GROUP    & invalid group identifier was set  \\
+\hline
+05h   & VIRTIO_ADMIN_STATUS_INVALID_MEM    & invalid group member identifier was set  \\
+\hline
+\end{tabular}
+
+The \field{command}, \field{group_id}, \field{group_member_id} and \field{command_specific_data} are
+set by the driver, and the device sets the \field{status}, the
+\field{command_specific_error} and the \field{command_specific_result},
+if needed.
+
+Reserved common fields are ignored by the device and to be zeroed by the driver.
+
+The mandatory fields to be set by the driver, for all admin commands, are the \field{command}, \field{group_id} and \field{group_member_id}.
+
+The optional unused fields to be zeroed by the driver.
+
+The \field{command} defines the opcode for the command. The value for each command can be found in each command section.
+
+The \field{group_id} defines the designated device group for the command.
+The \field{group_member_id} defines the designated device within the device group for the command.
+See section \ref{sec:Introduction / Terminology / Device group} for group identifier and group member identifier numbering for various device groups.
+
+The \field{command_specific_error} should be inspected by the driver only if \field{status} is set to
+VIRTIO_ADMIN_STATUS_CS_ERR by the device. In this case, the content of \field{command_specific_error}
+holds the command specific error. If \field{status} is not set to VIRTIO_ADMIN_STATUS_CS_ERR, the
+\field{command_specific_error} value is undefined and should be ignored by the driver.
+
+The following table describes the Admin command set:
+
+\begin{tabular}{|l|l|}
+\hline
+Opcode & Command \\
+\hline \hline
+0000h - 7FFFh   & Generic admin cmds    \\
+\hline
+8000h - FFFFh   & Reserved    \\
+\hline
+\end{tabular}
diff --git a/content.tex b/content.tex
index 7508dd1..caab298 100644
--- a/content.tex
+++ b/content.tex
@@ -449,6 +449,8 @@ \section{Exporting Objects}\label{sec:Basic Facilities of a Virtio Device / Expo
 types. It is RECOMMENDED that devices generate version 4
 UUIDs as specified by \hyperref[intro:rfc4122]{[RFC4122]}.
 
+\input{admin.tex}
+
 \chapter{General Initialization And Device Operation}\label{sec:General Initialization And Device Operation}
 
 We start with an overview of device initialization, then expand on the
-- 
2.21.0


  parent reply	other threads:[~2022-07-31 15:43 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-31 15:43 [PATCH v6 0/5] Introduce device group and device management Max Gurtovoy
2022-07-31 15:43 ` [PATCH v6 1/5] Introduce device group Max Gurtovoy
2022-07-31 20:38   ` Michael S. Tsirkin
2022-07-31 20:42   ` Michael S. Tsirkin
2022-07-31 21:19   ` Michael S. Tsirkin
2022-08-02 13:41   ` Michael S. Tsirkin
2022-08-03  4:44     ` Jason Wang
2022-08-03  6:10       ` Michael S. Tsirkin
2022-08-03  8:04         ` Jason Wang
2022-08-03 12:33           ` Michael S. Tsirkin
2022-08-04  2:08             ` Jason Wang
2022-08-04  6:17               ` Michael S. Tsirkin
2022-08-04  7:17                 ` Jason Wang
2022-08-03  6:43       ` Michael S. Tsirkin
2022-08-03 23:45     ` [virtio-comment] " Max Gurtovoy
2022-08-04  6:20       ` Michael S. Tsirkin
2022-07-31 15:43 ` Max Gurtovoy [this message]
2022-07-31 20:59   ` [PATCH v6 2/5] Introduce admin command set Michael S. Tsirkin
2022-07-31 23:56     ` [virtio-comment] " Max Gurtovoy
2022-07-31 15:43 ` [virtio-comment] [PATCH v6 3/5] Introduce virtio admin virtqueue Max Gurtovoy
2022-07-31 21:00   ` Michael S. Tsirkin
2022-07-31 23:07     ` Max Gurtovoy
2022-08-01  6:03       ` Michael S. Tsirkin
2022-07-31 15:43 ` [PATCH v6 4/5] Add admin_queue_index register to PCI common configuration structure Max Gurtovoy
2022-07-31 21:03   ` Michael S. Tsirkin
2022-08-01  0:11     ` Max Gurtovoy
2022-08-01  6:13       ` Michael S. Tsirkin
2022-08-04  0:01         ` [virtio-comment] " Max Gurtovoy
2022-08-04  6:26           ` Michael S. Tsirkin
2022-07-31 15:43 ` [PATCH v6 5/5] Introduce MGMT admin commands Max Gurtovoy
2022-07-31 21:16   ` Michael S. Tsirkin
2022-07-31 16:27 ` [PATCH v6 0/5] Introduce device group and device management Michael S. Tsirkin

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=20220731154354.15698-3-mgurtovoy@nvidia.com \
    --to=mgurtovoy@nvidia.com \
    --cc=aadam@redhat.com \
    --cc=cohuck@redhat.com \
    --cc=eperezma@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=mst@redhat.com \
    --cc=oren@nvidia.com \
    --cc=parav@nvidia.com \
    --cc=shahafs@nvidia.com \
    --cc=virtio-comment@lists.oasis-open.org \
    --cc=virtio-dev@lists.oasis-open.org \
    --cc=virtio@lists.oasis-open.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.