Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 3 Nov 2015 15:01:41 -0500
From:      Larry Baird <lab@gta.com>
To:        freebsd-virtualization@freebsd.org
Subject:   Re: Issues gatewaying through Hyper-V
Message-ID:  <20151103200141.GB90948@gta.com>
In-Reply-To: <20151030034535.GA19514@gta.com>
References:  <20151030034535.GA19514@gta.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20151103200141.GB90948>