virtio: multiqueue virtio endian fixes

From
Rusty Russell <>
Date
2014-01-22T04:55:00+00:00
ID
Thread
virtio: multiqueue virtio endian fixes
Michael's patch adding MQ support added some u16s; they are u16 in legacy mode but should be le16 for modern devices.  Signed-off-by: Rusty Russell <>  diff --git a/content.tex b/content.tex index 803615d..b038b0c 100644 --- a/content.tex +++ b/content.tex @@ -2440,12 +2440,12 @@ is negotiated.  Legal values for this field are 1 to 0x8000.  	struct virtio_net_config {  		u8 mac[6];  		le16 status; -		u16 max_virtqueue_pairs; +		le16 max_virtqueue_pairs;  	};  end{lstlisting}
subsubsection{Legacy Interface: Device configuration layout}label{sec:Device Types / Network Device / Device configuration layout / Legacy Interface: Device configuration layout} -For legacy devices, the status field in struct virtio_net_config is the +For legacy devices, the status and max_virtqueue_pairs fields in struct virtio_net_config are the  native endian of the guest rather than (necessarily) little-endian.
@@ -2851,7 +2851,7 @@ depending on the packet flow.
egin{lstlisting}  	struct virtio_net_ctrl_mq { -		u16 virtqueue_pairs; +		le16 virtqueue_pairs;  	};
	#define VIRTIO_NET_CTRL_MQ
4 @@ -2884,6 +2884,10 @@ transmitq1..transmitqN (i.e. other than transmitq0); accordingly,  the driver MUST NOT transmit new packets on virtqueues other than  transmitq0.
+subparagraph{Legacy Interface: Automatic receive steering in multiqueue mode}label{sec:Device Types / Network Device / Device Operation / Control Virtqueue / Automatic receive steering in multiqueue mode / Legacy Interface: Automatic receive steering in multiqueue mode} +For legacy devices, the virtqueue_paris field is in the +native endian of the guest rather than (necessarily) little-endian. +  paragraph{Offloads State Configuration}label{sec:Device Types / Network Device / Device Operation / Control Virtqueue / Offloads State Configuration}
If the VIRTIO_NET_F_CTRL_GUEST_OFFLOADS feature is negotiated, the driver can