[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 1/9] qtest/e1000e|igb: Clear interrupt-cause and msix pending bit
From: |
Nicholas Piggin |
Subject: |
[PATCH 1/9] qtest/e1000e|igb: Clear interrupt-cause and msix pending bits after irq |
Date: |
Sat, 18 Jan 2025 03:02:57 +1000 |
The e1000e and igb tests do not clear the ICR/EICR cause bits (or
set auto-clear) on seeing queue interrupts, which inhibits the
triggering of a new interrupt. The msix pending bit which is used
to test for the interrupt is also not cleared (the vector is masked).
Fix this by clearing the ICR/EICR cause bits, and the msix pending
bit using the PBACLR device register.
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
tests/qtest/e1000e-test.c | 9 ++++++++-
tests/qtest/igb-test.c | 8 ++++++++
2 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/tests/qtest/e1000e-test.c b/tests/qtest/e1000e-test.c
index de9738fdb74..746d26cfb67 100644
--- a/tests/qtest/e1000e-test.c
+++ b/tests/qtest/e1000e-test.c
@@ -66,6 +66,10 @@ static void e1000e_send_verify(QE1000E *d, int
*test_sockets, QGuestAllocator *a
/* Wait for TX WB interrupt */
e1000e_wait_isr(d, E1000E_TX0_MSG_ID);
+ /* Read ICR to make it ready for next interrupt, assert TXQ0 cause */
+ g_assert(e1000e_macreg_read(d, E1000_ICR) & E1000_ICR_TXQ0);
+ /* Write PBACLR to clear the MSIX pending bit */
+ e1000e_macreg_write(d, E1000_PBACLR, (1 << E1000E_TX0_MSG_ID));
/* Check DD bit */
g_assert_cmphex(le32_to_cpu(descr.upper.data) & E1000_TXD_STAT_DD, ==,
@@ -117,7 +121,10 @@ static void e1000e_receive_verify(QE1000E *d, int
*test_sockets, QGuestAllocator
/* Wait for TX WB interrupt */
e1000e_wait_isr(d, E1000E_RX0_MSG_ID);
-
+ /* Read ICR to make it ready for next interrupt, assert RXQ0 cause */
+ g_assert(e1000e_macreg_read(d, E1000_ICR) & E1000_ICR_RXQ0);
+ /* Write PBACLR to clear the MSIX pending bit */
+ e1000e_macreg_write(d, E1000_PBACLR, (1 << E1000E_RX0_MSG_ID));
/* Check DD bit */
g_assert_cmphex(le32_to_cpu(descr.wb.upper.status_error) &
E1000_RXD_STAT_DD, ==, E1000_RXD_STAT_DD);
diff --git a/tests/qtest/igb-test.c b/tests/qtest/igb-test.c
index 3d397ea6973..cf8b4131cf2 100644
--- a/tests/qtest/igb-test.c
+++ b/tests/qtest/igb-test.c
@@ -69,6 +69,10 @@ static void igb_send_verify(QE1000E *d, int *test_sockets,
QGuestAllocator *allo
/* Wait for TX WB interrupt */
e1000e_wait_isr(d, E1000E_TX0_MSG_ID);
+ /* Read EICR which clears it ready for next interrupt, assert TXQ0 cause */
+ g_assert(e1000e_macreg_read(d, E1000_EICR) & (1 << E1000E_TX0_MSG_ID));
+ /* Write PBACLR to clear the MSIX pending bit */
+ e1000e_macreg_write(d, E1000_PBACLR, (1 << E1000E_TX0_MSG_ID));
/* Check DD bit */
g_assert_cmphex(le32_to_cpu(descr.wb.status) & E1000_TXD_STAT_DD, ==,
@@ -120,6 +124,10 @@ static void igb_receive_verify(QE1000E *d, int
*test_sockets, QGuestAllocator *a
/* Wait for TX WB interrupt */
e1000e_wait_isr(d, E1000E_RX0_MSG_ID);
+ /* Read EICR which clears it ready for next interrupt, assert RXQ0 cause */
+ g_assert(e1000e_macreg_read(d, E1000_EICR) & (1 << E1000E_RX0_MSG_ID));
+ /* Write PBACLR to clear the MSIX pending bit */
+ e1000e_macreg_write(d, E1000_PBACLR, (1 << E1000E_RX0_MSG_ID));
/* Check DD bit */
g_assert_cmphex(le32_to_cpu(descr.wb.upper.status_error) &
--
2.45.2
- [PATCH 0/9] hw/e1000e|igb: interrupts and qtests fixes, Nicholas Piggin, 2025/01/17
- [PATCH 2/9] net/e1000e: Permit disabling interrupt throttling, Nicholas Piggin, 2025/01/17
- [PATCH 1/9] qtest/e1000e|igb: Clear interrupt-cause and msix pending bits after irq,
Nicholas Piggin <=
- [PATCH 3/9] qtest/e1000e|igb: assert irqs are clear before triggering an irq, Nicholas Piggin, 2025/01/17
- [PATCH 4/9] net/igb: Fix interrupt throttling interval calculation, Nicholas Piggin, 2025/01/17
- [PATCH 5/9] net/igb: Fix EITR LLI and counter fields, Nicholas Piggin, 2025/01/17
- [PATCH 6/9] net/e1000e|igb: Fix interrupt throttling logic, Nicholas Piggin, 2025/01/17
- [PATCH 7/9] qtest/e1000e|igb: Test interrupt throttling in multiple_transfers test, Nicholas Piggin, 2025/01/17
- [PATCH 9/9] hw/net/e1000e|igb: Remove xitr_guest_value logic, Nicholas Piggin, 2025/01/17