diff options
| author | Luigi Rizzo <luigi@FreeBSD.org> | 2013-05-10 16:16:33 +0000 |
|---|---|---|
| committer | Luigi Rizzo <luigi@FreeBSD.org> | 2013-05-10 16:16:33 +0000 |
| commit | a6618b1d22840e3a8d9bcb19b10f8425541cf829 (patch) | |
| tree | beddbd4a7556380e0af4882b00be954a21bb8fdb /sys/dev/re | |
| parent | 6f9e5bccbe0321fbacdcba0053a7caa9b56eda1c (diff) | |
Notes
Diffstat (limited to 'sys/dev/re')
| -rw-r--r-- | sys/dev/re/if_re.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/sys/dev/re/if_re.c b/sys/dev/re/if_re.c index 6d42e422f114..9cc557729dc3 100644 --- a/sys/dev/re/if_re.c +++ b/sys/dev/re/if_re.c @@ -1753,8 +1753,12 @@ re_detach(device_t dev) bus_teardown_intr(dev, sc->rl_irq[0], sc->rl_intrhand[0]); sc->rl_intrhand[0] = NULL; } - if (ifp != NULL) + if (ifp != NULL) { +#ifdef DEV_NETMAP + netmap_detach(ifp); +#endif /* DEV_NETMAP */ if_free(ifp); + } if ((sc->rl_flags & (RL_FLAG_MSI | RL_FLAG_MSIX)) == 0) rid = 0; else @@ -1843,9 +1847,6 @@ re_detach(device_t dev) bus_dma_tag_destroy(sc->rl_ldata.rl_stag); } -#ifdef DEV_NETMAP - netmap_detach(ifp); -#endif /* DEV_NETMAP */ if (sc->rl_parent_tag) bus_dma_tag_destroy(sc->rl_parent_tag); @@ -2110,11 +2111,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; @@ -2358,10 +2357,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, |
