diff options
| author | Sepherosa Ziehau <sephe@FreeBSD.org> | 2017-10-10 05:30:49 +0000 |
|---|---|---|
| committer | Sepherosa Ziehau <sephe@FreeBSD.org> | 2017-10-10 05:30:49 +0000 |
| commit | 3a60090041e052aa268cd56c910904333a2f20c5 (patch) | |
| tree | 8900aefde9bef4abd0f27a98b675e2551cbc438a /sys/dev/hyperv | |
| parent | b4d4332b4a59b0459e846e52b99ffb42851822de (diff) | |
Notes
Diffstat (limited to 'sys/dev/hyperv')
| -rw-r--r-- | sys/dev/hyperv/netvsc/if_hn.c | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/sys/dev/hyperv/netvsc/if_hn.c b/sys/dev/hyperv/netvsc/if_hn.c index b0b8f90db9ed..7c91fca70039 100644 --- a/sys/dev/hyperv/netvsc/if_hn.c +++ b/sys/dev/hyperv/netvsc/if_hn.c @@ -3316,6 +3316,8 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) struct ifreq *ifr = (struct ifreq *)data, ifr_vf; struct ifnet *vf_ifp; int mask, error = 0; + struct ifrsskey *ifrk; + struct ifrsshash *ifrh; switch (cmd) { case SIOCSIFMTU: @@ -3573,6 +3575,56 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) error = ifmedia_ioctl(ifp, ifr, &sc->hn_media, cmd); break; + case SIOCGIFRSSHASH: + ifrh = (struct ifrsshash *)data; + HN_LOCK(sc); + if (sc->hn_rx_ring_inuse == 1) { + HN_UNLOCK(sc); + ifrh->ifrh_func = RSS_FUNC_NONE; + ifrh->ifrh_types = 0; + break; + } + + if (sc->hn_rss_hash & NDIS_HASH_FUNCTION_TOEPLITZ) + ifrh->ifrh_func = RSS_FUNC_TOEPLITZ; + else + ifrh->ifrh_func = RSS_FUNC_PRIVATE; + + ifrh->ifrh_types = 0; + if (sc->hn_rss_hash & NDIS_HASH_IPV4) + ifrh->ifrh_types |= RSS_TYPE_IPV4; + if (sc->hn_rss_hash & NDIS_HASH_TCP_IPV4) + ifrh->ifrh_types |= RSS_TYPE_TCP_IPV4; + if (sc->hn_rss_hash & NDIS_HASH_IPV6) + ifrh->ifrh_types |= RSS_TYPE_IPV6; + if (sc->hn_rss_hash & NDIS_HASH_IPV6_EX) + ifrh->ifrh_types |= RSS_TYPE_IPV6_EX; + if (sc->hn_rss_hash & NDIS_HASH_TCP_IPV6) + ifrh->ifrh_types |= RSS_TYPE_TCP_IPV6; + if (sc->hn_rss_hash & NDIS_HASH_TCP_IPV6_EX) + ifrh->ifrh_types |= RSS_TYPE_TCP_IPV6_EX; + HN_UNLOCK(sc); + break; + + case SIOCGIFRSSKEY: + ifrk = (struct ifrsskey *)data; + HN_LOCK(sc); + if (sc->hn_rx_ring_inuse == 1) { + HN_UNLOCK(sc); + ifrk->ifrk_func = RSS_FUNC_NONE; + ifrk->ifrk_keylen = 0; + break; + } + if (sc->hn_rss_hash & NDIS_HASH_FUNCTION_TOEPLITZ) + ifrk->ifrk_func = RSS_FUNC_TOEPLITZ; + else + ifrk->ifrk_func = RSS_FUNC_PRIVATE; + ifrk->ifrk_keylen = NDIS_HASH_KEYSIZE_TOEPLITZ; + memcpy(ifrk->ifrk_key, sc->hn_rss.rss_key, + NDIS_HASH_KEYSIZE_TOEPLITZ); + HN_UNLOCK(sc); + break; + default: error = ether_ioctl(ifp, cmd, data); break; |
