From owner-svn-src-head@freebsd.org Mon Feb 29 09:05:34 2016 Return-Path: Delivered-To: svn-src-head@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 B9FC5AB82AD; Mon, 29 Feb 2016 09:05:34 +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 72136BBE; Mon, 29 Feb 2016 09:05:34 +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 u1T95XFO080628; Mon, 29 Feb 2016 09:05:33 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1T95Xns080626; Mon, 29 Feb 2016 09:05:33 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201602290905.u1T95Xns080626@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 29 Feb 2016 09:05:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296187 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Feb 2016 09:05:34 -0000 Author: sephe Date: Mon Feb 29 09:05:33 2016 New Revision: 296187 URL: https://svnweb.freebsd.org/changeset/base/296187 Log: hyperv/hn: Utilize mbuf flowid MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5488 Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.h Mon Feb 29 09:03:07 2016 (r296186) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.h Mon Feb 29 09:05:33 2016 (r296187) @@ -1000,10 +1000,11 @@ struct buf_ring; struct hn_rx_ring { struct ifnet *hn_ifp; - struct lro_ctrl hn_lro; + int hn_rx_idx; /* Trust csum verification on host side */ int hn_trust_hcsum; /* HN_TRUST_HCSUM_ */ + struct lro_ctrl hn_lro; u_long hn_csum_ip; u_long hn_csum_tcp; Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Mon Feb 29 09:03:07 2016 (r296186) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Mon Feb 29 09:05:33 2016 (r296187) @@ -1287,6 +1287,9 @@ skip: m_new->m_flags |= M_VLANTAG; } + m_new->m_pkthdr.flowid = rxr->hn_rx_idx; + M_HASHTYPE_SET(m_new, M_HASHTYPE_OPAQUE); + /* * Note: Moved RX completion back to hv_nv_on_receive() so all * messages (not just data messages) will trigger a response. @@ -2037,6 +2040,7 @@ hn_create_rx_data(struct hn_softc *sc) if (hn_trust_hostip) rxr->hn_trust_hcsum |= HN_TRUST_HCSUM_IP; rxr->hn_ifp = sc->hn_ifp; + rxr->hn_rx_idx = i; /* * Initialize LRO. @@ -2567,10 +2571,14 @@ hn_transmit(struct ifnet *ifp, struct mb { struct hn_softc *sc = ifp->if_softc; struct hn_tx_ring *txr; - int error; + int error, idx = 0; - /* TODO: vRSS, TX ring selection */ - txr = &sc->hn_tx_ring[0]; + /* + * Select the TX ring based on flowid + */ + if (M_HASHTYPE_GET(m) != M_HASHTYPE_NONE) + idx = m->m_pkthdr.flowid % sc->hn_tx_ring_cnt; + txr = &sc->hn_tx_ring[idx]; error = drbr_enqueue(ifp, txr->hn_mbuf_br, m); if (error)