Deleted Added
full compact
29c29
< __FBSDID("$FreeBSD: head/sys/dev/cxgbe/t4_sge.c 220643 2011-04-14 20:06:23Z np $");
---
> __FBSDID("$FreeBSD: head/sys/dev/cxgbe/t4_sge.c 220649 2011-04-15 03:09:27Z np $");
282c282
< handler = t4_intr_evt;
---
> handler = t4_evt_rx;
348c348
< sc->flags & INTR_FWD ? t4_intr_data: NULL, name);
---
> sc->flags & INTR_FWD ? t4_eth_rx : NULL, name);
430a431,433
> if (!atomic_cmpset_32(&iq->state, IQS_IDLE, IQS_BUSY))
> return;
>
462a466,467
>
> atomic_cmpset_32(&iq->state, IQS_BUSY, IQS_IDLE);
481a487,512
>
> if (!atomic_cmpset_32(&iq->state, IQS_IDLE, IQS_BUSY))
> return;
>
> t4_evt_rx(arg);
>
> atomic_cmpset_32(&iq->state, IQS_BUSY, IQS_IDLE);
> }
>
> void
> t4_intr_data(void *arg)
> {
> struct sge_iq *iq = arg;
>
> if (!atomic_cmpset_32(&iq->state, IQS_IDLE, IQS_BUSY))
> return;
>
> t4_eth_rx(arg);
>
> atomic_cmpset_32(&iq->state, IQS_BUSY, IQS_IDLE);
> }
>
> void
> t4_evt_rx(void *arg)
> {
> struct sge_iq *iq = arg;
540c571
< t4_intr_data(void *arg)
---
> t4_eth_rx(void *arg)
1020,1021d1050
< mtx_init(&iq->iq_lock, iq->lockname, NULL, MTX_DEF);
<
1150a1180
> atomic_store_rel_32(&iq->state, IQS_IDLE);
1181a1212,1215
>
> /* Synchronize with the interrupt handler */
> while (!atomic_cmpset_32(&iq->state, IQS_IDLE, IQS_DISABLED))
> pause("iqfree", hz / 1000);
1199,1201d1232
< if (mtx_initialized(&iq->iq_lock))
< mtx_destroy(&iq->iq_lock);
<
1427a1459,1479
>
> /*
> * Wait for the response to a credit flush if there's one
> * pending. Clearing the flag tells handle_sge_egr_update or
> * cxgbe_txq_start (depending on how far the response has made
> * it) that they should ignore the response and wake up free_txq
> * instead.
> *
> * The interface has been marked down by the time we get here
> * (both IFF_UP and IFF_DRV_RUNNING cleared). qflush has
> * emptied the tx buf_rings and we know nothing new is being
> * queued for tx so we don't have to worry about a new credit
> * flush request.
> */
> TXQ_LOCK(txq);
> if (eq->flags & EQ_CRFLUSHED) {
> eq->flags &= ~EQ_CRFLUSHED;
> msleep(txq, &eq->eq_lock, 0, "crflush", 0);
> }
> TXQ_UNLOCK(txq);
>
2446a2499,2506
> TXQ_LOCK(txq);
> if (txq->eq.flags & EQ_CRFLUSHED) {
> pi = txq->ifp->if_softc;
> taskqueue_enqueue(pi->tq, &txq->resume_tx);
> txq->egr_update++;
> } else
> wakeup_one(txq); /* txq is going away, wakeup free_txq */
> TXQ_UNLOCK(txq);
2448,2454d2507
< KASSERT(txq->eq.flags & EQ_CRFLUSHED,
< ("%s: tx queue %p not expecting an update.", __func__, txq));
<
< pi = txq->ifp->if_softc;
< taskqueue_enqueue(pi->tq, &txq->resume_tx);
< txq->egr_update++;
<