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
This commit is contained in:
parent
5cb0a42c8c
commit
ed3960349b
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=295877
@ -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;
|
||||
|
@ -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 @@ hn_start_locked(struct hn_tx_ring *txr, int len)
|
||||
* 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. */
|
||||
|
Loading…
Reference in New Issue
Block a user