From owner-svn-src-stable-11@freebsd.org Tue Mar 21 08:30:07 2017 Return-Path: Delivered-To: svn-src-stable-11@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 D1912D16B0D; Tue, 21 Mar 2017 08:30:07 +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 97C021027; Tue, 21 Mar 2017 08:30:07 +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 v2L8U6cf002097; Tue, 21 Mar 2017 08:30:06 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2L8U6m5002096; Tue, 21 Mar 2017 08:30:06 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201703210830.v2L8U6m5002096@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, 21 Mar 2017 08:30:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r315665 - stable/11/sys/dev/xen/netfront X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Mar 2017 08:30:07 -0000 Author: royger Date: Tue Mar 21 08:30:06 2017 New Revision: 315665 URL: https://svnweb.freebsd.org/changeset/base/315665 Log: MFC r314842: xen/netfront: fix inbound packet flags for checksum offload Reviewed by: Wei Liu Sponsored by: Citrix Systems R&D Modified: stable/11/sys/dev/xen/netfront/netfront.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/xen/netfront/netfront.c ============================================================================== --- stable/11/sys/dev/xen/netfront/netfront.c Tue Mar 21 08:24:40 2017 (r315664) +++ stable/11/sys/dev/xen/netfront/netfront.c Tue Mar 21 08:30:06 2017 (r315665) @@ -1178,15 +1178,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 &&