Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
Show First 20 Lines • Show All 678 Lines • ▼ Show 20 Lines | txd = (struct hn_txdesc *)(uintptr_t) | ||||
packet->compl.send.send_completion_tid; | packet->compl.send.send_completion_tid; | ||||
txr = txd->txr; | txr = txd->txr; | ||||
txr->hn_has_txeof = 1; | txr->hn_has_txeof = 1; | ||||
hn_txdesc_put(txr, txd); | hn_txdesc_put(txr, txd); | ||||
} | } | ||||
void | void | ||||
netvsc_channel_rollup(struct hv_device *device_ctx) | netvsc_channel_rollup(struct hv_vmbus_channel *chan) | ||||
{ | { | ||||
struct hv_device *device_ctx = chan->device; | |||||
struct hn_softc *sc = device_get_softc(device_ctx->device); | struct hn_softc *sc = device_get_softc(device_ctx->device); | ||||
struct hn_tx_ring *txr = &sc->hn_tx_ring[0]; /* TODO: vRSS */ | struct hn_tx_ring *txr = &sc->hn_tx_ring[0]; /* TODO: vRSS */ | ||||
#if defined(INET) || defined(INET6) | #if defined(INET) || defined(INET6) | ||||
struct hn_rx_ring *rxr = &sc->hn_rx_ring[0]; /* TODO: vRSS */ | struct hn_rx_ring *rxr = &sc->hn_rx_ring[0]; /* TODO: vRSS */ | ||||
struct lro_ctrl *lro = &rxr->hn_lro; | struct lro_ctrl *lro = &rxr->hn_lro; | ||||
struct lro_entry *queued; | struct lro_entry *queued; | ||||
while ((queued = SLIST_FIRST(&lro->lro_active)) != NULL) { | while ((queued = SLIST_FIRST(&lro->lro_active)) != NULL) { | ||||
▲ Show 20 Lines • Show All 433 Lines • ▼ Show 20 Lines | |||||
/* | /* | ||||
* Called when we receive a data packet from the "wire" on the | * Called when we receive a data packet from the "wire" on the | ||||
* specified device | * specified device | ||||
* | * | ||||
* Note: This is no longer used as a callback | * Note: This is no longer used as a callback | ||||
*/ | */ | ||||
int | int | ||||
netvsc_recv(struct hv_device *device_ctx, netvsc_packet *packet, | netvsc_recv(struct hv_vmbus_channel *chan, netvsc_packet *packet, | ||||
rndis_tcp_ip_csum_info *csum_info) | rndis_tcp_ip_csum_info *csum_info) | ||||
{ | { | ||||
struct hv_device *device_ctx = chan->device; | |||||
struct hn_softc *sc = device_get_softc(device_ctx->device); | struct hn_softc *sc = device_get_softc(device_ctx->device); | ||||
struct hn_rx_ring *rxr = &sc->hn_rx_ring[0]; /* TODO: vRSS */ | struct hn_rx_ring *rxr = &sc->hn_rx_ring[0]; /* TODO: vRSS */ | ||||
struct mbuf *m_new; | struct mbuf *m_new; | ||||
struct ifnet *ifp; | struct ifnet *ifp; | ||||
int size, do_lro = 0, do_csum = 1; | int size, do_lro = 0, do_csum = 1; | ||||
if (sc == NULL) { | if (sc == NULL) { | ||||
return (0); /* TODO: KYS how can this be! */ | return (0); /* TODO: KYS how can this be! */ | ||||
▲ Show 20 Lines • Show All 149 Lines • ▼ Show 20 Lines | #if defined(INET) || defined(INET6) | ||||
} | } | ||||
#endif | #endif | ||||
} | } | ||||
/* We're not holding the lock here, so don't release it */ | /* We're not holding the lock here, so don't release it */ | ||||
(*ifp->if_input)(ifp, m_new); | (*ifp->if_input)(ifp, m_new); | ||||
return (0); | return (0); | ||||
} | |||||
void | |||||
netvsc_recv_rollup(struct hv_device *device_ctx __unused) | |||||
{ | |||||
} | } | ||||
/* | /* | ||||
* Rules for using sc->temp_unusable: | * Rules for using sc->temp_unusable: | ||||
* 1. sc->temp_unusable can only be read or written while holding NV_LOCK() | * 1. sc->temp_unusable can only be read or written while holding NV_LOCK() | ||||
* 2. code reading sc->temp_unusable under NV_LOCK(), and finding | * 2. code reading sc->temp_unusable under NV_LOCK(), and finding | ||||
* sc->temp_unusable set, must release NV_LOCK() and exit | * sc->temp_unusable set, must release NV_LOCK() and exit | ||||
* 3. to retain exclusive control of the interface, | * 3. to retain exclusive control of the interface, | ||||
▲ Show 20 Lines • Show All 1,388 Lines • Show Last 20 Lines |