From owner-svn-src-all@freebsd.org Tue Mar 7 09:18:54 2017 Return-Path: Delivered-To: svn-src-all@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 25937D004F8; Tue, 7 Mar 2017 09:18:54 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CBA0113DB; Tue, 7 Mar 2017 09:18:53 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v279IqLM061871; Tue, 7 Mar 2017 09:18:52 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v279Iq8Y061870; Tue, 7 Mar 2017 09:18:52 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201703070918.v279Iq8Y061870@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Date: Tue, 7 Mar 2017 09:18:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r314842 - head/sys/dev/xen/netfront X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Mar 2017 09:18:54 -0000 Author: royger Date: Tue Mar 7 09:18:52 2017 New Revision: 314842 URL: https://svnweb.freebsd.org/changeset/base/314842 Log: xen/netfront: fix inbound packet flags for checksum offload Currently netfront is setting the flags of inbound packets with the checksum not present (offloaded) to (CSUM_IP_CHECKED | CSUM_IP_VALID | CSUM_DATA_VALID | CSUM_PSEUDO_HDR). According to the mbuf(9) man page this is not the correct combination of flags, it should instead be (CSUM_DATA_VALID | CSUM_PSEUDO_HDR). Reviewed by: Wei Liu MFC after: 2 weeks Sponsored by: Citrix Systems R&D Differential revision: https://reviews.freebsd.org/D9831 Modified: head/sys/dev/xen/netfront/netfront.c Modified: head/sys/dev/xen/netfront/netfront.c ============================================================================== --- head/sys/dev/xen/netfront/netfront.c Tue Mar 7 09:17:48 2017 (r314841) +++ head/sys/dev/xen/netfront/netfront.c Tue Mar 7 09:18:52 2017 (r314842) @@ -1192,15 +1192,17 @@ xn_rxeof(struct netfront_rxq *rxq) m->m_pkthdr.rcvif = ifp; if ( rx->flags & NETRXF_data_validated ) { - /* Tell the stack the checksums are okay */ /* - * XXX this isn't necessarily the case - need to add - * check + * According to mbuf(9) the correct way to tell + * the stack that the checksum of an inbound + * packet is correct, without it actually being + * present (because the underlying interface + * doesn't provide it), is to set the + * CSUM_DATA_VALID and CSUM_PSEUDO_HDR flags, + * and the csum_data field to 0xffff. */ - - m->m_pkthdr.csum_flags |= - (CSUM_IP_CHECKED | CSUM_IP_VALID | CSUM_DATA_VALID - | CSUM_PSEUDO_HDR); + m->m_pkthdr.csum_flags |= (CSUM_DATA_VALID + | CSUM_PSEUDO_HDR); m->m_pkthdr.csum_data = 0xffff; } if ((rx->flags & NETRXF_extra_info) != 0 &&