All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Nicholas Piggin" <npiggin@gmail.com>
To: "Yan Vugenfirer" <yvugenfi@redhat.com>
Cc: <qemu-devel@nongnu.org>,
	"Dmitry Fleytman" <dmitry.fleytman@gmail.com>,
	"Akihiko Odaki" <akihiko.odaki@daynix.com>,
	"Jason Wang" <jasowang@redhat.com>,
	"Sriram Yagnaraman" <sriram.yagnaraman@ericsson.com>,
	"Fabiano Rosas" <farosas@suse.de>,
	"Laurent Vivier" <lvivier@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>
Subject: Re: [PATCH 3/9] qtest/e1000e|igb: assert irqs are clear before triggering an irq
Date: Tue, 21 Jan 2025 14:45:27 +1000	[thread overview]
Message-ID: <D77H7J5KX2NC.1A25FAUCNO1BV@gmail.com> (raw)
In-Reply-To: <CAGoVJZxkm_zj7RPBs9Lk3tpgYfzNi9UdsVOKsDibGZ98i+Ddew@mail.gmail.com>

On Sun Jan 19, 2025 at 7:22 PM AEST, Yan Vugenfirer wrote:
> On Fri, Jan 17, 2025 at 7:05 PM Nicholas Piggin <npiggin@gmail.com> wrote:
>
>> Assert there is no existing irq raised that would lead to a false
>> positive interrupt test.
>>
>> e1000e has to disable interrupt throttling for this test, because
>> it can cause delayed superfluous interrupts which trip the assertions.
>>
>> Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
>> ---
>>  tests/qtest/libqos/e1000e.h |  1 +
>>  tests/qtest/e1000e-test.c   | 10 ++++++++++
>>  tests/qtest/igb-test.c      |  6 ++++++
>>  tests/qtest/libqos/e1000e.c |  9 ++++++++-
>>  4 files changed, 25 insertions(+), 1 deletion(-)
>>
>> diff --git a/tests/qtest/libqos/e1000e.h b/tests/qtest/libqos/e1000e.h
>> index 30643c80949..7154aec0339 100644
>> --- a/tests/qtest/libqos/e1000e.h
>> +++ b/tests/qtest/libqos/e1000e.h
>> @@ -54,6 +54,7 @@ static inline uint32_t e1000e_macreg_read(QE1000E *d,
>> uint32_t reg)
>>      return qpci_io_readl(&d_pci->pci_dev, d_pci->mac_regs, reg);
>>  }
>>
>> +bool e1000e_seen_isr(QE1000E *d, uint16_t msg_id);
>>  void e1000e_wait_isr(QE1000E *d, uint16_t msg_id);
>>  void e1000e_tx_ring_push(QE1000E *d, void *descr);
>>  void e1000e_rx_ring_push(QE1000E *d, void *descr);
>> diff --git a/tests/qtest/e1000e-test.c b/tests/qtest/e1000e-test.c
>> index 746d26cfb67..9ab81ecff5b 100644
>> --- a/tests/qtest/e1000e-test.c
>> +++ b/tests/qtest/e1000e-test.c
>> @@ -61,6 +61,9 @@ static void e1000e_send_verify(QE1000E *d, int
>> *test_sockets, QGuestAllocator *a
>>                                     E1000_TXD_DTYP_D   |
>>                                     sizeof(buffer));
>>
>> +    /* Ensure the interrupt has not been taken already */
>> +    g_assert(!e1000e_seen_isr(d, E1000E_TX0_MSG_ID));
>> +
>>      /* Put descriptor to the ring */
>>      e1000e_tx_ring_push(d, &descr);
>>
>> @@ -105,6 +108,9 @@ static void e1000e_receive_verify(QE1000E *d, int
>> *test_sockets, QGuestAllocator
>>      char buffer[64];
>>      int ret;
>>
>> +    /* Ensure the interrupt has not been taken already */
>> +    g_assert(!e1000e_seen_isr(d, E1000E_RX0_MSG_ID));
>> +
>>
> I don't think potentially crashing the guest is the right solution.
> I suggest maybe substituting with logging.

This is just for qtest where assertions are used to indicate
failure.

Thanks,
Nick


  reply	other threads:[~2025-01-21  4:46 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-17 17:02 [PATCH 0/9] hw/e1000e|igb: interrupts and qtests fixes Nicholas Piggin
2025-01-17 17:02 ` [PATCH 1/9] qtest/e1000e|igb: Clear interrupt-cause and msix pending bits after irq Nicholas Piggin
2025-01-17 17:02 ` [PATCH 2/9] net/e1000e: Permit disabling interrupt throttling Nicholas Piggin
2025-01-17 17:02 ` [PATCH 3/9] qtest/e1000e|igb: assert irqs are clear before triggering an irq Nicholas Piggin
2025-01-18  8:14   ` Akihiko Odaki
2025-01-19  9:22   ` Yan Vugenfirer
2025-01-21  4:45     ` Nicholas Piggin [this message]
2025-01-17 17:03 ` [PATCH 4/9] net/igb: Fix interrupt throttling interval calculation Nicholas Piggin
2025-01-18  8:22   ` Akihiko Odaki
2025-01-17 17:03 ` [PATCH 5/9] net/igb: Fix EITR LLI and counter fields Nicholas Piggin
2025-01-18  8:37   ` Akihiko Odaki
2025-01-17 17:03 ` [PATCH 6/9] net/e1000e|igb: Fix interrupt throttling logic Nicholas Piggin
2025-01-18  9:50   ` Akihiko Odaki
2025-01-17 17:03 ` [PATCH 7/9] qtest/e1000e|igb: Test interrupt throttling in multiple_transfers test Nicholas Piggin
2025-01-17 17:03 ` [PATCH 8/9] net/e1000e: Fix xITR minimum value Nicholas Piggin
2025-01-18  7:50   ` Akihiko Odaki
2025-01-17 17:03 ` [PATCH 9/9] hw/net/e1000e|igb: Remove xitr_guest_value logic Nicholas Piggin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=D77H7J5KX2NC.1A25FAUCNO1BV@gmail.com \
    --to=npiggin@gmail.com \
    --cc=akihiko.odaki@daynix.com \
    --cc=dmitry.fleytman@gmail.com \
    --cc=farosas@suse.de \
    --cc=jasowang@redhat.com \
    --cc=lvivier@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=sriram.yagnaraman@ericsson.com \
    --cc=yvugenfi@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.