Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/e1000/if_em.c
Show First 20 Lines • Show All 1,990 Lines • ▼ Show 20 Lines | em_if_msix_intr_assign(if_ctx_t ctx, int msix) | ||||
vector = 0; | vector = 0; | ||||
for (i = 0; i < adapter->tx_num_queues; i++, tx_que++, vector++) { | for (i = 0; i < adapter->tx_num_queues; i++, tx_que++, vector++) { | ||||
snprintf(buf, sizeof(buf), "txq%d", i); | snprintf(buf, sizeof(buf), "txq%d", i); | ||||
tx_que = &adapter->tx_queues[i]; | tx_que = &adapter->tx_queues[i]; | ||||
iflib_softirq_alloc_generic(ctx, | iflib_softirq_alloc_generic(ctx, | ||||
&adapter->rx_queues[i % adapter->rx_num_queues].que_irq, | &adapter->rx_queues[i % adapter->rx_num_queues].que_irq, | ||||
IFLIB_INTR_TX, tx_que, tx_que->me, buf); | IFLIB_INTR_TX, tx_que, tx_que->me, buf); | ||||
tx_que->msix = (vector % adapter->tx_num_queues); | tx_que->msix = (vector % adapter->rx_num_queues); | ||||
/* | /* | ||||
* Set the bit to enable interrupt | * Set the bit to enable interrupt | ||||
* in E1000_IMS -- bits 22 and 23 | * in E1000_IMS -- bits 22 and 23 | ||||
* are for TX0 and TX1, note this has | * are for TX0 and TX1, note this has | ||||
* NOTHING to do with the MSI-X vector | * NOTHING to do with the MSI-X vector | ||||
*/ | */ | ||||
if (adapter->hw.mac.type == e1000_82574) { | if (adapter->hw.mac.type == e1000_82574) { | ||||
tx_que->eims = 1 << (22 + i); | tx_que->eims = 1 << (22 + i); | ||||
adapter->ims |= tx_que->eims; | adapter->ims |= tx_que->eims; | ||||
adapter->ivars |= (8 | tx_que->msix) << (8 + (i * 4)); | adapter->ivars |= (8 | tx_que->msix) << (8 + (i * 4)); | ||||
} else if (adapter->hw.mac.type == e1000_82575) { | } else if (adapter->hw.mac.type == e1000_82575) { | ||||
tx_que->eims = E1000_EICR_TX_QUEUE0 << (i % adapter->tx_num_queues); | tx_que->eims = E1000_EICR_TX_QUEUE0 << i; | ||||
} else { | } else { | ||||
tx_que->eims = 1 << (i % adapter->tx_num_queues); | tx_que->eims = 1 << i; | ||||
} | } | ||||
} | } | ||||
/* Link interrupt */ | /* Link interrupt */ | ||||
rid = rx_vectors + 1; | rid = rx_vectors + 1; | ||||
error = iflib_irq_alloc_generic(ctx, &adapter->irq, rid, IFLIB_INTR_ADMIN, em_msix_link, adapter, 0, "aq"); | error = iflib_irq_alloc_generic(ctx, &adapter->irq, rid, IFLIB_INTR_ADMIN, em_msix_link, adapter, 0, "aq"); | ||||
if (error) { | if (error) { | ||||
▲ Show 20 Lines • Show All 2,534 Lines • Show Last 20 Lines |