From owner-freebsd-xen@freebsd.org Thu Nov 5 17:53:30 2015 Return-Path: Delivered-To: freebsd-xen@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 16D93A27A64 for ; Thu, 5 Nov 2015 17:53:30 +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 C484F19BC for ; Thu, 5 Nov 2015 17:53:29 +0000 (UTC) (envelope-from lab@gta.com) Received: (qmail 27061 invoked by uid 1000); 5 Nov 2015 17:53:25 -0000 Date: Thu, 5 Nov 2015 12:53:25 -0500 From: Larry Baird To: Alan Somers Cc: Roger Pau Monn?? , "freebsd-xen@freebsd.org" , "ken@FreeBSD.org" Subject: Re: Checksum forwarding issue on XEN Message-ID: <20151105175325.GA13746@gta.com> References: <20151103201250.GA92469@gta.com> <563B72B2.6060308@citrix.com> <20151105160057.GA2268@gta.com> <563B8B72.5050800@spectralogic.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <563B8B72.5050800@spectralogic.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: freebsd-xen@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Discussion of the freebsd port to xen - implementation and usage List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Nov 2015 17:53:30 -0000 Alan, > Though it looks weird, I think it's actually correct. th->th_sum lies > within the packet that it inspected by in_cksum_skip. in_cksum_skip > skips the ethernet and IP headers, but not the TCP header. So it > consumes whatever value was previously set in th_sum. In any case, it > will be easy to check this code by running the builtin unit tests. Just > build the kernel with XNB_DEBUG defined, instantiate an xnb interface, > and do "sysctl dev.xnb.0.unit_test_results". I agress the code looks strange but is probably correct as far as it goes. The code assumes that there aren't any IP options. I am not sure if this is a valid assumption or not. The code also assumes packet is IPv4. > FWIW, there is a performance problem with Xen and checksums. Whenever > FreeBSD is used as a dom0, checksum offloading should be disabled on the > netfronts. I don't know if the same problem exists on other OSes, but > it might. See xnb(4) for more details about this problem. Ok I read the CAVEATS on xnb(4). Let me play with that for a bit. I have an ugly code patch, that works for me with out disabling checksum offloading. Before I share, let me do a few more tests. Larry -- ------------------------------------------------------------------------ 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