summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsephe <sephe@FreeBSD.org>2016-02-22 06:28:18 +0000
committersephe <sephe@FreeBSD.org>2016-02-22 06:28:18 +0000
commitf934858b00eda7d7460269d213081d11998103d4 (patch)
tree9331cc86095315a89679934ba97f7bcf483db77e
parent0c4347a68ad817361671d46a6732edf603e2a04e (diff)
downloadFreeBSD-src-f934858b00eda7d7460269d213081d11998103d4.zip
FreeBSD-src-f934858b00eda7d7460269d213081d11998103d4.tar.gz
hyperv/hn: Add TX method for txeof processing.
Preamble to implement ifnet.if_transmit method. Reviewed by: adrian Approved by: adrian (mentor) MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5346
-rw-r--r--sys/dev/hyperv/netvsc/hv_net_vsc.h3
-rw-r--r--sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c14
2 files changed, 10 insertions, 7 deletions
diff --git a/sys/dev/hyperv/netvsc/hv_net_vsc.h b/sys/dev/hyperv/netvsc/hv_net_vsc.h
index f533833..7750ad4 100644
--- a/sys/dev/hyperv/netvsc/hv_net_vsc.h
+++ b/sys/dev/hyperv/netvsc/hv_net_vsc.h
@@ -1026,9 +1026,10 @@ struct hn_tx_ring {
#endif
int hn_txdesc_cnt;
int hn_txdesc_avail;
- int hn_txeof;
+ int hn_has_txeof;
int hn_sched_tx;
+ void (*hn_txeof)(struct hn_tx_ring *);
struct taskqueue *hn_tx_taskq;
struct task hn_tx_task;
struct task hn_txeof_task;
diff --git a/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c b/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
index 3f3b6a7..5c4476f 100644
--- a/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
+++ b/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
@@ -664,7 +664,7 @@ hn_tx_done(void *xpkt)
packet->compl.send.send_completion_tid;
txr = txd->txr;
- txr->hn_txeof = 1;
+ txr->hn_has_txeof = 1;
hn_txdesc_put(txr, txd);
}
@@ -684,11 +684,11 @@ netvsc_channel_rollup(struct hv_device *device_ctx)
}
#endif
- if (!txr->hn_txeof)
+ if (!txr->hn_has_txeof)
return;
- txr->hn_txeof = 0;
- hn_start_txeof(txr);
+ txr->hn_has_txeof = 0;
+ txr->hn_txeof(txr);
}
/*
@@ -976,12 +976,12 @@ again:
* commands to run? Ask netvsc_channel_rollup()
* to kick start later.
*/
- txr->hn_txeof = 1;
+ txr->hn_has_txeof = 1;
if (!send_failed) {
txr->hn_send_failed++;
send_failed = 1;
/*
- * Try sending again after set hn_txeof;
+ * Try sending again after set hn_has_txeof;
* in case that we missed the last
* netvsc_channel_rollup().
*/
@@ -2111,6 +2111,8 @@ hn_create_tx_ring(struct hn_softc *sc, int id)
*/
txr->hn_sched_tx = 1;
+ txr->hn_txeof = hn_start_txeof; /* TODO: if_transmit */
+
parent_dtag = bus_get_dma_tag(sc->hn_dev);
/* DMA tag for RNDIS messages. */
OpenPOWER on IntegriCloud