Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
Show First 20 Lines • Show All 2,352 Lines • ▼ Show 20 Lines | #endif | ||||
sc->hn_rx_ring = malloc(sizeof(struct hn_rx_ring) * sc->hn_rx_ring_cnt, | sc->hn_rx_ring = malloc(sizeof(struct hn_rx_ring) * sc->hn_rx_ring_cnt, | ||||
M_NETVSC, M_WAITOK | M_ZERO); | M_NETVSC, M_WAITOK | M_ZERO); | ||||
#if defined(INET) || defined(INET6) | #if defined(INET) || defined(INET6) | ||||
#if __FreeBSD_version >= 1100095 | #if __FreeBSD_version >= 1100095 | ||||
lroent_cnt = hn_lro_entry_count; | lroent_cnt = hn_lro_entry_count; | ||||
if (lroent_cnt < TCP_LRO_ENTRIES) | if (lroent_cnt < TCP_LRO_ENTRIES) | ||||
lroent_cnt = TCP_LRO_ENTRIES; | lroent_cnt = TCP_LRO_ENTRIES; | ||||
if (bootverbose) | |||||
device_printf(dev, "LRO: entry count %d\n", lroent_cnt); | device_printf(dev, "LRO: entry count %d\n", lroent_cnt); | ||||
#endif | #endif | ||||
#endif /* INET || INET6 */ | #endif /* INET || INET6 */ | ||||
ctx = device_get_sysctl_ctx(dev); | ctx = device_get_sysctl_ctx(dev); | ||||
child = SYSCTL_CHILDREN(device_get_sysctl_tree(dev)); | child = SYSCTL_CHILDREN(device_get_sysctl_tree(dev)); | ||||
/* Create dev.hn.UNIT.rx sysctl tree */ | /* Create dev.hn.UNIT.rx sysctl tree */ | ||||
sc->hn_rx_sysctl_tree = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "rx", | sc->hn_rx_sysctl_tree = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "rx", | ||||
▲ Show 20 Lines • Show All 954 Lines • ▼ Show 20 Lines | hn_synth_alloc_subchans(struct hn_softc *sc, int *nsubch) | ||||
* table entries. | * table entries. | ||||
*/ | */ | ||||
error = hn_rndis_get_rsscaps(sc, &rxr_cnt); | error = hn_rndis_get_rsscaps(sc, &rxr_cnt); | ||||
if (error) { | if (error) { | ||||
/* No RSS; this is benign. */ | /* No RSS; this is benign. */ | ||||
*nsubch = 0; | *nsubch = 0; | ||||
return (0); | return (0); | ||||
} | } | ||||
if (bootverbose) { | |||||
if_printf(sc->hn_ifp, "RX rings offered %u, requested %d\n", | if_printf(sc->hn_ifp, "RX rings offered %u, requested %d\n", | ||||
rxr_cnt, nchan); | rxr_cnt, nchan); | ||||
} | |||||
if (nchan > rxr_cnt) | if (nchan > rxr_cnt) | ||||
nchan = rxr_cnt; | nchan = rxr_cnt; | ||||
if (nchan == 1) { | if (nchan == 1) { | ||||
if_printf(sc->hn_ifp, "only 1 channel is supported, no vRSS\n"); | if_printf(sc->hn_ifp, "only 1 channel is supported, no vRSS\n"); | ||||
*nsubch = 0; | *nsubch = 0; | ||||
return (0); | return (0); | ||||
} | } | ||||
/* | /* | ||||
* Allocate sub-channels from NVS. | * Allocate sub-channels from NVS. | ||||
*/ | */ | ||||
*nsubch = nchan - 1; | *nsubch = nchan - 1; | ||||
error = hn_nvs_alloc_subchans(sc, nsubch); | error = hn_nvs_alloc_subchans(sc, nsubch); | ||||
if (error || *nsubch == 0) { | if (error || *nsubch == 0) { | ||||
/* Failed to allocate sub-channels. */ | /* Failed to allocate sub-channels. */ | ||||
*nsubch = 0; | *nsubch = 0; | ||||
▲ Show 20 Lines • Show All 397 Lines • Show Last 20 Lines |