Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/xen/netback/netback.c
Show First 20 Lines • Show All 1,423 Lines • ▼ Show 20 Lines | |||||
* Transfers packets from the Xen ring to the host's generic networking stack | * Transfers packets from the Xen ring to the host's generic networking stack | ||||
* | * | ||||
* \param arg Callback argument registerd during event channel | * \param arg Callback argument registerd during event channel | ||||
* binding - the xnb_softc for this instance. | * binding - the xnb_softc for this instance. | ||||
*/ | */ | ||||
static void | static void | ||||
xnb_intr(void *arg) | xnb_intr(void *arg) | ||||
{ | { | ||||
struct epoch_tracker et; | |||||
struct xnb_softc *xnb; | struct xnb_softc *xnb; | ||||
struct ifnet *ifp; | struct ifnet *ifp; | ||||
netif_tx_back_ring_t *txb; | netif_tx_back_ring_t *txb; | ||||
RING_IDX req_prod_local; | RING_IDX req_prod_local; | ||||
xnb = (struct xnb_softc *)arg; | xnb = (struct xnb_softc *)arg; | ||||
ifp = xnb->xnb_ifp; | ifp = xnb->xnb_ifp; | ||||
txb = &xnb->ring_configs[XNB_RING_TYPE_TX].back_ring.tx_ring; | txb = &xnb->ring_configs[XNB_RING_TYPE_TX].back_ring.tx_ring; | ||||
mtx_lock(&xnb->tx_lock); | mtx_lock(&xnb->tx_lock); | ||||
NET_EPOCH_ENTER(et); | |||||
do { | do { | ||||
int notify; | int notify; | ||||
req_prod_local = txb->sring->req_prod; | req_prod_local = txb->sring->req_prod; | ||||
xen_rmb(); | xen_rmb(); | ||||
for (;;) { | for (;;) { | ||||
struct mbuf *mbufc; | struct mbuf *mbufc; | ||||
int err; | int err; | ||||
Show All 9 Lines | do { | ||||
RING_PUSH_RESPONSES_AND_CHECK_NOTIFY(txb, notify); | RING_PUSH_RESPONSES_AND_CHECK_NOTIFY(txb, notify); | ||||
if (notify != 0) | if (notify != 0) | ||||
xen_intr_signal(xnb->xen_intr_handle); | xen_intr_signal(xnb->xen_intr_handle); | ||||
txb->sring->req_event = txb->req_cons + 1; | txb->sring->req_event = txb->req_cons + 1; | ||||
xen_mb(); | xen_mb(); | ||||
} while (txb->sring->req_prod != req_prod_local) ; | } while (txb->sring->req_prod != req_prod_local) ; | ||||
NET_EPOCH_EXIT(et); | |||||
mtx_unlock(&xnb->tx_lock); | mtx_unlock(&xnb->tx_lock); | ||||
xnb_start(ifp); | xnb_start(ifp); | ||||
} | } | ||||
/** | /** | ||||
* Build a struct xnb_pkt based on netif_tx_request's from a netif tx ring. | * Build a struct xnb_pkt based on netif_tx_request's from a netif tx ring. | ||||
▲ Show 20 Lines • Show All 1,041 Lines • Show Last 20 Lines |