Index: sys/dev/hyperv/netvsc/hv_net_vsc.h =================================================================== --- sys/dev/hyperv/netvsc/hv_net_vsc.h +++ sys/dev/hyperv/netvsc/hv_net_vsc.h @@ -1000,10 +1000,11 @@ 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; Index: sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c =================================================================== --- sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c +++ sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c @@ -1287,6 +1287,9 @@ 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 @@ 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 @@ { 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)