1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-26 16:18:31 +00:00

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.
This commit is contained in:
Jack F Vogel 2010-04-28 19:22:52 +00:00
parent aa1385cd7b
commit beef45ff88
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=207337

View File

@ -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 @@ em_rxeof(struct rx_ring *rxr, int count)
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 @@ em_rxeof(struct rx_ring *rxr, int count)
}
rxr->next_to_check = i;
EM_RX_UNLOCK(rxr);
#ifdef DEVICE_POLLING
return (rxdone);