All of lore.kernel.org
 help / color / mirror / Atom feed
* [virtio] [PATCH] content: document speed, duplex
@ 2019-11-27 13:07 Michael S. Tsirkin
  2019-11-27 15:07 ` [virtio-comment] " Yan Vugenfirer
  2019-12-03 10:01 ` [virtio] " Cornelia Huck
  0 siblings, 2 replies; 5+ messages in thread
From: Michael S. Tsirkin @ 2019-11-27 13:07 UTC (permalink / raw)
  To: virtio-comment, virtio-dev; +Cc: virtio, Cornelia Huck

Document as used by Linux.

Fixes: https://github.com/oasis-tcs/virtio-spec/issues/59
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
---
 content.tex | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/content.tex b/content.tex
index 9157717..6acbb19 100644
--- a/content.tex
+++ b/content.tex
@@ -2899,6 +2899,7 @@ \subsection{Feature bits}\label{sec:Device Types / Network Device / Feature bits
 
 \item[VIRTIO_NET_F_STANDBY(62)] Device may act as a standby for a primary
     device with the same MAC address.
+\item[VIRTIO_NET_F_SPEED_DUPLEX(63)] Device reports speed and duplex.
 \end{description}
 
 \subsubsection{Feature bit requirements}\label{sec:Device Types / Network Device / Feature bits / Feature bit requirements}
@@ -2958,12 +2959,27 @@ \subsection{Device configuration layout}\label{sec:Device Types / Network Device
 VIRTIO_NET_F_MTU is set. This field specifies the maximum MTU for the driver to
 use.
 
+The following two fields, \field{speed} and \field{duplex}, only
+exist if VIRTIO_NET_F_SPEED_DUPLEX is set.
+
+\field{speed} contains the device speed, in units of 1 MByte, 0
+to 0x7ffffffff, or 0xfffffffff for unknown speed.
+
+\field{duplex} has the values of 0x00 for full duplex, 0x01 for
+half duplex and 0xff for unknown duplex state.
+
+Neither \field{speed} nor \field{duplex} changes as long as
+VIRTIO_NET_S_LINK_UP is set.
+
 \begin{lstlisting}
 struct virtio_net_config {
         u8 mac[6];
         le16 status;
         le16 max_virtqueue_pairs;
         le16 mtu;
+        le32 speed;
+        u8 duplex;
+
 };
 \end{lstlisting}
 
@@ -2992,6 +3008,18 @@ \subsection{Device configuration layout}\label{sec:Device Types / Network Device
 If the driver negotiates the VIRTIO_NET_F_STANDBY feature, the device MAY act
 as a standby device for a primary device with the same MAC address.
 
+If VIRTIO_NET_F_SPEED_DUPLEX has been negotiated, \field{speed}
+MUST contain the device speed, in units of 1 MByte, 0 to
+0x7ffffffff, or 0xfffffffff for unknown.
+
+If VIRTIO_NET_F_SPEED_DUPLEX has been negotiated, \field{duplex}
+MUST have the values of 0x00 for full duplex, 0x01 for half
+duplex, or 0xff for unknown.
+
+If VIRTIO_NET_F_SPEED_DUPLEX has been negotiated, the device MUST
+NOT change the \field{speed} and \field{duplex} fields as long as
+VIRTIO_NET_S_LINK_UP is set in the \field{status}.
+
 \drivernormative{\subsubsection}{Device configuration layout}{Device Types / Network Device / Device configuration layout}
 
 A driver SHOULD negotiate VIRTIO_NET_F_MAC if the device offers it.
@@ -3016,6 +3044,11 @@ \subsection{Device configuration layout}\label{sec:Device Types / Network Device
 
 A driver SHOULD negotiate the VIRTIO_NET_F_STANDBY feature if the device offers it.
 
+If VIRTIO_NET_F_SPEED_DUPLEX has been negotiated,
+the driver MUST treat any value of \field{speed} above
+0x7fffffff as well as any value of \field{duplex} not
+matching 0x00 or 0x01 as an unknown value.
+
 \subsubsection{Legacy Interface: Device configuration layout}\label{sec:Device Types / Network Device / Device configuration layout / Legacy Interface: Device configuration layout}
 \label{sec:Device Types / Block Device / Feature bits / Device configuration layout / Legacy Interface: Device configuration layout}
 When using the legacy interface, transitional devices and drivers
-- 
MST


---------------------------------------------------------------------
To unsubscribe from this mail list, you must leave the OASIS TC that 
generates this mail.  Follow this link to all your TCs in OASIS at:
https://www.oasis-open.org/apps/org/workgroup/portal/my_workgroups.php 


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [virtio-comment] [PATCH] content: document speed, duplex
  2019-11-27 13:07 [virtio] [PATCH] content: document speed, duplex Michael S. Tsirkin
@ 2019-11-27 15:07 ` Yan Vugenfirer
  2019-11-27 15:58   ` [virtio] " Michael S. Tsirkin
  2019-12-03 10:01 ` [virtio] " Cornelia Huck
  1 sibling, 1 reply; 5+ messages in thread
From: Yan Vugenfirer @ 2019-11-27 15:07 UTC (permalink / raw)
  To: Michael S. Tsirkin; +Cc: virtio-comment, virtio-dev, virtio, Cornelia Huck

Hi Michael,

Currently there are also link up\down notifications. Should we add something like:
“The driver should re-read the speed and duplex configuration after receiving link up notification”.
What do you think?

Best regards,
Yan.

> On 27 Nov 2019, at 3:07 PM, Michael S. Tsirkin <mst@redhat.com> wrote:
> 
> Document as used by Linux.
> 
> Fixes: https://github.com/oasis-tcs/virtio-spec/issues/59
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> Reviewed-by: Cornelia Huck <cohuck@redhat.com>
> ---
> content.tex | 33 +++++++++++++++++++++++++++++++++
> 1 file changed, 33 insertions(+)
> 
> diff --git a/content.tex b/content.tex
> index 9157717..6acbb19 100644
> --- a/content.tex
> +++ b/content.tex
> @@ -2899,6 +2899,7 @@ \subsection{Feature bits}\label{sec:Device Types / Network Device / Feature bits
> 
> \item[VIRTIO_NET_F_STANDBY(62)] Device may act as a standby for a primary
>     device with the same MAC address.
> +\item[VIRTIO_NET_F_SPEED_DUPLEX(63)] Device reports speed and duplex.
> \end{description}
> 
> \subsubsection{Feature bit requirements}\label{sec:Device Types / Network Device / Feature bits / Feature bit requirements}
> @@ -2958,12 +2959,27 @@ \subsection{Device configuration layout}\label{sec:Device Types / Network Device
> VIRTIO_NET_F_MTU is set. This field specifies the maximum MTU for the driver to
> use.
> 
> +The following two fields, \field{speed} and \field{duplex}, only
> +exist if VIRTIO_NET_F_SPEED_DUPLEX is set.
> +
> +\field{speed} contains the device speed, in units of 1 MByte, 0
> +to 0x7ffffffff, or 0xfffffffff for unknown speed.
> +
> +\field{duplex} has the values of 0x00 for full duplex, 0x01 for
> +half duplex and 0xff for unknown duplex state.
> +
> +Neither \field{speed} nor \field{duplex} changes as long as
> +VIRTIO_NET_S_LINK_UP is set.
> +
> \begin{lstlisting}
> struct virtio_net_config {
>         u8 mac[6];
>         le16 status;
>         le16 max_virtqueue_pairs;
>         le16 mtu;
> +        le32 speed;
> +        u8 duplex;
> +
> };
> \end{lstlisting}
> 
> @@ -2992,6 +3008,18 @@ \subsection{Device configuration layout}\label{sec:Device Types / Network Device
> If the driver negotiates the VIRTIO_NET_F_STANDBY feature, the device MAY act
> as a standby device for a primary device with the same MAC address.
> 
> +If VIRTIO_NET_F_SPEED_DUPLEX has been negotiated, \field{speed}
> +MUST contain the device speed, in units of 1 MByte, 0 to
> +0x7ffffffff, or 0xfffffffff for unknown.
> +
> +If VIRTIO_NET_F_SPEED_DUPLEX has been negotiated, \field{duplex}
> +MUST have the values of 0x00 for full duplex, 0x01 for half
> +duplex, or 0xff for unknown.
> +
> +If VIRTIO_NET_F_SPEED_DUPLEX has been negotiated, the device MUST
> +NOT change the \field{speed} and \field{duplex} fields as long as
> +VIRTIO_NET_S_LINK_UP is set in the \field{status}.
> +
> \drivernormative{\subsubsection}{Device configuration layout}{Device Types / Network Device / Device configuration layout}
> 
> A driver SHOULD negotiate VIRTIO_NET_F_MAC if the device offers it.
> @@ -3016,6 +3044,11 @@ \subsection{Device configuration layout}\label{sec:Device Types / Network Device
> 
> A driver SHOULD negotiate the VIRTIO_NET_F_STANDBY feature if the device offers it.
> 
> +If VIRTIO_NET_F_SPEED_DUPLEX has been negotiated,
> +the driver MUST treat any value of \field{speed} above
> +0x7fffffff as well as any value of \field{duplex} not
> +matching 0x00 or 0x01 as an unknown value.
> +
> \subsubsection{Legacy Interface: Device configuration layout}\label{sec:Device Types / Network Device / Device configuration layout / Legacy Interface: Device configuration layout}
> \label{sec:Device Types / Block Device / Feature bits / Device configuration layout / Legacy Interface: Device configuration layout}
> When using the legacy interface, transitional devices and drivers
> -- 
> MST
> 
> 
> 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/
> 


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/


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [virtio] Re: [virtio-comment] [PATCH] content: document speed, duplex
  2019-11-27 15:07 ` [virtio-comment] " Yan Vugenfirer
@ 2019-11-27 15:58   ` Michael S. Tsirkin
  0 siblings, 0 replies; 5+ messages in thread
From: Michael S. Tsirkin @ 2019-11-27 15:58 UTC (permalink / raw)
  To: Yan Vugenfirer; +Cc: virtio-comment, virtio-dev, virtio, Cornelia Huck

It's kind of implied, and I generally dislike this kind of
"re-read" requirement since e.g. it's ok for driver to just
read these fields on every userspace query.
Can this be discussed on top?

On Wed, Nov 27, 2019 at 05:07:58PM +0200, Yan Vugenfirer wrote:
> Hi Michael,
> 
> Currently there are also link up\down notifications. Should we add something like:
> “The driver should re-read the speed and duplex configuration after receiving link up notification”.
> What do you think?
> 
> Best regards,
> Yan.
> 
> > On 27 Nov 2019, at 3:07 PM, Michael S. Tsirkin <mst@redhat.com> wrote:
> > 
> > Document as used by Linux.
> > 
> > Fixes: https://github.com/oasis-tcs/virtio-spec/issues/59
> > Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> > Reviewed-by: Cornelia Huck <cohuck@redhat.com>
> > ---
> > content.tex | 33 +++++++++++++++++++++++++++++++++
> > 1 file changed, 33 insertions(+)
> > 
> > diff --git a/content.tex b/content.tex
> > index 9157717..6acbb19 100644
> > --- a/content.tex
> > +++ b/content.tex
> > @@ -2899,6 +2899,7 @@ \subsection{Feature bits}\label{sec:Device Types / Network Device / Feature bits
> > 
> > \item[VIRTIO_NET_F_STANDBY(62)] Device may act as a standby for a primary
> >     device with the same MAC address.
> > +\item[VIRTIO_NET_F_SPEED_DUPLEX(63)] Device reports speed and duplex.
> > \end{description}
> > 
> > \subsubsection{Feature bit requirements}\label{sec:Device Types / Network Device / Feature bits / Feature bit requirements}
> > @@ -2958,12 +2959,27 @@ \subsection{Device configuration layout}\label{sec:Device Types / Network Device
> > VIRTIO_NET_F_MTU is set. This field specifies the maximum MTU for the driver to
> > use.
> > 
> > +The following two fields, \field{speed} and \field{duplex}, only
> > +exist if VIRTIO_NET_F_SPEED_DUPLEX is set.
> > +
> > +\field{speed} contains the device speed, in units of 1 MByte, 0
> > +to 0x7ffffffff, or 0xfffffffff for unknown speed.
> > +
> > +\field{duplex} has the values of 0x00 for full duplex, 0x01 for
> > +half duplex and 0xff for unknown duplex state.
> > +
> > +Neither \field{speed} nor \field{duplex} changes as long as
> > +VIRTIO_NET_S_LINK_UP is set.
> > +
> > \begin{lstlisting}
> > struct virtio_net_config {
> >         u8 mac[6];
> >         le16 status;
> >         le16 max_virtqueue_pairs;
> >         le16 mtu;
> > +        le32 speed;
> > +        u8 duplex;
> > +
> > };
> > \end{lstlisting}
> > 
> > @@ -2992,6 +3008,18 @@ \subsection{Device configuration layout}\label{sec:Device Types / Network Device
> > If the driver negotiates the VIRTIO_NET_F_STANDBY feature, the device MAY act
> > as a standby device for a primary device with the same MAC address.
> > 
> > +If VIRTIO_NET_F_SPEED_DUPLEX has been negotiated, \field{speed}
> > +MUST contain the device speed, in units of 1 MByte, 0 to
> > +0x7ffffffff, or 0xfffffffff for unknown.
> > +
> > +If VIRTIO_NET_F_SPEED_DUPLEX has been negotiated, \field{duplex}
> > +MUST have the values of 0x00 for full duplex, 0x01 for half
> > +duplex, or 0xff for unknown.
> > +
> > +If VIRTIO_NET_F_SPEED_DUPLEX has been negotiated, the device MUST
> > +NOT change the \field{speed} and \field{duplex} fields as long as
> > +VIRTIO_NET_S_LINK_UP is set in the \field{status}.
> > +
> > \drivernormative{\subsubsection}{Device configuration layout}{Device Types / Network Device / Device configuration layout}
> > 
> > A driver SHOULD negotiate VIRTIO_NET_F_MAC if the device offers it.
> > @@ -3016,6 +3044,11 @@ \subsection{Device configuration layout}\label{sec:Device Types / Network Device
> > 
> > A driver SHOULD negotiate the VIRTIO_NET_F_STANDBY feature if the device offers it.
> > 
> > +If VIRTIO_NET_F_SPEED_DUPLEX has been negotiated,
> > +the driver MUST treat any value of \field{speed} above
> > +0x7fffffff as well as any value of \field{duplex} not
> > +matching 0x00 or 0x01 as an unknown value.
> > +
> > \subsubsection{Legacy Interface: Device configuration layout}\label{sec:Device Types / Network Device / Device configuration layout / Legacy Interface: Device configuration layout}
> > \label{sec:Device Types / Block Device / Feature bits / Device configuration layout / Legacy Interface: Device configuration layout}
> > When using the legacy interface, transitional devices and drivers
> > -- 
> > MST
> > 
> > 
> > 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/
> > 


---------------------------------------------------------------------
To unsubscribe from this mail list, you must leave the OASIS TC that 
generates this mail.  Follow this link to all your TCs in OASIS at:
https://www.oasis-open.org/apps/org/workgroup/portal/my_workgroups.php 


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [virtio] [PATCH] content: document speed, duplex
  2019-11-27 13:07 [virtio] [PATCH] content: document speed, duplex Michael S. Tsirkin
  2019-11-27 15:07 ` [virtio-comment] " Yan Vugenfirer
@ 2019-12-03 10:01 ` Cornelia Huck
  1 sibling, 0 replies; 5+ messages in thread
From: Cornelia Huck @ 2019-12-03 10:01 UTC (permalink / raw)
  To: Michael S. Tsirkin; +Cc: virtio-comment, virtio-dev, virtio

On Wed, 27 Nov 2019 08:07:47 -0500
"Michael S. Tsirkin" <mst@redhat.com> wrote:

> Document as used by Linux.
> 
> Fixes: https://github.com/oasis-tcs/virtio-spec/issues/59
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> Reviewed-by: Cornelia Huck <cohuck@redhat.com>
> ---
>  content.tex | 33 +++++++++++++++++++++++++++++++++
>  1 file changed, 33 insertions(+)
> 

> +\field{speed} contains the device speed, in units of 1 MByte, 0
> +to 0x7ffffffff, or 0xfffffffff for unknown speed.

As noted by Stefan on the ballot, this needs to be MBit, not MByte.


---------------------------------------------------------------------
To unsubscribe from this mail list, you must leave the OASIS TC that 
generates this mail.  Follow this link to all your TCs in OASIS at:
https://www.oasis-open.org/apps/org/workgroup/portal/my_workgroups.php 


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [virtio] [PATCH] content: document speed, duplex
@ 2019-11-17  8:28 Michael S. Tsirkin
  0 siblings, 0 replies; 5+ messages in thread
From: Michael S. Tsirkin @ 2019-11-17  8:28 UTC (permalink / raw)
  To: virtio, virtio-dev

Document as used by Linux.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 content.tex | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/content.tex b/content.tex
index bff80d0..e89ae44 100644
--- a/content.tex
+++ b/content.tex
@@ -2951,12 +2951,29 @@ \subsection{Device configuration layout}\label{sec:Device Types / Network Device
 VIRTIO_NET_F_MTU is set. This field specifies the maximum MTU for the driver to
 use.
 
+The following two fields, \field{speed} and \field{duplex} only
+exist if VIRTIO_NET_F_SPEED_DUPLEX is set.
+
+\field{speed} is the device speed, in units of 1MByte, 0 to
+0x7FFFF. Driver MUST also treat any
+other value as representing an unknown duplex state.
+
+\field{duplex} has the values of 0x00 for full duplex, 0x01 for
+half duplex and 0xff for unknown. Driver MUST also treat any
+other value as representing an unknown duplex state.
+
+Neither \field{speed} not \field{duplex} changes as long as
+VIRTIO_NET_S_LINK_UP is set.
+
 \begin{lstlisting}
 struct virtio_net_config {
         u8 mac[6];
         le16 status;
         le16 max_virtqueue_pairs;
         le16 mtu;
+        le32 speed;
+        u8 duplex;
+
 };
 \end{lstlisting}
 
@@ -2985,6 +3002,10 @@ \subsection{Device configuration layout}\label{sec:Device Types / Network Device
 If the driver negotiates the VIRTIO_NET_F_STANDBY feature, the device MAY act
 as a standby device for a primary device with the same MAC address.
 
+Device MUST NOT change the \field{speed} and \field{duplex}
+fields as long as VIRTIO_NET_S_LINK_UP is set in the
+\field{status}.
+
 \drivernormative{\subsubsection}{Device configuration layout}{Device Types / Network Device / Device configuration layout}
 
 A driver SHOULD negotiate VIRTIO_NET_F_MAC if the device offers it.
@@ -3009,6 +3030,10 @@ \subsection{Device configuration layout}\label{sec:Device Types / Network Device
 
 A driver SHOULD negotiate the VIRTIO_NET_F_STANDBY feature if the device offers it.
 
+A driver MUST treat a value of \field{speed} above
+0x000000007fffffff as well as a value of \field{duplex} not
+matching 0x0 or 0x1 as an unknown value.
+
 \subsubsection{Legacy Interface: Device configuration layout}\label{sec:Device Types / Network Device / Device configuration layout / Legacy Interface: Device configuration layout}
 \label{sec:Device Types / Block Device / Feature bits / Device configuration layout / Legacy Interface: Device configuration layout}
 When using the legacy interface, transitional devices and drivers
-- 
MST


---------------------------------------------------------------------
To unsubscribe from this mail list, you must leave the OASIS TC that 
generates this mail.  Follow this link to all your TCs in OASIS at:
https://www.oasis-open.org/apps/org/workgroup/portal/my_workgroups.php 


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-12-03 10:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-27 13:07 [virtio] [PATCH] content: document speed, duplex Michael S. Tsirkin
2019-11-27 15:07 ` [virtio-comment] " Yan Vugenfirer
2019-11-27 15:58   ` [virtio] " Michael S. Tsirkin
2019-12-03 10:01 ` [virtio] " Cornelia Huck
  -- strict thread matches above, loose matches on Subject: below --
2019-11-17  8:28 Michael S. Tsirkin

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.