Skip to content

Commit 6f41c1f

Browse files
Krzysztof GalazkaKrzysztof Galazka
authored andcommitted
ixl(4): Fix queue MSI and legacy IRQ rearming
When MSI or legacy interrupt is used driver controls wheter queues can trigger an interrupt with the Interrupt Linked List. While processing traffic first index of the list is set to EOL value to stop queues from triggering interrupts. This index was not reset to the correct value when driver attempted to re-enable interrupts from queues, what prevented driver from processing any traffic. Fix that by setting correct first index in the ixl_if_enable_intr function. While at that fix the comments style and make ixl_if_enable_intr and ixl_if_disable_intr more consistent. Signed-off-by: Krzysztof Galazka <krzysztof.galazka@intel.com> PR: 288077 Suggested by: Mike Belanger <mibelanger@qnx.com> Approved by: kbowling (mentor), erj (mentor) Tested by: gowtham.kumar.ks_intel.com, Sponsored by: Intel Corporation MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D51331
1 parent ba61aa4 commit 6f41c1f

File tree

1 file changed

+17
-8
lines changed

1 file changed

+17
-8
lines changed

sys/dev/ixl/if_ixl.c

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1151,13 +1151,20 @@ ixl_if_enable_intr(if_ctx_t ctx)
11511151
struct ixl_pf *pf = iflib_get_softc(ctx);
11521152
struct ixl_vsi *vsi = &pf->vsi;
11531153
struct i40e_hw *hw = vsi->hw;
1154-
struct ixl_rx_queue *que = vsi->rx_queues;
1154+
struct ixl_rx_queue *rx_que = vsi->rx_queues;
11551155

11561156
ixl_enable_intr0(hw);
11571157
/* Enable queue interrupts */
1158-
for (int i = 0; i < vsi->num_rx_queues; i++, que++)
1159-
/* TODO: Queue index parameter is probably wrong */
1160-
ixl_enable_queue(hw, que->rxr.me);
1158+
if (vsi->shared->isc_intr == IFLIB_INTR_MSIX) {
1159+
for (int i = 0; i < vsi->num_rx_queues; i++, rx_que++)
1160+
ixl_enable_queue(hw, rx_que->rxr.me);
1161+
} else {
1162+
/*
1163+
* Set PFINT_LNKLST0 FIRSTQ_INDX to 0x0 to enable
1164+
* triggering interrupts by queues.
1165+
*/
1166+
wr32(hw, I40E_PFINT_LNKLST0, 0x0);
1167+
}
11611168
}
11621169

11631170
/*
@@ -1175,11 +1182,13 @@ ixl_if_disable_intr(if_ctx_t ctx)
11751182

11761183
if (vsi->shared->isc_intr == IFLIB_INTR_MSIX) {
11771184
for (int i = 0; i < vsi->num_rx_queues; i++, rx_que++)
1178-
ixl_disable_queue(hw, rx_que->msix - 1);
1185+
ixl_disable_queue(hw, rx_que->rxr.me);
11791186
} else {
1180-
// Set PFINT_LNKLST0 FIRSTQ_INDX to 0x7FF
1181-
// stops queues from triggering interrupts
1182-
wr32(hw, I40E_PFINT_LNKLST0, 0x7FF);
1187+
/*
1188+
* Set PFINT_LNKLST0 FIRSTQ_INDX to End of List (0x7FF)
1189+
* to stop queues from triggering interrupts.
1190+
*/
1191+
wr32(hw, I40E_PFINT_LNKLST0, IXL_QUEUE_EOL);
11831192
}
11841193
}
11851194

0 commit comments

Comments
 (0)