From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:60709) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TRIDP-0006es-Ns for qemu-devel@nongnu.org; Thu, 25 Oct 2012 03:51:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TRIDJ-0006ok-VP for qemu-devel@nongnu.org; Thu, 25 Oct 2012 03:50:55 -0400 Received: from mail-ea0-f173.google.com ([209.85.215.173]:39753) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TRIDJ-0006og-EH for qemu-devel@nongnu.org; Thu, 25 Oct 2012 03:50:49 -0400 Received: by mail-ea0-f173.google.com with SMTP id a1so441854eaa.4 for ; Thu, 25 Oct 2012 00:50:47 -0700 (PDT) Date: Thu, 25 Oct 2012 09:50:45 +0200 From: Stefan Hajnoczi Message-ID: <20121025075045.GD24994@stefanha-thinkpad.redhat.com> References: <1351083542-15272-1-git-send-email-pbonzini@redhat.com> <1351083542-15272-16-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1351083542-15272-16-git-send-email-pbonzini@redhat.com> Subject: Re: [Qemu-devel] [PATCH 15/32] net: reorganize headers List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: peter.maydell@linaro.org, aliguori@us.ibm.com, qemu-devel@nongnu.org On Wed, Oct 24, 2012 at 02:58:45PM +0200, Paolo Bonzini wrote: > +struct virtio_net_hdr > +{ > +#define VIRTIO_NET_HDR_F_NEEDS_CSUM 1 // Use csum_start, csum_offset > +#define VIRTIO_NET_HDR_F_DATA_VALID 2 // Csum is valid > + uint8_t flags; > +#define VIRTIO_NET_HDR_GSO_NONE 0 // Not a GSO frame > +#define VIRTIO_NET_HDR_GSO_TCPV4 1 // GSO frame, IPv4 TCP (TSO) > +#define VIRTIO_NET_HDR_GSO_UDP 3 // GSO frame, IPv4 UDP (UFO) > +#define VIRTIO_NET_HDR_GSO_TCPV6 4 // GSO frame, IPv6 TCP > +#define VIRTIO_NET_HDR_GSO_ECN 0x80 // TCP has ECN set > + uint8_t gso_type; > + uint16_t hdr_len; > + uint16_t gso_size; > + uint16_t csum_start; > + uint16_t csum_offset; > +}; Idea for a separate cleanup: net/tap.c doesn't need the definition of struct virtio_net_hdr or virtio_net_hdr_mrg_rxbuf. It should simply negotiate vnet_hdr_size between hw/virtio-net.c and the kernel tun driver. The layout and contents of the struct are not needed by net/tap.c itself. Stefan