svn commit: r302049 - in stable/10/sys/dev/hyperv: netvsc storvsc
Sepherosa Ziehau
sephe at FreeBSD.org
Tue Jun 21 06:37:40 UTC 2016
Author: sephe
Date: Tue Jun 21 06:37:38 2016
New Revision: 302049
URL: https://svnweb.freebsd.org/changeset/base/302049
Log:
MFC 298618,298620,298688,298689
298618
hyperv/stor: Set description properly in probe devmethod
MFC after: 1 week
Sponsored by: Microsoft OSTC
298620
hyperv/hn: Change description to "Hyper-V Network Interface"
This is consistent w/ other Hyper-V devices.
MFC after: 1 week
Sponsored by: Microsoft OSTC
298688
hyperv/hn: Restart sending earlier once we gathered some free TX descs
This greatly reduces the oqdrops under heavy workload.
For TCP send/recv test (10K concurrent connections):
oqdrops is reduced by 17% on sending side, and 57% on receiving side.
For nginx-1.8/wrk-4 1KB object test (10K concurrent connections,
4 requests/connection):
oqdrops is reduced by 44% on nginx side, and 10% on wrk side.
MFC after: 1 week
Sponsored by: Microsoft OSTC
298689
hyperv/hn: Remove unapplied comment.
Chimney sending buffers are shared across channels.
MFC after: 1 week
Sponsored by: Microsoft OSTC
Modified:
stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.h
stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
stable/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.h
==============================================================================
--- stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.h Tue Jun 21 06:18:41 2016 (r302048)
+++ stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.h Tue Jun 21 06:37:38 2016 (r302049)
@@ -1185,7 +1185,8 @@ struct hn_tx_ring {
#endif
int hn_txdesc_cnt;
int hn_txdesc_avail;
- int hn_has_txeof;
+ u_short hn_has_txeof;
+ u_short hn_txdone_cnt;
int hn_sched_tx;
void (*hn_txeof)(struct hn_tx_ring *);
Modified: stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
==============================================================================
--- stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Tue Jun 21 06:18:41 2016 (r302048)
+++ stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Tue Jun 21 06:37:38 2016 (r302049)
@@ -157,6 +157,8 @@ __FBSDID("$FreeBSD$");
#define HN_DIRECT_TX_SIZE_DEF 128
+#define HN_EARLY_TXEOF_THRESH 8
+
struct hn_txdesc {
#ifndef HN_USE_TXDESC_BUFRING
SLIST_ENTRY(hn_txdesc) link;
@@ -406,7 +408,7 @@ netvsc_probe(device_t dev)
p = vmbus_get_type(dev);
if (!memcmp(p, &g_net_vsc_device_type.data, sizeof(hv_guid))) {
- device_set_desc(dev, "Synthetic Network Interface");
+ device_set_desc(dev, "Hyper-V Network Interface");
if (bootverbose)
printf("Netvsc probe... DONE \n");
@@ -805,6 +807,13 @@ hn_txdesc_hold(struct hn_txdesc *txd)
atomic_add_int(&txd->refs, 1);
}
+static __inline void
+hn_txeof(struct hn_tx_ring *txr)
+{
+ txr->hn_has_txeof = 0;
+ txr->hn_txeof(txr);
+}
+
static void
hn_tx_done(struct hv_vmbus_channel *chan, void *xpkt)
{
@@ -823,6 +832,13 @@ hn_tx_done(struct hv_vmbus_channel *chan
txr->hn_has_txeof = 1;
hn_txdesc_put(txr, txd);
+
+ ++txr->hn_txdone_cnt;
+ if (txr->hn_txdone_cnt >= HN_EARLY_TXEOF_THRESH) {
+ txr->hn_txdone_cnt = 0;
+ if (txr->hn_oactive)
+ hn_txeof(txr);
+ }
}
void
@@ -848,8 +864,8 @@ netvsc_channel_rollup(struct hv_vmbus_ch
if (txr == NULL || !txr->hn_has_txeof)
return;
- txr->hn_has_txeof = 0;
- txr->hn_txeof(txr);
+ txr->hn_txdone_cnt = 0;
+ hn_txeof(txr);
}
/*
@@ -999,8 +1015,6 @@ hn_encap(struct hn_tx_ring *txr, struct
/*
* Chimney send, if the packet could fit into one chimney buffer.
- *
- * TODO: vRSS, chimney buffer should be per-channel.
*/
if (packet->tot_data_buf_len < txr->hn_tx_chimney_size) {
netvsc_dev *net_dev = txr->hn_sc->net_dev;
Modified: stable/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c
==============================================================================
--- stable/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Tue Jun 21 06:18:41 2016 (r302048)
+++ stable/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Tue Jun 21 06:37:38 2016 (r302049)
@@ -957,6 +957,7 @@ storvsc_probe(device_t dev)
if(bootverbose)
device_printf(dev,
"Enlightened ATA/IDE detected\n");
+ device_set_desc(dev, g_drv_props_table[DRIVER_BLKVSC].drv_desc);
ret = BUS_PROBE_DEFAULT;
} else if(bootverbose)
device_printf(dev, "Emulated ATA/IDE set (hw.ata.disk_enable set)\n");
@@ -964,6 +965,7 @@ storvsc_probe(device_t dev)
case DRIVER_STORVSC:
if(bootverbose)
device_printf(dev, "Enlightened SCSI device detected\n");
+ device_set_desc(dev, g_drv_props_table[DRIVER_STORVSC].drv_desc);
ret = BUS_PROBE_DEFAULT;
break;
default:
@@ -1015,7 +1017,6 @@ storvsc_attach(device_t dev)
/* fill in device specific properties */
sc->hs_unit = device_get_unit(dev);
sc->hs_dev = hv_dev;
- device_set_desc(dev, g_drv_props_table[stor_type].drv_desc);
LIST_INIT(&sc->hs_free_list);
mtx_init(&sc->hs_lock, "hvslck", NULL, MTX_DEF);
More information about the svn-src-all
mailing list