From patchwork Fri Sep 28 09:31:10 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 187746 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 3B17A2C00C4 for ; Fri, 28 Sep 2012 19:30:01 +1000 (EST) Received: from localhost ([::1]:57410 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1THWtS-0007cJ-Pm for incoming@patchwork.ozlabs.org; Fri, 28 Sep 2012 05:29:58 -0400 Received: from eggs.gnu.org ([208.118.235.92]:55434) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1THWtH-0007c8-Qj for qemu-devel@nongnu.org; Fri, 28 Sep 2012 05:29:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1THWtD-0006y8-SY for qemu-devel@nongnu.org; Fri, 28 Sep 2012 05:29:47 -0400 Received: from mx1.redhat.com ([209.132.183.28]:14633) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1THWtD-0006y2-JR for qemu-devel@nongnu.org; Fri, 28 Sep 2012 05:29:43 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q8S9TdNI007362 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 28 Sep 2012 05:29:40 -0400 Received: from redhat.com (vpn1-4-152.ams2.redhat.com [10.36.4.152]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with SMTP id q8S9TZo6010073; Fri, 28 Sep 2012 05:29:36 -0400 Date: Fri, 28 Sep 2012 11:31:10 +0200 From: "Michael S. Tsirkin" To: Thomas Lendacky Message-ID: <20120928093110.GA6935@redhat.com> MIME-Version: 1.0 Content-Disposition: inline X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: Anthony Liguori , kvm@vger.kernel.org, Rusty Russell , qemu-devel@nongnu.org, virtualization@lists.linux-foundation.org, avi@redhat.com, Sasha Levin Subject: [Qemu-devel] [PATCH qemu] virtio-net: add feature bit for any header s/g 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 Old qemu versions required that 1st s/g entry is the header. My recent patchset titled "virtio-net: iovec handling cleanup" removed this limitation but a feature bit is needed so guests know it's safe to lay out header differently. This patch applies on top and adds such a feature bit. virtio net header inline with the data is beneficial for latency and small packet bandwidth. Signed-off-by: Michael S. Tsirkin --- hw/virtio-net.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/virtio-net.h b/hw/virtio-net.h index 36aa463..e7187e4 100644 --- a/hw/virtio-net.h +++ b/hw/virtio-net.h @@ -44,6 +44,7 @@ #define VIRTIO_NET_F_CTRL_RX 18 /* Control channel RX mode support */ #define VIRTIO_NET_F_CTRL_VLAN 19 /* Control channel VLAN filtering */ #define VIRTIO_NET_F_CTRL_RX_EXTRA 20 /* Extra RX mode control support */ +#define VIRTIO_NET_F_ANY_HEADER_SG 22 /* Host can handle any header s/g */ #define VIRTIO_NET_S_LINK_UP 1 /* Link is up */ @@ -186,5 +187,6 @@ struct virtio_net_ctrl_mac { DEFINE_PROP_BIT("ctrl_vq", _state, _field, VIRTIO_NET_F_CTRL_VQ, true), \ DEFINE_PROP_BIT("ctrl_rx", _state, _field, VIRTIO_NET_F_CTRL_RX, true), \ DEFINE_PROP_BIT("ctrl_vlan", _state, _field, VIRTIO_NET_F_CTRL_VLAN, true), \ - DEFINE_PROP_BIT("ctrl_rx_extra", _state, _field, VIRTIO_NET_F_CTRL_RX_EXTRA, true) + DEFINE_PROP_BIT("ctrl_rx_extra", _state, _field, VIRTIO_NET_F_CTRL_RX_EXTRA, true), \ + DEFINE_PROP_BIT("any_header_sg", _state, _field, VIRTIO_NET_F_ANY_HEADER_SG, true) #endif