Subject: Re: [PATCH 0/9][RFC] KVM virtio_net performance

From: Rusty Russell <[email-masked]>
Date: Mon, 11 Aug 2008 17:44:27 +1000

On Friday 25 July 2008 06:56:01 you wrote:
> I'm still seeing the same problem I saw with my patch series.  Namely,
> dhclient fails to get a DHCP address.

This is, from one point of view, a dhclient bug.  It opens a packet socket, 
and we'd tell it that the checksum is incomplete via auxdata, but it doesn't 
have auxdata.

On the other hand, perhaps we should copy the packet and checksum it in this 
case?  Not many devices input packets with partial csums, so dhclient doesn't 
normally hit this.  Xen might though?

ie, in net/packet/af_packet.c's packet_recvmsg():

	if (pkt_sk(sk)->auxdata) {
		struct tpacket_auxdata aux;

		aux.tp_status = TP_STATUS_USER;
		if (skb->ip_summed == CHECKSUM_PARTIAL)
			aux.tp_status |= TP_STATUS_CSUMNOTREADY;
		aux.tp_len = PACKET_SKB_CB(skb)->origlen;
		aux.tp_snaplen = skb->len;
		aux.tp_mac = 0;
		aux.tp_net = skb_network_offset(skb);
		aux.tp_vlan_tci = skb->vlan_tci;

		put_cmsg(msg, SOL_PACKET, PACKET_AUXDATA, sizeof(aux), &aux);
	}

add an "else if (skb->ip_summed == CHECKSUM_PARTIAL)" case...

Rusty.