use netmap_rx_irq() / netmap_tx_irq() to handle interrupts in
netmap mode, removing the logic from individual drivers. (note: if_lem.c not updated yet due to some other pending modifications)
This commit is contained in:
parent
849bec0e76
commit
d61ba75247
@ -3828,17 +3828,9 @@ em_txeof(struct tx_ring *txr)
|
||||
|
||||
EM_TX_LOCK_ASSERT(txr);
|
||||
#ifdef DEV_NETMAP
|
||||
if (ifp->if_capenable & IFCAP_NETMAP) {
|
||||
struct netmap_adapter *na = NA(ifp);
|
||||
|
||||
selwakeuppri(&na->tx_rings[txr->me].si, PI_NET);
|
||||
EM_TX_UNLOCK(txr);
|
||||
EM_CORE_LOCK(adapter);
|
||||
selwakeuppri(&na->tx_si, PI_NET);
|
||||
EM_CORE_UNLOCK(adapter);
|
||||
EM_TX_LOCK(txr);
|
||||
if (netmap_tx_irq(ifp, txr->me |
|
||||
(NETMAP_LOCKED_ENTER | NETMAP_LOCKED_EXIT)))
|
||||
return;
|
||||
}
|
||||
#endif /* DEV_NETMAP */
|
||||
|
||||
/* No work, make sure watchdog is off */
|
||||
@ -4440,17 +4432,8 @@ em_rxeof(struct rx_ring *rxr, int count, int *done)
|
||||
EM_RX_LOCK(rxr);
|
||||
|
||||
#ifdef DEV_NETMAP
|
||||
if (ifp->if_capenable & IFCAP_NETMAP) {
|
||||
struct netmap_adapter *na = NA(ifp);
|
||||
|
||||
na->rx_rings[rxr->me].nr_kflags |= NKR_PENDINTR;
|
||||
selwakeuppri(&na->rx_rings[rxr->me].si, PI_NET);
|
||||
EM_RX_UNLOCK(rxr);
|
||||
EM_CORE_LOCK(adapter);
|
||||
selwakeuppri(&na->rx_si, PI_NET);
|
||||
EM_CORE_UNLOCK(adapter);
|
||||
return (0);
|
||||
}
|
||||
if (netmap_rx_irq(ifp, rxr->me | NETMAP_LOCKED_ENTER, &processed))
|
||||
return (FALSE);
|
||||
#endif /* DEV_NETMAP */
|
||||
|
||||
for (i = rxr->next_to_check, processed = 0; count != 0;) {
|
||||
|
@ -3897,17 +3897,9 @@ igb_txeof(struct tx_ring *txr)
|
||||
IGB_TX_LOCK_ASSERT(txr);
|
||||
|
||||
#ifdef DEV_NETMAP
|
||||
if (ifp->if_capenable & IFCAP_NETMAP) {
|
||||
struct netmap_adapter *na = NA(ifp);
|
||||
|
||||
selwakeuppri(&na->tx_rings[txr->me].si, PI_NET);
|
||||
IGB_TX_UNLOCK(txr);
|
||||
IGB_CORE_LOCK(adapter);
|
||||
selwakeuppri(&na->tx_si, PI_NET);
|
||||
IGB_CORE_UNLOCK(adapter);
|
||||
IGB_TX_LOCK(txr);
|
||||
return FALSE;
|
||||
}
|
||||
if (netmap_tx_irq(ifp, txr->me |
|
||||
(NETMAP_LOCKED_ENTER|NETMAP_LOCKED_EXIT)))
|
||||
return (FALSE);
|
||||
#endif /* DEV_NETMAP */
|
||||
if (txr->tx_avail == adapter->num_tx_desc) {
|
||||
txr->queue_status = IGB_QUEUE_IDLE;
|
||||
@ -4761,17 +4753,8 @@ igb_rxeof(struct igb_queue *que, int count, int *done)
|
||||
BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE);
|
||||
|
||||
#ifdef DEV_NETMAP
|
||||
if (ifp->if_capenable & IFCAP_NETMAP) {
|
||||
struct netmap_adapter *na = NA(ifp);
|
||||
|
||||
na->rx_rings[rxr->me].nr_kflags |= NKR_PENDINTR;
|
||||
selwakeuppri(&na->rx_rings[rxr->me].si, PI_NET);
|
||||
IGB_RX_UNLOCK(rxr);
|
||||
IGB_CORE_LOCK(adapter);
|
||||
selwakeuppri(&na->rx_si, PI_NET);
|
||||
IGB_CORE_UNLOCK(adapter);
|
||||
return (0);
|
||||
}
|
||||
if (netmap_rx_irq(ifp, rxr->me | NETMAP_LOCKED_ENTER, &processed))
|
||||
return (FALSE);
|
||||
#endif /* DEV_NETMAP */
|
||||
|
||||
/* Main clean loop */
|
||||
|
@ -3597,13 +3597,8 @@ ixgbe_txeof(struct tx_ring *txr)
|
||||
if (!netmap_mitigate ||
|
||||
(kring->nr_kflags < kring->nkr_num_slots &&
|
||||
txd[kring->nr_kflags].wb.status & IXGBE_TXD_STAT_DD)) {
|
||||
kring->nr_kflags = kring->nkr_num_slots;
|
||||
selwakeuppri(&na->tx_rings[txr->me].si, PI_NET);
|
||||
IXGBE_TX_UNLOCK(txr);
|
||||
IXGBE_CORE_LOCK(adapter);
|
||||
selwakeuppri(&na->tx_si, PI_NET);
|
||||
IXGBE_CORE_UNLOCK(adapter);
|
||||
IXGBE_TX_LOCK(txr);
|
||||
netmap_tx_irq(ifp, txr->me |
|
||||
(NETMAP_LOCKED_ENTER|NETMAP_LOCKED_EXIT));
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
@ -4388,23 +4383,9 @@ ixgbe_rxeof(struct ix_queue *que)
|
||||
IXGBE_RX_LOCK(rxr);
|
||||
|
||||
#ifdef DEV_NETMAP
|
||||
if (ifp->if_capenable & IFCAP_NETMAP) {
|
||||
/*
|
||||
* Same as the txeof routine: only wakeup clients on intr.
|
||||
* NKR_PENDINTR in nr_kflags is used to implement interrupt
|
||||
* mitigation (ixgbe_rxsync() will not look for new packets
|
||||
* unless NKR_PENDINTR is set).
|
||||
*/
|
||||
struct netmap_adapter *na = NA(ifp);
|
||||
|
||||
na->rx_rings[rxr->me].nr_kflags |= NKR_PENDINTR;
|
||||
selwakeuppri(&na->rx_rings[rxr->me].si, PI_NET);
|
||||
IXGBE_RX_UNLOCK(rxr);
|
||||
IXGBE_CORE_LOCK(adapter);
|
||||
selwakeuppri(&na->rx_si, PI_NET);
|
||||
IXGBE_CORE_UNLOCK(adapter);
|
||||
/* Same as the txeof routine: wakeup clients on intr. */
|
||||
if (netmap_rx_irq(ifp, rxr->me | NETMAP_LOCKED_ENTER, &processed))
|
||||
return (FALSE);
|
||||
}
|
||||
#endif /* DEV_NETMAP */
|
||||
for (i = rxr->next_to_check; count != 0;) {
|
||||
struct mbuf *sendmp, *mp;
|
||||
|
@ -2112,11 +2112,9 @@ re_rxeof(struct rl_softc *sc, int *rx_npktsp)
|
||||
|
||||
ifp = sc->rl_ifp;
|
||||
#ifdef DEV_NETMAP
|
||||
if (ifp->if_capenable & IFCAP_NETMAP) {
|
||||
NA(ifp)->rx_rings[0].nr_kflags |= NKR_PENDINTR;
|
||||
selwakeuppri(&NA(ifp)->rx_rings[0].si, PI_NET);
|
||||
if (netmap_rx_irq(ifp, 0 | (NETMAP_LOCKED_ENTER|NETMAP_LOCKED_EXIT),
|
||||
&rx_npkts))
|
||||
return 0;
|
||||
}
|
||||
#endif /* DEV_NETMAP */
|
||||
if (ifp->if_mtu > RL_MTU && (sc->rl_flags & RL_FLAG_JUMBOV2) != 0)
|
||||
jumbo = 1;
|
||||
@ -2360,10 +2358,8 @@ re_txeof(struct rl_softc *sc)
|
||||
|
||||
ifp = sc->rl_ifp;
|
||||
#ifdef DEV_NETMAP
|
||||
if (ifp->if_capenable & IFCAP_NETMAP) {
|
||||
selwakeuppri(&NA(ifp)->tx_rings[0].si, PI_NET);
|
||||
if (netmap_tx_irq(ifp, 0 | (NETMAP_LOCKED_ENTER|NETMAP_LOCKED_EXIT)))
|
||||
return;
|
||||
}
|
||||
#endif /* DEV_NETMAP */
|
||||
/* Invalidate the TX descriptor list */
|
||||
bus_dmamap_sync(sc->rl_ldata.rl_tx_list_tag,
|
||||
|
Loading…
Reference in New Issue
Block a user