Change to have legacy interrupts use the same

handler had a flaw, thanks to John Baldwin for
finding it. Change which queue legacy tasks are
enqueued on.

MFC: soonest
This commit is contained in:
Jack F Vogel 2010-06-15 21:11:51 +00:00
parent da8301c83a
commit 0dee704f01
2 changed files with 12 additions and 12 deletions

View File

@ -1285,8 +1285,9 @@ igb_handle_link(void *context, int pending)
static int static int
igb_irq_fast(void *arg) igb_irq_fast(void *arg)
{ {
struct adapter *adapter = arg; struct adapter *adapter = arg;
uint32_t reg_icr; struct igb_queue *que = adapter->queues;
u32 reg_icr;
reg_icr = E1000_READ_REG(&adapter->hw, E1000_ICR); reg_icr = E1000_READ_REG(&adapter->hw, E1000_ICR);
@ -1308,11 +1309,11 @@ igb_irq_fast(void *arg)
* MSI message reordering errata on certain systems. * MSI message reordering errata on certain systems.
*/ */
igb_disable_intr(adapter); igb_disable_intr(adapter);
taskqueue_enqueue(adapter->tq, &adapter->rxtx_task); taskqueue_enqueue(que->tq, &que->que_task);
/* Link status change */ /* Link status change */
if (reg_icr & (E1000_ICR_RXSEQ | E1000_ICR_LSC)) if (reg_icr & (E1000_ICR_RXSEQ | E1000_ICR_LSC))
taskqueue_enqueue(adapter->tq, &adapter->link_task); taskqueue_enqueue(que->tq, &adapter->link_task);
if (reg_icr & E1000_ICR_RXO) if (reg_icr & E1000_ICR_RXO)
adapter->rx_overruns++; adapter->rx_overruns++;
@ -1352,7 +1353,7 @@ igb_poll(struct ifnet *ifp, enum poll_cmd cmd, int count)
reg_icr = E1000_READ_REG(&adapter->hw, E1000_ICR); reg_icr = E1000_READ_REG(&adapter->hw, E1000_ICR);
/* Link status change */ /* Link status change */
if (reg_icr & (E1000_ICR_RXSEQ | E1000_ICR_LSC)) if (reg_icr & (E1000_ICR_RXSEQ | E1000_ICR_LSC))
taskqueue_enqueue(adapter->tq, &adapter->link_task); taskqueue_enqueue(que->tq, &adapter->link_task);
if (reg_icr & E1000_ICR_RXO) if (reg_icr & E1000_ICR_RXO)
adapter->rx_overruns++; adapter->rx_overruns++;
@ -2116,20 +2117,20 @@ igb_allocate_legacy(struct adapter *adapter)
* Try allocating a fast interrupt and the associated deferred * Try allocating a fast interrupt and the associated deferred
* processing contexts. * processing contexts.
*/ */
TASK_INIT(&adapter->rxtx_task, 0, igb_handle_que, que); TASK_INIT(&que->que_task, 0, igb_handle_que, que);
/* Make tasklet for deferred link handling */ /* Make tasklet for deferred link handling */
TASK_INIT(&adapter->link_task, 0, igb_handle_link, adapter); TASK_INIT(&adapter->link_task, 0, igb_handle_link, adapter);
adapter->tq = taskqueue_create_fast("igb_taskq", M_NOWAIT, que->tq = taskqueue_create_fast("igb_taskq", M_NOWAIT,
taskqueue_thread_enqueue, &adapter->tq); taskqueue_thread_enqueue, &que->tq);
taskqueue_start_threads(&adapter->tq, 1, PI_NET, "%s taskq", taskqueue_start_threads(&que->tq, 1, PI_NET, "%s taskq",
device_get_nameunit(adapter->dev)); device_get_nameunit(adapter->dev));
if ((error = bus_setup_intr(dev, adapter->res, if ((error = bus_setup_intr(dev, adapter->res,
INTR_TYPE_NET | INTR_MPSAFE, igb_irq_fast, NULL, INTR_TYPE_NET | INTR_MPSAFE, igb_irq_fast, NULL,
adapter, &adapter->tag)) != 0) { adapter, &adapter->tag)) != 0) {
device_printf(dev, "Failed to register fast interrupt " device_printf(dev, "Failed to register fast interrupt "
"handler: %d\n", error); "handler: %d\n", error);
taskqueue_free(adapter->tq); taskqueue_free(que->tq);
adapter->tq = NULL; que->tq = NULL;
return (error); return (error);
} }

View File

@ -382,7 +382,6 @@ struct adapter {
int min_frame_size; int min_frame_size;
struct mtx core_mtx; struct mtx core_mtx;
int igb_insert_vlan_header; int igb_insert_vlan_header;
struct task rxtx_task;
struct taskqueue *tq; /* adapter task queue */ struct taskqueue *tq; /* adapter task queue */
u16 num_queues; u16 num_queues;