diff options
author | jfv <jfv@FreeBSD.org> | 2010-04-28 19:22:52 +0000 |
---|---|---|
committer | jfv <jfv@FreeBSD.org> | 2010-04-28 19:22:52 +0000 |
commit | 1b3b15fdbb3d5610779b9ec6005860287d411653 (patch) | |
tree | 872c6ec78bcf7b35152bb6a33c2a78ec7d139a44 /sys/dev/e1000 | |
parent | 5b51584fbcf94586ba465306cb52b8b8b48a6b43 (diff) | |
download | FreeBSD-src-1b3b15fdbb3d5610779b9ec6005860287d411653.zip FreeBSD-src-1b3b15fdbb3d5610779b9ec6005860287d411653.tar.gz |
Address the LOD that some are seeing, put the RX lock
back in rxeof (I could see little point in taking it out),
and now release it before the stack entry.
Also, make it so the 82574 does not configure for multiqueue
when its not used in the stack.
Diffstat (limited to 'sys/dev/e1000')
-rw-r--r-- | sys/dev/e1000/if_em.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c index fcebc02..2fb4f17 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -347,8 +347,13 @@ static int em_debug_sbp = FALSE; TUNABLE_INT("hw.em.sbp", &em_debug_sbp); /* Local controls for MSI/MSIX */ +#ifdef EM_MULTIQUEUE static int em_enable_msix = TRUE; static int em_msix_queues = 2; /* for 82574, can be 1 or 2 */ +#else +static int em_enable_msix = FALSE; +static int em_msix_queues = 0; /* disable */ +#endif TUNABLE_INT("hw.em.enable_msix", &em_enable_msix); TUNABLE_INT("hw.em.msix_queues", &em_msix_queues); @@ -1371,9 +1376,7 @@ em_poll(struct ifnet *ifp, enum poll_cmd cmd, int count) } EM_CORE_UNLOCK(adapter); - EM_RX_LOCK(rxr); rx_done = em_rxeof(rxr, count); - EM_RX_UNLOCK(rxr); EM_TX_LOCK(txr); em_txeof(txr); @@ -1449,9 +1452,7 @@ em_handle_que(void *context, int pending) if (ifp->if_drv_flags & IFF_DRV_RUNNING) { - EM_RX_LOCK(rxr); more_rx = em_rxeof(rxr, adapter->rx_process_limit); - EM_RX_UNLOCK(rxr); EM_TX_LOCK(txr); em_txeof(txr); @@ -1511,10 +1512,8 @@ em_msix_rx(void *arg) struct adapter *adapter = rxr->adapter; bool more; - EM_RX_LOCK(rxr); ++rxr->rx_irq; more = em_rxeof(rxr, adapter->rx_process_limit); - EM_RX_UNLOCK(rxr); if (more) taskqueue_enqueue(rxr->tq, &rxr->rx_task); else @@ -1553,9 +1552,7 @@ em_handle_rx(void *context, int pending) struct adapter *adapter = rxr->adapter; bool more; - EM_RX_LOCK(rxr); more = em_rxeof(rxr, adapter->rx_process_limit); - EM_RX_UNLOCK(rxr); if (more) taskqueue_enqueue(rxr->tq, &rxr->rx_task); else @@ -4100,7 +4097,7 @@ em_rxeof(struct rx_ring *rxr, int count) bool eop; struct e1000_rx_desc *cur; - EM_RX_LOCK_ASSERT(rxr); + EM_RX_LOCK(rxr); for (i = rxr->next_to_check, processed = 0; count != 0;) { @@ -4194,8 +4191,13 @@ skip: i = 0; /* Send to the stack */ - if (sendmp != NULL) + if (sendmp != NULL) { + rxr->next_to_check = i; + EM_RX_UNLOCK(rxr); (*ifp->if_input)(ifp, sendmp); + EM_RX_LOCK(rxr); + i = rxr->next_to_check; + } /* Only refresh mbufs every 8 descriptors */ if (processed == 8) { @@ -4211,6 +4213,7 @@ skip: } rxr->next_to_check = i; + EM_RX_UNLOCK(rxr); #ifdef DEVICE_POLLING return (rxdone); |