Revert "Widen EPOCH(9) usage in PCI WLAN drivers."

This reverts commit b65f813c1a.
As a side effect this also seems to fix wtap which seems to have
lost the epoch over the input path in between.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
This commit is contained in:
Bjoern A. Zeeb 2023-11-03 21:19:26 +00:00
parent de607e3c23
commit 1c6dd33d26
14 changed files with 2 additions and 48 deletions

View File

@ -1503,7 +1503,6 @@ bwi_stop_locked(struct bwi_softc *sc, int statechg)
void
bwi_intr(void *xsc)
{
struct epoch_tracker et;
struct bwi_softc *sc = xsc;
struct bwi_mac *mac;
uint32_t intr_status;
@ -1623,9 +1622,7 @@ bwi_intr(void *xsc)
device_printf(sc->sc_dev, "intr noise\n");
if (txrx_intr_status[0] & BWI_TXRX_INTR_RX) {
NET_EPOCH_ENTER(et);
rx_data = sc->sc_rxeof(sc);
NET_EPOCH_EXIT(et);
if (sc->sc_flags & BWI_F_STOP) {
BWI_UNLOCK(sc);
return;

View File

@ -5075,7 +5075,6 @@ bwn_intr(void *arg)
static void
bwn_intrtask(void *arg, int npending)
{
struct epoch_tracker et;
struct bwn_mac *mac = arg;
struct bwn_softc *sc = mac->mac_sc;
uint32_t merged = 0;
@ -5136,7 +5135,6 @@ bwn_intrtask(void *arg, int npending)
if (mac->mac_reason_intr & BWN_INTR_NOISESAMPLE_OK)
bwn_intr_noise(mac);
NET_EPOCH_ENTER(et);
if (mac->mac_flags & BWN_MAC_FLAG_DMA) {
if (mac->mac_reason[0] & BWN_DMAINTR_RX_DONE) {
bwn_dma_rx(mac->mac_method.dma.rx);
@ -5144,7 +5142,6 @@ bwn_intrtask(void *arg, int npending)
}
} else
rx = bwn_pio_rx(&mac->mac_method.pio.rx);
NET_EPOCH_EXIT(et);
KASSERT(!(mac->mac_reason[1] & BWN_DMAINTR_RX_DONE), ("%s", __func__));
KASSERT(!(mac->mac_reason[2] & BWN_DMAINTR_RX_DONE), ("%s", __func__));

View File

@ -1156,7 +1156,6 @@ static void
ipw_rx_data_intr(struct ipw_softc *sc, struct ipw_status *status,
struct ipw_soft_bd *sbd, struct ipw_soft_buf *sbuf)
{
struct epoch_tracker et;
struct ieee80211com *ic = &sc->sc_ic;
struct mbuf *mnew, *m;
struct ieee80211_node *ni;
@ -1228,13 +1227,11 @@ ipw_rx_data_intr(struct ipw_softc *sc, struct ipw_status *status,
IPW_UNLOCK(sc);
ni = ieee80211_find_rxnode(ic, mtod(m, struct ieee80211_frame_min *));
NET_EPOCH_ENTER(et);
if (ni != NULL) {
(void) ieee80211_input(ni, m, rssi - nf, nf);
ieee80211_free_node(ni);
} else
(void) ieee80211_input_all(ic, m, rssi - nf, nf);
NET_EPOCH_EXIT(et);
IPW_LOCK(sc);
bus_dmamap_sync(sc->rbd_dmat, sc->rbd_map, BUS_DMASYNC_PREWRITE);

View File

@ -1177,7 +1177,6 @@ static void
iwi_frame_intr(struct iwi_softc *sc, struct iwi_rx_data *data, int i,
struct iwi_frame *frame)
{
struct epoch_tracker et;
struct ieee80211com *ic = &sc->sc_ic;
struct mbuf *mnew, *m;
struct ieee80211_node *ni;
@ -1267,13 +1266,11 @@ iwi_frame_intr(struct iwi_softc *sc, struct iwi_rx_data *data, int i,
IWI_UNLOCK(sc);
ni = ieee80211_find_rxnode(ic, mtod(m, struct ieee80211_frame_min *));
NET_EPOCH_ENTER(et);
if (ni != NULL) {
type = ieee80211_input(ni, m, rssi, nf);
ieee80211_free_node(ni);
} else
type = ieee80211_input_all(ic, m, rssi, nf);
NET_EPOCH_EXIT(et);
IWI_LOCK(sc);
if (sc->sc_softled) {

View File

@ -3375,7 +3375,6 @@ static bool
iwm_rx_mpdu(struct iwm_softc *sc, struct mbuf *m, uint32_t offset,
bool stolen)
{
struct epoch_tracker et;
struct ieee80211com *ic;
struct ieee80211_frame *wh;
struct ieee80211_node *ni;
@ -3395,8 +3394,6 @@ iwm_rx_mpdu(struct iwm_softc *sc, struct mbuf *m, uint32_t offset,
ni = ieee80211_find_rxnode(ic, (struct ieee80211_frame_min *)wh);
IWM_UNLOCK(sc);
NET_EPOCH_ENTER(et);
if (ni != NULL) {
IWM_DPRINTF(sc, IWM_DEBUG_RECV, "input m %p\n", m);
ieee80211_input_mimo(ni, m);
@ -3405,8 +3402,6 @@ iwm_rx_mpdu(struct iwm_softc *sc, struct mbuf *m, uint32_t offset,
IWM_DPRINTF(sc, IWM_DEBUG_RECV, "inputall m %p\n", m);
ieee80211_input_mimo_all(ic, m);
}
NET_EPOCH_EXIT(et);
IWM_LOCK(sc);
return true;

View File

@ -3019,7 +3019,6 @@ static void
iwn_rx_done(struct iwn_softc *sc, struct iwn_rx_desc *desc,
struct iwn_rx_data *data)
{
struct epoch_tracker et;
struct iwn_ops *ops = &sc->ops;
struct ieee80211com *ic = &sc->sc_ic;
struct iwn_rx_ring *ring = &sc->rxq;
@ -3179,7 +3178,6 @@ iwn_rx_done(struct iwn_softc *sc, struct iwn_rx_desc *desc,
}
IWN_UNLOCK(sc);
NET_EPOCH_ENTER(et);
/* Send the frame to the 802.11 layer. */
if (ni != NULL) {
@ -3191,7 +3189,6 @@ iwn_rx_done(struct iwn_softc *sc, struct iwn_rx_desc *desc,
} else
(void)ieee80211_input_all(ic, m, rssi - nf, nf);
NET_EPOCH_EXIT(et);
IWN_LOCK(sc);
DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__);

View File

@ -1928,7 +1928,6 @@ malo_set_channel(struct ieee80211com *ic)
static void
malo_rx_proc(void *arg, int npending)
{
struct epoch_tracker et;
struct malo_softc *sc = arg;
struct ieee80211com *ic = &sc->malo_ic;
struct malo_rxbuf *bf;
@ -2061,13 +2060,11 @@ malo_rx_proc(void *arg, int npending)
/* dispatch */
ni = ieee80211_find_rxnode(ic,
(struct ieee80211_frame_min *)wh);
NET_EPOCH_ENTER(et);
if (ni != NULL) {
(void) ieee80211_input(ni, m, rssi, ds->nf);
ieee80211_free_node(ni);
} else
(void) ieee80211_input_all(ic, m, rssi, ds->nf);
NET_EPOCH_EXIT(et);
rx_next:
/* NB: ignore ENOMEM so we process more descriptors */
(void) malo_rxbuf_init(sc, bf);

View File

@ -2603,7 +2603,6 @@ cvtrssi(uint8_t ssi)
static void
mwl_rx_proc(void *arg, int npending)
{
struct epoch_tracker et;
struct mwl_softc *sc = arg;
struct ieee80211com *ic = &sc->sc_ic;
struct mwl_rxbuf *bf;
@ -2792,8 +2791,6 @@ mwl_rx_proc(void *arg, int npending)
/* dispatch */
ni = ieee80211_find_rxnode(ic,
(const struct ieee80211_frame_min *) wh);
NET_EPOCH_ENTER(et);
if (ni != NULL) {
mn = MWL_NODE(ni);
#ifdef MWL_ANT_INFO_SUPPORT
@ -2809,7 +2806,6 @@ mwl_rx_proc(void *arg, int npending)
ieee80211_free_node(ni);
} else
(void) ieee80211_input_all(ic, m, rssi, nf);
NET_EPOCH_EXIT(et);
rx_next:
/* NB: ignore ENOMEM so we process more descriptors */
(void) mwl_rxbuf_init(sc, bf);

View File

@ -1083,7 +1083,6 @@ rt2560_prio_intr(struct rt2560_softc *sc)
static void
rt2560_decryption_intr(struct rt2560_softc *sc)
{
struct epoch_tracker et;
struct ieee80211com *ic = &sc->sc_ic;
struct rt2560_rx_desc *desc;
struct rt2560_rx_data *data;
@ -1194,13 +1193,12 @@ rt2560_decryption_intr(struct rt2560_softc *sc)
wh = mtod(m, struct ieee80211_frame *);
ni = ieee80211_find_rxnode(ic,
(struct ieee80211_frame_min *)wh);
NET_EPOCH_ENTER(et);
if (ni != NULL) {
(void) ieee80211_input(ni, m, rssi, nf);
ieee80211_free_node(ni);
} else
(void) ieee80211_input_all(ic, m, rssi, nf);
NET_EPOCH_EXIT(et);
RAL_LOCK(sc);
sc->sc_flags &= ~RT2560_F_INPUT_RUNNING;
skip: desc->flags = htole32(RT2560_RX_BUSY);

View File

@ -955,7 +955,6 @@ rt2661_tx_dma_intr(struct rt2661_softc *sc, struct rt2661_tx_ring *txq)
static void
rt2661_rx_intr(struct rt2661_softc *sc)
{
struct epoch_tracker et;
struct ieee80211com *ic = &sc->sc_ic;
struct rt2661_rx_desc *desc;
struct rt2661_rx_data *data;
@ -1072,13 +1071,11 @@ rt2661_rx_intr(struct rt2661_softc *sc)
/* send the frame to the 802.11 layer */
ni = ieee80211_find_rxnode(ic,
(struct ieee80211_frame_min *)wh);
NET_EPOCH_ENTER(et);
if (ni != NULL) {
(void) ieee80211_input(ni, m, rssi, nf);
ieee80211_free_node(ni);
} else
(void) ieee80211_input_all(ic, m, rssi, nf);
NET_EPOCH_EXIT(et);
RAL_LOCK(sc);
sc->sc_flags &= ~RAL_INPUT_RUNNING;

View File

@ -1176,7 +1176,6 @@ rt2860_maxrssi_chain(struct rt2860_softc *sc, const struct rt2860_rxwi *rxwi)
static void
rt2860_rx_intr(struct rt2860_softc *sc)
{
struct epoch_tracker et;
struct rt2860_rx_radiotap_header *tap;
struct ieee80211com *ic = &sc->sc_ic;
struct ieee80211_frame *wh;
@ -1324,13 +1323,11 @@ rt2860_rx_intr(struct rt2860_softc *sc)
/* send the frame to the 802.11 layer */
ni = ieee80211_find_rxnode(ic,
(struct ieee80211_frame_min *)wh);
NET_EPOCH_ENTER(et);
if (ni != NULL) {
(void)ieee80211_input(ni, m, rssi - nf, nf);
ieee80211_free_node(ni);
} else
(void)ieee80211_input_all(ic, m, rssi - nf, nf);
NET_EPOCH_EXIT(et);
RAL_LOCK(sc);

View File

@ -33,7 +33,6 @@
#include <sys/taskqueue.h>
#include <sys/bus.h>
#include <sys/endian.h>
#include <sys/epoch.h>
#include <machine/bus.h>
#include <machine/resource.h>
@ -83,7 +82,6 @@ rtwn_pci_setup_rx_desc(struct rtwn_pci_softc *pc,
static void
rtwn_pci_rx_frame(struct rtwn_pci_softc *pc)
{
struct epoch_tracker et;
struct rtwn_softc *sc = &pc->pc_sc;
struct rtwn_rx_ring *ring = &pc->rx_ring;
struct rtwn_rx_stat_pci *rx_desc = &ring->desc[ring->cur];
@ -163,15 +161,12 @@ rtwn_pci_rx_frame(struct rtwn_pci_softc *pc)
/* Send the frame to the 802.11 layer. */
RTWN_UNLOCK(sc);
NET_EPOCH_ENTER(et);
if (ni != NULL) {
(void)ieee80211_input_mimo(ni, m);
/* Node is no longer needed. */
ieee80211_free_node(ni);
} else
(void)ieee80211_input_mimo_all(ic, m);
NET_EPOCH_EXIT(et);
RTWN_LOCK(sc);

View File

@ -1906,7 +1906,6 @@ static void
wpi_rx_done(struct wpi_softc *sc, struct wpi_rx_desc *desc,
struct wpi_rx_data *data)
{
struct epoch_tracker et;
struct ieee80211com *ic = &sc->sc_ic;
struct wpi_rx_ring *ring = &sc->rxq;
struct wpi_rx_stat *stat;
@ -2026,7 +2025,6 @@ wpi_rx_done(struct wpi_softc *sc, struct wpi_rx_desc *desc,
}
WPI_UNLOCK(sc);
NET_EPOCH_ENTER(et);
/* Send the frame to the 802.11 layer. */
if (ni != NULL) {
@ -2036,7 +2034,6 @@ wpi_rx_done(struct wpi_softc *sc, struct wpi_rx_desc *desc,
} else
(void)ieee80211_input_all(ic, m, stat->rssi, WPI_RSSI_OFFSET);
NET_EPOCH_EXIT(et);
WPI_LOCK(sc);
return;

View File

@ -493,7 +493,6 @@ wtap_inject(struct wtap_softc *sc, struct mbuf *m)
static void
wtap_rx_proc(void *arg, int npending)
{
struct epoch_tracker et;
struct wtap_softc *sc = (struct wtap_softc *)arg;
struct ieee80211com *ic = &sc->sc_ic;
struct mbuf *m;
@ -540,7 +539,6 @@ wtap_rx_proc(void *arg, int npending)
ni = ieee80211_find_rxnode_withkey(ic,
mtod(m, const struct ieee80211_frame_min *),
IEEE80211_KEYIX_NONE);
NET_EPOCH_ENTER(et);
if (ni != NULL) {
/*
* Sending station is known, dispatch directly.
@ -550,8 +548,7 @@ wtap_rx_proc(void *arg, int npending)
} else {
ieee80211_input_all(ic, m, 1<<7, 10);
}
NET_EPOCH_EXIT(et);
/* The mbufs are freed by the Net80211 stack */
free(bf, M_WTAP_RXBUF);
}