From owner-svn-src-all@freebsd.org Tue Dec 12 01:20:47 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 4BBE1E82E10; Tue, 12 Dec 2017 01:20:47 +0000 (UTC) (envelope-from emaste@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 17312304C; Tue, 12 Dec 2017 01:20:47 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBC1Kk2I056448; Tue, 12 Dec 2017 01:20:46 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBC1Kkar056447; Tue, 12 Dec 2017 01:20:46 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201712120120.vBC1Kkar056447@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 12 Dec 2017 01:20:46 +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: r326788 - stable/11/sys/dev/vnic X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/11/sys/dev/vnic X-SVN-Commit-Revision: 326788 X-SVN-Commit-Repository: base 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.25 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, 12 Dec 2017 01:20:47 -0000 Author: emaste Date: Tue Dec 12 01:20:45 2017 New Revision: 326788 URL: https://svnweb.freebsd.org/changeset/base/326788 Log: MFC r326597: vnic: apply hardware L3 checksum only for IPv4 Previously we set the csum_l3 flag for IPv4 and IPv6, but only IPv4 should have header checksumming applied. Prompted by Linux commit fa6d7cb5d76cf0467c61420fc9238045aedfd379. Sponsored by: The FreeBSD Foundation Modified: stable/11/sys/dev/vnic/nicvf_queues.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/vnic/nicvf_queues.c ============================================================================== --- stable/11/sys/dev/vnic/nicvf_queues.c Tue Dec 12 01:19:18 2017 (r326787) +++ stable/11/sys/dev/vnic/nicvf_queues.c Tue Dec 12 01:20:45 2017 (r326788) @@ -1802,6 +1802,8 @@ nicvf_sq_add_hdr_subdesc(struct snd_queue *sq, int qen if (mbuf == NULL) return (ENOBUFS); } + if (mbuf->m_pkthdr.csum_flags & CSUM_IP) + hdr->csum_l3 = 1; /* Enable IP csum calculation */ ip = (struct ip *)(mbuf->m_data + ehdrlen); iphlen = ip->ip_hl << 2; @@ -1809,13 +1811,10 @@ nicvf_sq_add_hdr_subdesc(struct snd_queue *sq, int qen proto = ip->ip_p; break; #endif - default: - hdr->csum_l3 = 0; } #if defined(INET6) || defined(INET) if (poff > 0 && mbuf->m_pkthdr.csum_flags != 0) { - hdr->csum_l3 = 1; /* Enable IP csum calculation */ switch (proto) { case IPPROTO_TCP: if ((mbuf->m_pkthdr.csum_flags & CSUM_TCP) == 0)