summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormstsirkin <mstsirkin@0c8fb4dd-22a2-4bb5-bc14-6c75a5f43652>2013-12-08 22:10:48 +0000
committermstsirkin <mstsirkin@0c8fb4dd-22a2-4bb5-bc14-6c75a5f43652>2013-12-08 22:10:48 +0000
commitdf64d9b9f898adaa687f1c9d9e7d7dbfa835fb3c (patch)
tree494b633c541a0f8a84283d0df4dea48892874dce
parent5839d2c5d20d44273d4d278c501a2994089d9682 (diff)
net: document VIRTIO_NET_F_MAC_ADDR
VIRTIO-50 commit f058954d131e3dc73058778ad23b241a235ae8e1 virtio-spec: set mac address by a new vq command Approved Dec 3, 2013 Reported-by: Francesco Fusco <ffusco@redhat.com> Signed-off-by: Amos Kong <akong@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> git-svn-id: https://tools.oasis-open.org/version-control/svn/virtio@167 0c8fb4dd-22a2-4bb5-bc14-6c75a5f43652
-rw-r--r--content.tex33
1 files changed, 33 insertions, 0 deletions
diff --git a/content.tex b/content.tex
index 356a1d5..3b39602 100644
--- a/content.tex
+++ b/content.tex
@@ -2343,6 +2343,8 @@ features.
\item[VIRTIO_NET_F_MQ(22)] Device supports multiqueue with automatic
receive steering.
+\item[VIRTIO_NET_F_CTRL_MAC_ADDR(23)] Set MAC address through control
+ channel.
\end{description}
\subsubsection{Legacy Interface: Feature bits}\label{sec:Device Types / Network Device / Feature bits / Legacy Interface: Feature bits}
@@ -2681,6 +2683,7 @@ off. The command-specific-data is one byte containing 0 (off) or
#define VIRTIO_NET_CTRL_MAC 1
#define VIRTIO_NET_CTRL_MAC_TABLE_SET 0
+ #define VIRTIO_NET_CTRL_MAC_ADDR_SET 1
\end{lstlisting}
The device can filter incoming packets by any number of destination
@@ -2693,10 +2696,40 @@ command-specific-data is two variable length tables of 6-byte MAC
addresses. The first table contains unicast addresses, and the second
contains multicast addresses.
+When VIRTIO_NET_F_MAC_ADDR is not negotiated, the mac field in
+config space is writeable and is used to set the default MAC
+address which rx filtering accepts.
+When VIRTIO_NET_F_MAC_ADDR is negotiated, the mac field in
+config space becomes read-only.
+The VIRTIO_NET_CTRL_MAC_ADDR_SET command is used to set the
+default MAC address which rx filtering
+accepts
+
+Depending on whether VIRTIO_NET_F_MAC_ADDR has been negotiated,
+the mac field in config space or the VIRTIO_NET_CTRL_MAC_ADDR_SET
+is used to set the default MAC address which rx filtering
+accepts.
+The command-specific-data for VIRTIO_NET_CTRL_MAC_ADDR_SET is
+the 6-byte MAC address.
+
+The
+VIRTIO_NET_CTRL_MAC_ADDR_SET command is atomic whereas the
+mac field in config space is not, therefore drivers
+MUST negotiate VIRTIO_NET_F_MAC_ADDR if they change
+mac address when device is accepting incoming packets.
+
\subparagraph{Legacy Interface: Setting MAC Address Filtering}\label{sec:Device Types / Network Device / Device Operation / Control Virtqueue / Setting MAC Address Filtering / Legacy Interface: Setting MAC Address Filtering}
For legacy devices, the entries field in struct virtio_net_ctrl_mac is the
native endian of the guest rather than (necessarily) little-endian.
+Legacy drivers that didn't negotiate VIRTIO_NET_F_MAC_ADDR
+changed the mac field in config space when NIC is accepting
+incoming packets. These drivers always wrote the mac value from
+first to last byte, therefore after detecting such drivers,
+a transitional device CAN defer MAC update, or CAN defer
+processing incoming packets until driver writes the last byte
+of the mac field in config space.
+
\paragraph{VLAN Filtering}\label{sec:Device Types / Network Device / Device Operation / Control Virtqueue / VLAN Filtering}
If the driver negotiates the VIRTION_NET_F_CTRL_VLAN feature, it