[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [virtio-dev] Re: [PATCH v10 03/10] admin: introduce group administration commands
Fri, Mar 03, 2023 at 09:23:14PM CET, stefanha@redhat.com wrote: >On Fri, Mar 03, 2023 at 08:18:43AM -0500, Michael S. Tsirkin wrote: >> On Fri, Mar 03, 2023 at 08:13:37AM -0500, Stefan Hajnoczi wrote: >> > On Thu, Mar 02, 2023 at 06:57:24PM -0500, Michael S. Tsirkin wrote: >> > > On Thu, Mar 02, 2023 at 03:10:11PM -0500, Stefan Hajnoczi wrote: >> > > > On Thu, Mar 02, 2023 at 08:05:02AM -0500, Michael S. Tsirkin wrote: >> > > > > This introduces a general structure for group administration commands, >> > > > > used to control device groups through their owner. >> > > > > >> > > > > Following patches will introduce specific commands and an interface for >> > > > > submitting these commands to the owner. >> > > > > >> > > > > Signed-off-by: Max Gurtovoy <mgurtovoy@nvidia.com> >> > > > > Signed-off-by: Michael S. Tsirkin <mst@redhat.com> >> > > > > --- >> > > > > admin.tex | 108 +++++++++++++++++++++++++++++++++++++++++++++++ >> > > > > introduction.tex | 3 ++ >> > > > > 2 files changed, 111 insertions(+) >> > > > > >> > > > > diff --git a/admin.tex b/admin.tex >> > > > > index 3dc47be..7e28b77 100644 >> > > > > --- a/admin.tex >> > > > > +++ b/admin.tex >> > > > > @@ -46,4 +46,112 @@ \section{Device groups}\label{sec:Basic Facilities of a Virtio Device / Device g >> > > > > PCI transport (see \ref{sec:Virtio Transport Options / Virtio Over PCI Bus}). >> > > > > \end{description} >> > > > > >> > > > > +\subsection{Group administration commands}\label{sec:Basic Facilities of a Virtio Device / Device groups / Group administration commands} >> > > > > >> > > > > +The driver sends group administration commands to the owner device of >> > > > >> > > > I notice that the terminology is simply "the driver". "Owner driver" >> > > > and "group member driver" might be clearer because there will be two >> > > > (possibly different) drivers involved. >> > > >> > > Hmm I don't really want to repeat owner everywhere. >> > > I will clarify that in this section simple "driver" and "device" are >> > > owner, "member device" and "member driver" is always called explicitly. >> > >> > Sounds good. >> > >> > > > > +a group to control member devices of the group. >> > > > > +This mechanism can >> > > > > +be used, for example, to configure a member device before it is >> > > > > +initialized by its driver. >> > > > > +\footnote{The term "administration" is intended to be interpreted >> > > > > +widely to include any kind of control. See specific commands >> > > > > +for detail.} >> > > > > + >> > > > > +All the group administration commands are of the following form: >> > > > > + >> > > > > +\begin{lstlisting} >> > > > > +struct virtio_admin_cmd { >> > > > > + /* Device-readable part */ >> > > > > + le16 opcode; >> > > > > + /* >> > > > > + * 1 - SR-IOV >> > > > > + * 2 - 65535 reserved >> > > > > + */ >> > > > > + le16 group_type; >> > > > > + /* unused, reserved for future extensions */ >> > > > > + u8 reserved1[12]; >> > > > > + le64 group_member_id; >> > > > > + u8 command_specific_data[]; >> > > > > + >> > > > > + /* Device-writable part */ >> > > > > + le16 status; >> > > > > + le16 status_qualifier; >> > > > > + /* unused, reserved for future extensions */ >> > > > > + u8 reserved2[4]; >> > > > > + u8 command_specific_result[]; >> > > > > +}; >> > > > > +\end{lstlisting} >> > > > > + >> > > > > +For all commands, \field{opcode}, \field{group_type} and if >> > > > > +necessary \field{group_member_id} and \field{command_specific_data} are >> > > > > +set by the driver, and the owner device sets \field{status} and if >> > > > > +needed \field{status_qualifier} and >> > > > > +\field{command_specific_result}. >> > > > > + >> > > > > +Generally, any unused device-readable fields are set to zero by the driver >> > > > > +and ignored by the device. Any unused device-writeable fields are set to zero >> > > > > +by the device and ignored by the driver. >> > > > > + >> > > > > +\field{opcode} specifies the command. The valid >> > > > > +values for \field{opcode} can be found in the following table: >> > > > > + >> > > > > +\begin{tabular}{|l|l|} >> > > > > +\hline >> > > > > +opcode & Name & Command Description \\ >> > > > > +\hline \hline >> > > > > +0x0000 - 0x7FFF & - & Group administration commands \\ >> > > > > +\hline >> > > > > +0x8000 - 0xFFFF & - & Reserved \\ >> > > > > +\hline >> > > > > +\end{tabular} >> > > > >> > > > I thought all commands are "group administration commands" but this >> > > > table makes it look like they are just a subset (0x0000 - 0x7FFF) of >> > > > group administration commands, which is a paradox. >> > > >> > > Well the rest are reserved, maybe we will have more command types who >> > > knows. No? >> > >> > I see. Does that mean the reserved commands don't need to be in the same >> > format as struct virtio_admin_cmd? >> >> I am not good in predicting future ... >> >> > The entire section is called "Group administration commands" but I get >> > the impression it's talking both about admin virtqueue commands in >> > general and specifically about group administration commands. >> > >> > Is it possible to structure this as follows: >> > >> > Admin Commands >> > ...common stuff... >> > Group Administration Commands (0x0000-0x7fff) >> > ...specific to group administration commands... >> > Reserved (0x8000-0xffff) >> >> What if I just write it like this: >> >> >> > > > > +\hline \hline >> > > > > +0x0000 - 0x7FFF & - & commands using struct virtio_admin_cmd \\ >> > > > > +\hline >> > > > > +0x8000 - 0xFFFF & - & Reserved for future commands (possibly using a different structure) \\ >> >> >> will this address the comment? > >Yes, thanks. What is the reason for having this table? I fail to see it. > >Stefan
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]