From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39305) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZCSAx-0005rk-Rs for qemu-devel@nongnu.org; Tue, 07 Jul 2015 08:40:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZCSAw-0003vE-Te for qemu-devel@nongnu.org; Tue, 07 Jul 2015 08:40:39 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33323) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZCSAw-0003ux-Ob for qemu-devel@nongnu.org; Tue, 07 Jul 2015 08:40:38 -0400 Date: Tue, 7 Jul 2015 15:40:34 +0300 From: "Michael S. Tsirkin" Message-ID: <1436272760-29611-11-git-send-email-mst@redhat.com> References: <1436272760-29611-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1436272760-29611-1-git-send-email-mst@redhat.com> Subject: [Qemu-devel] [PULL 10/13] virtio_net: reuse constants from linux List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Maydell , Thomas Huth , Christian Borntraeger , Shannon Zhao , Cornelia Huck , Paolo Bonzini VIRTIO_NET_F_CTRL_GUEST_OFFLOADS now appears in the linux header, let's reuse it. Signed-off-by: Michael S. Tsirkin --- include/hw/virtio/virtio-net.h | 12 ------------ include/standard-headers/linux/virtio_net.h | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/include/hw/virtio/virtio-net.h b/include/hw/virtio/virtio-net.h index 280dacf..60b11d5 100644 --- a/include/hw/virtio/virtio-net.h +++ b/include/hw/virtio/virtio-net.h @@ -21,9 +21,6 @@ #define VIRTIO_NET(obj) \ OBJECT_CHECK(VirtIONet, (obj), TYPE_VIRTIO_NET) -#define VIRTIO_NET_F_CTRL_GUEST_OFFLOADS 2 /* Control channel offload - * configuration support */ - #define TX_TIMER_INTERVAL 150000 /* 150 us */ /* Limit the number of packets that can be sent via a single flush @@ -100,15 +97,6 @@ typedef struct VirtIONet { int announce_counter; } VirtIONet; -/* - * Control network offloads - * - * Dynamic offloads are available with the - * VIRTIO_NET_F_CTRL_GUEST_OFFLOADS feature bit. - */ -#define VIRTIO_NET_CTRL_GUEST_OFFLOADS 5 -#define VIRTIO_NET_CTRL_GUEST_OFFLOADS_SET 0 - void virtio_net_set_netclient_name(VirtIONet *n, const char *name, const char *type); diff --git a/include/standard-headers/linux/virtio_net.h b/include/standard-headers/linux/virtio_net.h index 3209c90..a78f33e 100644 --- a/include/standard-headers/linux/virtio_net.h +++ b/include/standard-headers/linux/virtio_net.h @@ -34,6 +34,7 @@ /* The feature bitmap for virtio net */ #define VIRTIO_NET_F_CSUM 0 /* Host handles pkts w/ partial csum */ #define VIRTIO_NET_F_GUEST_CSUM 1 /* Guest handles pkts w/ partial csum */ +#define VIRTIO_NET_F_CTRL_GUEST_OFFLOADS 2 /* Dynamic offload configuration. */ #define VIRTIO_NET_F_MAC 5 /* Host has given MAC address. */ #define VIRTIO_NET_F_GUEST_TSO4 7 /* Guest can handle TSOv4 in. */ #define VIRTIO_NET_F_GUEST_TSO6 8 /* Guest can handle TSOv6 in. */ @@ -226,4 +227,19 @@ struct virtio_net_ctrl_mq { #define VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MIN 1 #define VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MAX 0x8000 +/* + * Control network offloads + * + * Reconfigures the network offloads that Guest can handle. + * + * Available with the VIRTIO_NET_F_CTRL_GUEST_OFFLOADS feature bit. + * + * Command data format matches the feature bit mask exactly. + * + * See VIRTIO_NET_F_GUEST_* for the list of offloads + * that can be enabled/disabled. + */ +#define VIRTIO_NET_CTRL_GUEST_OFFLOADS 5 +#define VIRTIO_NET_CTRL_GUEST_OFFLOADS_SET 0 + #endif /* _LINUX_VIRTIO_NET_H */ -- MST