From patchwork Wed Oct 26 08:49:12 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Wang X-Patchwork-Id: 121862 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 429B4B6F81 for ; Wed, 26 Oct 2011 19:49:21 +1100 (EST) Received: from localhost ([::1]:43848 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RIzAk-0001UV-Ix for incoming@patchwork.ozlabs.org; Wed, 26 Oct 2011 04:49:18 -0400 Received: from eggs.gnu.org ([140.186.70.92]:60306) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RIzAf-0001UQ-Do for qemu-devel@nongnu.org; Wed, 26 Oct 2011 04:49:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RIzAe-0008FH-BF for qemu-devel@nongnu.org; Wed, 26 Oct 2011 04:49:13 -0400 Received: from mx1.redhat.com ([209.132.183.28]:25199) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RIzAe-0008FB-1n for qemu-devel@nongnu.org; Wed, 26 Oct 2011 04:49:12 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p9Q8nBGx001067 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 26 Oct 2011 04:49:11 -0400 Received: from dhcp-8-146.nay.redhat.com (dhcp-8-146.nay.redhat.com [10.66.8.146]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p9Q8n8ea008466; Wed, 26 Oct 2011 04:49:09 -0400 To: netdev@vger.kernel.org, rusty@rustcorp.com.au, qemu-devel@nongnu.org, kvm@vger.kernel.org, mst@redhat.com From: Jason Wang Date: Wed, 26 Oct 2011 16:49:12 +0800 Message-ID: <20111026084912.19391.26534.stgit@dhcp-8-146.nay.redhat.com> User-Agent: StGit/0.15 MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [virtio-spec: RFC PATCH] virtio-spec: introduce VIRTIO_NET_F_GUEST_ANNOUNCE X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 --- virtio-spec.lyx | 45 ++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 44 insertions(+), 1 deletions(-) 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