From owner-svn-src-all@freebsd.org Thu Oct 20 13:48:30 2016 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 64073C19C91; Thu, 20 Oct 2016 13:48:30 +0000 (UTC) (envelope-from gallatin@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 3401C5F9; Thu, 20 Oct 2016 13:48:30 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9KDmTKJ022297; Thu, 20 Oct 2016 13:48:29 GMT (envelope-from gallatin@FreeBSD.org) Received: (from gallatin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9KDmTpE022296; Thu, 20 Oct 2016 13:48:29 GMT (envelope-from gallatin@FreeBSD.org) Message-Id: <201610201348.u9KDmTpE022296@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gallatin set sender to gallatin@FreeBSD.org using -f From: Andrew Gallatin Date: Thu, 20 Oct 2016 13:48:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307673 - head/sys/net 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: Thu, 20 Oct 2016 13:48:30 -0000 Author: gallatin Date: Thu Oct 20 13:48:29 2016 New Revision: 307673 URL: https://svnweb.freebsd.org/changeset/base/307673 Log: Clear mbuf hashtype on loopback when RSS is enabled. The hashtype on an outgoing mbuf reflects the correct hash on the transmit side of the connection. If this hash persists on loopback, the receiving RSS/PCBGROUP code will use it to look up the pcbgroup for the transmit side, which will often not match the pcbgroup for the receive side of the connection. This leads to TCP connections hanging, and dropping the SYN/ACK packet. This is essentially the same as having a hardware network card generate mbufs with an incorrect RSS hash. There are a number of places which can set the hash on transmit, so the simplest fix is to simply clear the hash at loopback time. Clearing the hash allows a new, correct hash to be calculated in software on the receive side. Reviewed by: jtl Discussed with: adrian Sponsored by: Netflix Modified: head/sys/net/if_loop.c Modified: head/sys/net/if_loop.c ============================================================================== --- head/sys/net/if_loop.c Thu Oct 20 13:12:19 2016 (r307672) +++ head/sys/net/if_loop.c Thu Oct 20 13:48:29 2016 (r307673) @@ -36,6 +36,7 @@ #include "opt_inet.h" #include "opt_inet6.h" +#include "opt_rss.h" #include #include @@ -224,6 +225,10 @@ looutput(struct ifnet *ifp, struct mbuf if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); if_inc_counter(ifp, IFCOUNTER_OBYTES, m->m_pkthdr.len); +#ifdef RSS + M_HASHTYPE_CLEAR(m); +#endif + /* BPF writes need to be handled specially. */ if (dst->sa_family == AF_UNSPEC || dst->sa_family == pseudo_AF_HDRCMPLT) bcopy(dst->sa_data, &af, sizeof(af));