[RFC] virtio-spec: ack the announce notification through ctrl_vq
diff mbox series

Message ID 20120322094706.26303.83633.stgit@jason-ThinkPad-T400
State New, archived
Headers show
Series
  • [RFC] virtio-spec: ack the announce notification through ctrl_vq
Related show

Commit Message

Jason Wang March 22, 2012, 9:47 a.m. UTC
During link announcement, driver needs a method to notify device that it has
received the notification and let it clear the VIRITO_NET_S_ANNOUNCE bit in the
status field. Doing this through a dedicated command looks suitable for all
platforms (especially for the ones who don't trap the status read or write) with
a ctrl vq and can solve the race between host and guest.

So this patch makes VIRTIO_NET_F_ANNOUNCE depends on VIRTIO_NET_F_CTRL_VQ and
introduces a dedicated command VIRTIO_NET_CTRL_ANNOUNCE_ACK to let device clear
the VIRTIO_NET_S_ANNOUNCE bit in the status field.

Signed-off-by: Jason Wang <jasowang@redhat.com>
---
 virtio-0.9.4.lyx |   63 +++++++++++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 57 insertions(+), 6 deletions(-)


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Patch
diff mbox series

diff --git a/virtio-0.9.4.lyx b/virtio-0.9.4.lyx
index 9d30977..d01284c 100644
--- a/virtio-0.9.4.lyx
+++ b/virtio-0.9.4.lyx
@@ -4013,8 +4013,12 @@  configuration
 layout Two configuration fields are currently defined.
  The mac address field always exists (though is only valid if VIRTIO_NET_F_MAC
  is set), and the status field only exists if VIRTIO_NET_F_STATUS is set.
- Two bits are currently defined for the status field: VIRTIO_NET_S_LINK_UP
- and VIRTIO_NET_S_ANNOUNCE.
+ Two 
+\change_inserted 2090695081 1332406434
+read-only 
+\change_unchanged
+bits are currently defined for the status field: VIRTIO_NET_S_LINK_UP and
+ VIRTIO_NET_S_ANNOUNCE.
  
 \begin_inset listings
 inline false
@@ -4902,18 +4906,58 @@  Gratuitous Packet Sending
 \end_layout
 
 \begin_layout Standard
-If the driver negotiates the VIRTIO_NET_F_GUEST_ANNOUNCE, it can ask the
- guest to send gratuitous packets; this is usually done after the guest
- has been physically migrated, and needs to announce its presence on the
- new network links.
+If the driver negotiates the VIRTIO_NET_F_GUEST_ANNOUNCE
+\change_inserted 2090695081 1332407810
+ (depends on VIRTIO_NET_F_CTRL_VQ)
+\change_unchanged
+, it can ask the guest to send gratuitous packets; this is usually done
+ after the guest has been physically migrated, and needs to announce its
+ presence on the new network links.
  (As hypervisor does not have the knowledge of guest network configuration
  (eg.
  tagged vlan) it is simplest to prod the guest in this way).
+\change_inserted 2090695081 1332405026
+
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 2090695081 1332405026
+\begin_inset listings
+inline false
+status open
+
+\begin_layout Plain Layout
+
+\change_inserted 2090695081 1332405658
+
+#define VIRTIO_NET_CTRL_ANNOUNCE       3
+\end_layout
+
+\begin_layout Plain Layout
+
+\change_inserted 2090695081 1332407582
+
+ #define VIRTIO_NET_CTRL_ANNOUNCE_ACK             0
+\end_layout
+
+\end_inset
+
+
+\change_unchanged
+
 \end_layout
 
 \begin_layout Standard
 The Guest needs to check VIRTIO_NET_S_ANNOUNCE bit in status field when
  it notices the changes of device configuration.
+
+\change_inserted 2090695081 1332407079
+ The command VIRTIO_NET_CTRL_ANNOUNCE_ACK is used to indicate that driver
+ has recevied the notification and device would clear the VIRTIO_NET_S_ANNOUNCE
+ bit in the status filed after it received this command.
+\change_unchanged
+
 \end_layout
 
 \begin_layout Standard
@@ -4921,7 +4965,14 @@  Processing this notification involves:
 \end_layout
 
 \begin_layout Enumerate
+
+\change_inserted 2090695081 1332405963
+Sending VIRTIO_NET_CTRL_ANNOUNCE_ACK command through control vq.
+ 
+\change_deleted 2090695081 1332405924
 Clearing VIRTIO_NET_S_ANNOUNCE bit in the status field.
+\change_unchanged
+
 \end_layout
 
 \begin_layout Enumerate