From owner-svn-src-stable-10@freebsd.org Tue Oct 11 05:47:53 2016 Return-Path: Delivered-To: svn-src-stable-10@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 7D906C075C7; Tue, 11 Oct 2016 05:47:53 +0000 (UTC) (envelope-from sephe@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 30E6678E; Tue, 11 Oct 2016 05:47:53 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9B5lqTT069132; Tue, 11 Oct 2016 05:47:52 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9B5lq85069131; Tue, 11 Oct 2016 05:47:52 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201610110547.u9B5lq85069131@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 11 Oct 2016 05:47:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r307015 - stable/10/sys/dev/hyperv/netvsc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Oct 2016 05:47:53 -0000 Author: sephe Date: Tue Oct 11 05:47:52 2016 New Revision: 307015 URL: https://svnweb.freebsd.org/changeset/base/307015 Log: MFC 302544 hyperv/hn: Add tunable to allow tcp_lro_queue_mbuf() Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6841 Modified: stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Tue Oct 11 05:44:36 2016 (r307014) +++ stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Tue Oct 11 05:47:52 2016 (r307015) @@ -299,6 +299,12 @@ static int hn_tx_swq_depth = 0; SYSCTL_INT(_hw_hn, OID_AUTO, tx_swq_depth, CTLFLAG_RDTUN, &hn_tx_swq_depth, 0, "Depth of IFQ or BUFRING"); +#if __FreeBSD_version >= 1100095 +static u_int hn_lro_mbufq_depth = 0; +SYSCTL_UINT(_hw_hn, OID_AUTO, lro_mbufq_depth, CTLFLAG_RDTUN, + &hn_lro_mbufq_depth, 0, "Depth of LRO mbuf queue"); +#endif + static u_int hn_cpu_index; /* @@ -1300,6 +1306,19 @@ hv_m_append(struct mbuf *m0, int len, c_ return (remainder == 0); } +#if defined(INET) || defined(INET6) +static __inline int +hn_lro_rx(struct lro_ctrl *lc, struct mbuf *m) +{ +#if __FreeBSD_version >= 1100095 + if (hn_lro_mbufq_depth) { + tcp_lro_queue_mbuf(lc, m); + return 0; + } +#endif + return tcp_lro_rx(lc, m, 0); +} +#endif /* * Called when we receive a data packet from the "wire" on the @@ -1505,7 +1524,7 @@ skip: if (lro->lro_cnt) { rxr->hn_lro_tried++; - if (tcp_lro_rx(lro, m_new, 0) == 0) { + if (hn_lro_rx(lro, m_new) == 0) { /* DONE! */ return 0; } @@ -2269,7 +2288,8 @@ hn_create_rx_data(struct hn_softc *sc, i */ #if defined(INET) || defined(INET6) #if __FreeBSD_version >= 1100095 - tcp_lro_init_args(&rxr->hn_lro, sc->hn_ifp, lroent_cnt, 0); + tcp_lro_init_args(&rxr->hn_lro, sc->hn_ifp, lroent_cnt, + hn_lro_mbufq_depth); #else tcp_lro_init(&rxr->hn_lro); rxr->hn_lro.ifp = sc->hn_ifp;