Date: Thu, 21 Dec 2017 01:22:36 +0000 (UTC) From: Stephen Hurd <shurd@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327052 - head/sys/net Message-ID: <201712210122.vBL1Maqw046069@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: shurd Date: Thu Dec 21 01:22:36 2017 New Revision: 327052 URL: https://svnweb.freebsd.org/changeset/base/327052 Log: Don't call tcp_lro_rx() unless hardware verified TCP/UDP csum It seems that tcp_lro_rx() doesn't verify TCP checksums, so if there are bad checksums in the packets caused by invalid data, the invalid data will pass through without errors. This was noticed with the igb driver and a specific internet host: fetch http://www.mpfr.org/mpfr-current/mpfr-3.1.6.tar.xz -o test.bin && sha256 test.bin Would result in a different value sometimes. This ends up making LRO require RXCSUM to be enabled, and RXCSUM to support TCP and UDP checksums. PR: 224346 Reported by: gjb Reviewed by: sbruno Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D13561 Modified: head/sys/net/iflib.c Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Thu Dec 21 00:35:14 2017 (r327051) +++ head/sys/net/iflib.c Thu Dec 21 01:22:36 2017 (r327052) @@ -2632,8 +2632,11 @@ iflib_rxeof(iflib_rxq_t rxq, qidx_t budget) mt = mf = NULL; } } - if (lro_possible && tcp_lro_rx(&rxq->ifr_lc, m, 0) == 0) + if ((m->m_pkthdr.csum_flags & (CSUM_L4_CALC|CSUM_L4_VALID)) == + (CSUM_L4_CALC|CSUM_L4_VALID)) { + if (lro_possible && tcp_lro_rx(&rxq->ifr_lc, m, 0) == 0) continue; + } } #endif if (lro_possible) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201712210122.vBL1Maqw046069>