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