diff mbox

[virtio-spec:,RFC] virtio-spec: introduce VIRTIO_NET_F_GUEST_ANNOUNCE

Message ID 20111026084912.19391.26534.stgit@dhcp-8-146.nay.redhat.com
State New
Headers show

Commit Message

Jason Wang Oct. 26, 2011, 8:49 a.m. UTC
Network connections in guest need to be kept after migration. This is done by
sending gratuitous packet and let switch learn new port of the mac
address. As hypervisor does not have the knowledge of guest network
configurations such as tagged vlan or ipv6, it may require guest to send
gratuitous packet.

This patch introduces a new feature bit of virtio network adapter -
VIRTIO_NET_F_GUEST_ANNOUNCE which is used to indicate the ability to send
gratuitous packets by guest. A new status bit - VIRTIO_NET_S_ANNOUNCE is also
introduced to notify the guest the need for sending gratuitous packet. When
guest notice this, it should clear it and send the gratuitous packet.

Signed-off-by: Jason Wang <jasowang@redhat.com>
---
 virtio-spec.lyx |   45 ++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 44 insertions(+), 1 deletions(-)

Comments

Rusty Russell Oct. 27, 2011, 1:32 a.m. UTC | #1
On Wed, 26 Oct 2011 16:49:12 +0800, Jason Wang <jasowang@redhat.com> wrote:
> Network connections in guest need to be kept after migration. This is done by
> sending gratuitous packet and let switch learn new port of the mac
> address. As hypervisor does not have the knowledge of guest network
> configurations such as tagged vlan or ipv6, it may require guest to send
> gratuitous packet.
> 
> This patch introduces a new feature bit of virtio network adapter -
> VIRTIO_NET_F_GUEST_ANNOUNCE which is used to indicate the ability to send
> gratuitous packets by guest. A new status bit - VIRTIO_NET_S_ANNOUNCE is also
> introduced to notify the guest the need for sending gratuitous packet. When
> guest notice this, it should clear it and send the gratuitous packet.
> 
> Signed-off-by: Jason Wang <jasowang@redhat.com>

Thanks!  I applied it manually, since you didn't enable change tracking
in LyX (I like to produce a PDF showing changes between versions).

Some minor cleanups, here's the main text below.

Cheers,
Rusty.

Gratuitous Packet Sending

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. (As hypervisor does not have the knowledge of guest network configuration (eg. tagged vlan) it is simplest to prod the guest in this way).

The Guest needs to check VIRTIO_NET_S_ANNOUNCE bit in status field when it notices the changes of device configuration.

Processing this notification involves:

Clearing VIRTIO_NET_S_ANNOUNCE bit in the status field.

Sending the gratuitous packets.
Jason Wang Oct. 27, 2011, 2:34 a.m. UTC | #2
On 10/27/2011 09:32 AM, Rusty Russell wrote:
> On Wed, 26 Oct 2011 16:49:12 +0800, Jason Wang <jasowang@redhat.com> wrote:
>> Network connections in guest need to be kept after migration. This is done by
>> sending gratuitous packet and let switch learn new port of the mac
>> address. As hypervisor does not have the knowledge of guest network
>> configurations such as tagged vlan or ipv6, it may require guest to send
>> gratuitous packet.
>>
>> This patch introduces a new feature bit of virtio network adapter -
>> VIRTIO_NET_F_GUEST_ANNOUNCE which is used to indicate the ability to send
>> gratuitous packets by guest. A new status bit - VIRTIO_NET_S_ANNOUNCE is also
>> introduced to notify the guest the need for sending gratuitous packet. When
>> guest notice this, it should clear it and send the gratuitous packet.
>>
>> Signed-off-by: Jason Wang <jasowang@redhat.com>
> 
> Thanks!  I applied it manually, since you didn't enable change tracking
> in LyX (I like to produce a PDF showing changes between versions).
> 

Ok, I would enable it next time.

> Some minor cleanups, here's the main text below.
> 
> Cheers,
> Rusty.
> 
> Gratuitous Packet Sending
> 
> 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. (As hypervisor does not have the knowledge of guest network configuration (eg. tagged vlan) it is simplest to prod the guest in this way).
> 
> The Guest needs to check VIRTIO_NET_S_ANNOUNCE bit in status field when it notices the changes of device configuration.
> 
> Processing this notification involves:
> 
> Clearing VIRTIO_NET_S_ANNOUNCE bit in the status field.
> 
> Sending the gratuitous packets. 

Thanks for the cleanup.

> --
> To unsubscribe from this list: send the line "unsubscribe kvm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/virtio-spec.lyx b/virtio-spec.lyx
index 6426f8f..87733b9 100644
--- a/virtio-spec.lyx
+++ b/virtio-spec.lyx
@@ -4133,6 +4133,14 @@  VIRTIO_NET_F_CTRL_VLAN
 (19) Control channel VLAN filtering.
 \end_layout
 
+\begin_layout Description
+VIRTIO_NET_F_GUEST_ANNOUNCE
+\begin_inset space ~
+\end_inset
+
+(21) Guest can send gratuitous packets.
+\end_layout
+
 \end_deeper
 \begin_layout Description
 Device
@@ -4146,7 +4154,8 @@  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.
- Only one bit is currently defined for the status field: VIRTIO_NET_S_LINK_UP.
+ Two bits are currently defined for the status field: VIRTIO_NET_S_LINK_UP
+ and VIRTIO_NET_S_ANOUNCE.
  
 \begin_inset listings
 inline false
@@ -4159,6 +4168,11 @@  status open
 
 \begin_layout Plain Layout
 
+#define VIRTIO_NET_S_ANNOUNCE	2
+\end_layout
+
+\begin_layout Plain Layout
+
 \end_layout
 
 \begin_layout Plain Layout
@@ -5015,6 +5029,35 @@  Both the VIRTIO_NET_CTRL_VLAN_ADD and VIRTIO_NET_CTRL_VLAN_DEL command take
  a 16-bit VLAN id as the command-specific-data.
 \end_layout
 
+\begin_layout Subsection*
+Gratuitous Packet Sending
+\end_layout
+
+\begin_layout Standard
+If the driver negotiates the VIRTIO_NET_F_GUEST_ANNOUNCE, it can send gratuitous
+ packet.
+ Gratuitous packet were used to notify the change of physical link and it
+ is usually sent after migration.
+ As hypervisor does not have the knowledge of guest network configuration
+ (ie.
+ tagged vlan), it would demand guest to send gratuitous packet by setting
+ VIRTIO_NET_S_ANNOUNCE bit in status field.
+ Guest needs to check VIRTIO_NET_S_ANNOUNCE bit in status field when it
+ notices the changes of device configuration.
+\end_layout
+
+\begin_layout Standard
+Processing this notification invloves:
+\end_layout
+
+\begin_layout Enumerate
+Clear VIRTIO_NET_S_ANNOUNCE bit in the status field.
+\end_layout
+
+\begin_layout Enumerate
+Send the gratuitous packets.
+\end_layout
+
 \begin_layout Chapter*
 Appendix D: Block Device
 \end_layout