From owner-freebsd-xen@freebsd.org Tue Nov 3 20:12:54 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 7567CA25DD5 for ; Tue, 3 Nov 2015 20:12:54 +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 21D2B14E6 for ; Tue, 3 Nov 2015 20:12:53 +0000 (UTC) (envelope-from lab@gta.com) Received: (qmail 94262 invoked by uid 1000); 3 Nov 2015 20:12:50 -0000 Date: Tue, 3 Nov 2015 15:12:50 -0500 From: Larry Baird To: freebsd-xen@freebsd.org Subject: Checksum forwarding issue on XEN Message-ID: <20151103201250.GA92469@gta.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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: Tue, 03 Nov 2015 20:12:54 -0000 Has anybody made any progress on "Bug 188261 - [xen] FreeBSD DomU PVHVM guests cannot 'route' traffic for other Xen PV guests on same Dom0 Host." (https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=188261)? The code for checksum calculation in the function xnb_add_mbuf_cksum() looks suspect. switch (iph->ip_p) { case IPPROTO_TCP: if (mbufc->m_pkthdr.csum_flags & CSUM_IP_VALID) { size_t tcplen = ntohs(iph->ip_len) - sizeof(struct ip); struct tcphdr *th = (struct tcphdr*)(iph + 1); th->th_sum = in_pseudo(iph->ip_src.s_addr, iph->ip_dst.s_addr, htons(IPPROTO_TCP + tcplen)); th->th_sum = in_cksum_skip(mbufc, sizeof(struct ether_header) + ntohs(iph->ip_len), sizeof(struct ether_header) + (iph->ip_hl << 2)); } break; case IPPROTO_UDP: if (mbufc->m_pkthdr.csum_flags & CSUM_IP_VALID) { size_t udplen = ntohs(iph->ip_len) - sizeof(struct ip); struct udphdr *uh = (struct udphdr*)(iph + 1); uh->uh_sum = in_pseudo(iph->ip_src.s_addr, iph->ip_dst.s_addr, htons(IPPROTO_UDP + udplen)); uh->uh_sum = in_cksum_skip(mbufc, sizeof(struct ether_header) + ntohs(iph->ip_len), sizeof(struct ether_header) + (iph->ip_hl << 2)); } break; default: break; } Both in_pseudo() and in_cksum_skip() set the same checksum. Does this make since to anybody? 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