From owner-freebsd-virtualization@freebsd.org Tue Nov 3 20:01:53 2015 Return-Path: Delivered-To: freebsd-virtualization@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 09B5DA25B71 for ; Tue, 3 Nov 2015 20:01:53 +0000 (UTC) (envelope-from lab@gta.com) Received: from mailgate.gta.com (gb-ha.orl.gta.com [209.208.105.194]) by mx1.freebsd.org (Postfix) with ESMTP id 234E61F24 for ; Tue, 3 Nov 2015 20:01:51 +0000 (UTC) (envelope-from lab@gta.com) Received: (qmail 92230 invoked by uid 1000); 3 Nov 2015 20:01:41 -0000 Date: Tue, 3 Nov 2015 15:01:41 -0500 From: Larry Baird To: freebsd-virtualization@freebsd.org Subject: Re: Issues gatewaying through Hyper-V Message-ID: <20151103200141.GB90948@gta.com> References: <20151030034535.GA19514@gta.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20151030034535.GA19514@gta.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Nov 2015 20:01:53 -0000 On Thu, Oct 29, 2015 at 11:45:35PM -0400, Larry Baird wrote: > I have two identical setups on Hyper-V 2012R2 and Hype-V windows 10. > > I have two FreeBSD 10.2-RELEASE-p6 Hyper-V hosts in both cases. > The first FreeBSD host (client) has one NIC configured to use a Private > network. The second (gateway) has two nics. One private and one external. > The gateway box has the gateway_enable option set to YES in its rc.conf. > The boxes otherwize of very vanilla. > > I get failures forwarding thru gateway on both versions of Hyper-V. But > they fail in different ways. > > On both configurations, I can ping thru the gateway from the client to reach > the internet. > > For the 2012r2 configuration I can do DNS looks. The command > "host www.google.com 8.8.8.8" works on the client. > > For the Windows 10 configuration the "host" command fails. > > For the 2012r2, "curl http://www.goggle.com" times out on client. > > Under Windows 10, I can successfuly do curl requests by IP address. > > Using tcpdump on the client for the failure cases, I see bad checksums > in the responses retunred to the failing commands. I tried turning off > rxcsum, txcsum, tso4 and tso6 on all interfaces. This did not effect the > results. > > Using tcpdup on the gateway on either interface shows valid checksums. > They are getting corrupted after they leave FreeBSD on their way to the > client. I assume this means this is an internal HyperV issue. I wonder if > there anything the FreeBSD hn(4) driver can do? The patch below fixes the issue for me. --- hv_netvsc_drv_freebsd.c.orig 2015-11-03 15:12:27.242856000 -0500 +++ hv_netvsc_drv_freebsd.c 2015-11-03 15:13:20.641513000 -0500 @@ -570,7 +570,8 @@ packet->vlan_tci & 0xfff; } - if (0 == m_head->m_pkthdr.csum_flags) { + /* Ignore flags for checksum already calculated or valid */ + if (0 == (m_head->m_pkthdr.csum_flags & 0xffffff)) { goto pre_send; } -- ------------------------------------------------------------------------ Larry Baird Global Technology Associates, Inc. 1992-2012 | http://www.gta.com Celebrating Twenty Years of Software Innovation | Orlando, FL Email: lab@gta.com | TEL 407-380-0220