From owner-freebsd-current@FreeBSD.ORG Mon Jan 5 18:30:45 2015 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 902743C7; Mon, 5 Jan 2015 18:30:45 +0000 (UTC) Received: from onelab2.iet.unipi.it (onelab2.iet.unipi.it [131.114.59.238]) by mx1.freebsd.org (Postfix) with ESMTP id 53E932251; Mon, 5 Jan 2015 18:30:44 +0000 (UTC) Received: by onelab2.iet.unipi.it (Postfix, from userid 275) id E56E97300A; Mon, 5 Jan 2015 19:35:29 +0100 (CET) Date: Mon, 5 Jan 2015 19:35:29 +0100 From: Luigi Rizzo To: Bryan Venteicher , current@freebsd.org Subject: false alarm (Re: invalid checksum with vtnet and in_kernel BOOTP) Message-ID: <20150105183529.GF22916@onelab2.iet.unipi.it> References: <20150103190022.GA95892@onelab2.iet.unipi.it> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150103190022.GA95892@onelab2.iet.unipi.it> User-Agent: Mutt/1.5.20 (2009-06-14) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Jan 2015 18:30:45 -0000 for the records, this was not a problem with vtnet but a bug in some bhyve modifications of ours. Thanks to Bryan who pointed out the potential location of the problem. cheers luigi On Sat, Jan 03, 2015 at 08:00:22PM +0100, Luigi Rizzo wrote: > I am trying to run a diskless bhyve client diskless using in-kernel > bootp support and vtnet connected to tap and bridge on the host side > and I am having the problem in the subject which may be vtnet-related. > > Packets generated by the in-kernel DHCP arrive to the host tap > interface with a corrupt checksum, which is consistent with vtnet0 > having the TXCSUM capability enabled. > > Unfortunately, when the packet reaches the bridge0 on the host: > > uname -a > FreeBSD bsd9.casa 10.0-STABLE FreeBSD 10.0-STABLE #0 r269180: > >ifconfig bridge0 > > bridge0: flags=8843 metric 0 mtu 1500 > ether 02:01:85:b1:55:00 > id 00:00:00:00:00:00 priority 32768 hellotime 2 fwddelay 15 > maxage 20 holdcnt 6 proto rstp maxaddr 2000 timeout 1200 > root id 00:00:00:00:00:00 priority 32768 ifcost 0 port 0 > member: re0 flags=143 > ifmaxaddr 0 port 1 priority 128 path cost 200000 > member: tap0 flags=143 > ifmaxaddr 0 port 4 priority 128 path cost 55 > > The packet goes out with a broken checksum and the (external) > dhcp server does not respond. > > When the guest is up, i can run dhclient on the same guest interface > and packets exit with a correct checksum. > Maybe dhclient generates correct packets ignoring the TXCSUM setting. > > In any case i applied a quick fix (disable TXCSUM in if_vtnet.c) > and at least can get the dhcp request reach the router and get > a response back. > > Also note that subsequent (tcp) traffic through the interface > is reported on the host with a correct checksum, so i suspect > that either the kernel-bootp code does not pass the correct > checksum flags, or somehow it is sent to the device too early > in the initialization process. > > any idea ? > > cheers > luigi