hyperv/hn: Increase LRO entry count to 128 by default
hn(4) only has one RX ring currently, so default 8 LRO entries are too small. Reviewed by: adrian Approved by: adrian (mentor) MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5166
This commit is contained in:
parent
1e4bb37d22
commit
e35e485b04
@ -132,6 +132,8 @@ __FBSDID("$FreeBSD$");
|
||||
/* YYY should get it from the underlying channel */
|
||||
#define HN_TX_DESC_CNT 512
|
||||
|
||||
#define HN_LROENT_CNT_DEF 128
|
||||
|
||||
#define HN_RNDIS_MSG_LEN \
|
||||
(sizeof(rndis_msg) + \
|
||||
RNDIS_VLAN_PPI_SIZE + \
|
||||
@ -232,6 +234,13 @@ TUNABLE_INT("dev.hn.tx_chimney_size", &hn_tx_chimney_size);
|
||||
static int hn_direct_tx_size = HN_DIRECT_TX_SIZE_DEF;
|
||||
TUNABLE_INT("dev.hn.direct_tx_size", &hn_direct_tx_size);
|
||||
|
||||
#if defined(INET) || defined(INET6)
|
||||
#if __FreeBSD_version >= 1100095
|
||||
static int hn_lro_entry_count = HN_LROENT_CNT_DEF;
|
||||
TUNABLE_INT("dev.hn.lro_entry_count", &hn_lro_entry_count);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Forward declarations
|
||||
*/
|
||||
@ -334,6 +343,11 @@ netvsc_attach(device_t dev)
|
||||
int error;
|
||||
#if __FreeBSD_version >= 1100045
|
||||
int tso_maxlen;
|
||||
#endif
|
||||
#if defined(INET) || defined(INET6)
|
||||
#if __FreeBSD_version >= 1100095
|
||||
int lroent_cnt;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
sc = device_get_softc(dev);
|
||||
@ -417,9 +431,17 @@ netvsc_attach(device_t dev)
|
||||
}
|
||||
|
||||
#if defined(INET) || defined(INET6)
|
||||
#if __FreeBSD_version >= 1100095
|
||||
lroent_cnt = hn_lro_entry_count;
|
||||
if (lroent_cnt < TCP_LRO_ENTRIES)
|
||||
lroent_cnt = TCP_LRO_ENTRIES;
|
||||
tcp_lro_init_args(&sc->hn_lro, ifp, lroent_cnt, 0);
|
||||
device_printf(dev, "LRO: entry count %d\n", lroent_cnt);
|
||||
#else
|
||||
tcp_lro_init(&sc->hn_lro);
|
||||
/* Driver private LRO settings */
|
||||
sc->hn_lro.ifp = ifp;
|
||||
#endif
|
||||
#ifdef HN_LRO_HIWAT
|
||||
sc->hn_lro.lro_hiwat = sc->hn_lro_hiwat;
|
||||
#endif
|
||||
@ -547,6 +569,12 @@ netvsc_attach(device_t dev)
|
||||
SYSCTL_ADD_INT(dc_ctx, dc_child, OID_AUTO, "direct_tx_size",
|
||||
CTLFLAG_RD, &hn_direct_tx_size, 0,
|
||||
"Size of the packet for direct transmission");
|
||||
#if defined(INET) || defined(INET6)
|
||||
#if __FreeBSD_version >= 1100095
|
||||
SYSCTL_ADD_INT(dc_ctx, dc_child, OID_AUTO, "lro_entry_count",
|
||||
CTLFLAG_RD, &hn_lro_entry_count, 0, "LRO entry count");
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
return (0);
|
||||
|
Loading…
x
Reference in New Issue
Block a user