All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cornelia Huck <cohuck@redhat.com>
To: Jason Wang <jasowang@redhat.com>
Cc: Halil Pasic <pasic@linux.ibm.com>,
	virtio-comment@lists.oasis-open.org, mst@redhat.com
Subject: Re: [virtio-comment] [PATCH V2] virtio-net: introduce admin control virtqueue
Date: Mon, 1 Feb 2021 16:49:09 +0100	[thread overview]
Message-ID: <20210201164909.004f8202.cohuck@redhat.com> (raw)
In-Reply-To: <917eac0a-1773-bd38-82fa-440b9641a381@redhat.com>

On Mon, 1 Feb 2021 12:09:15 +0800
Jason Wang <jasowang@redhat.com> wrote:

> On 2021/1/30 上午6:48, Halil Pasic wrote:
> > On Mon, 25 Jan 2021 13:52:02 +0800
> > Jason Wang <jasowang@redhat.com> wrote:

> >> @@ -3840,11 +3843,12 @@ \subsubsection{Processing of Incoming Packets}\label{sec:Device Types / Network
> >>   \subsubsection{Control Virtqueue}\label{sec:Device Types / Network Device / Device Operation / Control Virtqueue}
> >>   
> >>   The driver uses the control virtqueue (if VIRTIO_NET_F_CTRL_VQ is
> >> -negotiated) to send commands to manipulate various features of
> >> -the device which would not easily map into the configuration
> >> -space.
> >> +negotiated but VIRTIO_NET_F_ADMIN_CTRL_VQ is not negotiated) to send
> >> +commands to manipulate various features of the device which would not
> >> +easily map into the configuration space.  
> > Let's assume device offers both VIRTIO_NET_F_ADMIN_CTRL_VQ and
> > VIRTIO_NET_F_CTRL_VQ, but driver accepts only VIRTIO_NET_F_CTRL_VQ,
> > because it is an old driver that only knows about VIRTIO_NET_F_CTRL_VQ.
> > What happens then? Do we expect the control queue virtqueue to just
> > work?  
> 
> 
> I think the answer is yes, my understanding is that it's better to 
> provide backward compatibility for the old drivers.

I agree, I'd expect the device to just use the CTRL_VQ semantics, or
fail feature negotiation.

> 
> 
> >
> > I read the proposal like VIRTIO_NET_F_ADMIN_CTRL_VQ and
> > VIRTIO_NET_F_CTRL_VQ are mutually exclusive features, and not stacking
> > features, but my confidence in this regard is very low. If they are
> > mutually exclusive, we should make the feature bits mutually exclusive
> > as well.  
> 
> 
> It works like:
> 
> If VIRTIO_NET_F_CTRL_VQ is negotiated but not 
> VIRTIO_NET_F_ADMIN_CTRL_VQ, the control virtqueue will use the old 
> command format.
> 
> If both are negotiated, the control virtqueue will use the new format.

What if ADMIN_CTRL_VQ is negotiated, but not CTRL_VQ? I assume that
this is an invalid combination that should not be accepted?

(...)

> >> +All commands are of the following form:
> >> +
> >> +\begin{lstlisting}
> >> +struct virtio_net_admin_ctrl {
> >> +        u32 virtual_device_id;
> >> +        struct virtio_net_ctrl ctrl;
> >> +};
> >> +\end{lstlisting}
> >> +
> >> +The \field{virtual_device_id} is an unique transport or device specific
> >> +identifier for a virtual device or management device. E.g for the case
> >> +of PCI SR-IOV, it's the PCI function id. Management device MUST
> >> +reserve 0 for \field{virtual_device_id} to identify itself.
> >> +  
> > How is a portable driver supposed to obtain this transport or device
> > specific ID?  
> 
> 
> Good question. The idea is:
> 
> 1) if we had transport specific feature like VIRTIO_F_SR_IOV, the id is 
> simply PCI function id
> 2) if virtio support it's own IOV feature (that is mutually exclusive 
> with the transport specific one), the id must be obtained via a virtio 
> method.
> 
> For 2) I plan to introduce a general admin virtqueue that is used for 
> virtio specific device IOV. In that implementation, the virtual device 
> must be created and destroyed via admin virtqueue. During device 
> creation a unique ID is needed then the driver should know/allocate the 
> id in advance.
> 
> 
> >
> > Let me elaborate. Let's say I'm a guest and I happen to have a virtio-net
> > device, which ain't capable doing the usual controlq stuff via the usual
> > controlq, so I have to use this new mechanism (if I, for example, want to
> > set the MAC address for it. To do so, I need to know the
> > virtual_device_id of my virtual virtio-net device, to be able to put it
> > in my virtio_net_admin_ctl command, and that command I need to put into
> > some admin control virtqueue.
> >
> > The paragraph above suggests, that this virtqueue is not the controlq of
> > my virtual virtio-net device I'm trying to control, but a virtqueue that
> > belongs to the management device.
> >
> > Obviously for a non-PCI device, it ain't making no sense to define this
> > device id as the PCI function id. I guess, this is where the 'transport
> > specific' comes from. But then shouldn't we define the transport specific
> > part in a transport specific section?  
> 
> 
> I think we need keep the general format here but maybe we can add a 
> reference to the transport specific part that describe the id in detail.
> 
> 
> >
> > Also please notice, that the structure virtio_net_admin_ctrl is defined
> > in the transport agnostic part, that is it has to work for any
> > transport. Which implies that any other transport must use ids that fit
> > 32 bits.  
> 
> 
> Yes, if it's not sufficient, I will increase it to 64 bits.

Should we maybe use the generic uuid format to identify the device in
the commands?


This publicly archived list offers a means to provide input to the
OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and
to minimize spam in the list archive, subscription is required
before posting.

Subscribe: virtio-comment-subscribe@lists.oasis-open.org
Unsubscribe: virtio-comment-unsubscribe@lists.oasis-open.org
List help: virtio-comment-help@lists.oasis-open.org
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/


  reply	other threads:[~2021-02-01 15:50 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-25  5:52 [virtio-comment] [PATCH V2] virtio-net: introduce admin control virtqueue Jason Wang
2021-01-25  6:31 ` Haozhong Zhang
2021-01-25  6:45   ` Jason Wang
2021-01-25  7:05     ` Haozhong Zhang
2021-01-25  7:48       ` Jason Wang
2021-01-25 10:22         ` Haozhong Zhang
2021-01-27  3:21           ` Jason Wang
2021-01-25 12:54 ` [virtio-comment] " Cornelia Huck
2021-01-27  3:30   ` Jason Wang
2021-01-27  8:48     ` Michael S. Tsirkin
2021-01-27 10:59 ` Michael S. Tsirkin
2021-01-28  2:58   ` Jason Wang
2021-01-29 10:57     ` Cornelia Huck
2021-02-01  3:42       ` Jason Wang
2021-02-01 16:10         ` Cornelia Huck
2021-01-29 22:48 ` [virtio-comment] " Halil Pasic
2021-02-01  4:09   ` Jason Wang
2021-02-01 15:49     ` Cornelia Huck [this message]
2021-02-02  3:28       ` Jason Wang

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=20210201164909.004f8202.cohuck@redhat.com \
    --to=cohuck@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=mst@redhat.com \
    --cc=pasic@linux.ibm.com \
    --cc=virtio-comment@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.