Skip to content

Commit a3daf3d

Browse files
jgross1davem330
authored andcommitted
xen/netback: fix spurious event detection for common event case
In case of a common event for rx and tx queue the event should be regarded to be spurious if no rx and no tx requests are pending. Unfortunately the condition for testing that is wrong causing to decide a event being spurious if no rx OR no tx requests are pending. Fix that plus using local variables for rx/tx pending indicators in order to split function calls and if condition. Fixes: 2302539 ("xen/netback: use lateeoi irq binding") Signed-off-by: Juergen Gross <[email protected]> Reviewed-by: Jan Beulich <[email protected]> Reviewed-by: Paul Durrant <[email protected]> Reviewed-by: Wei Liu <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 6f19955 commit a3daf3d

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

drivers/net/xen-netback/interface.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,13 +162,15 @@ irqreturn_t xenvif_interrupt(int irq, void *dev_id)
162162
{
163163
struct xenvif_queue *queue = dev_id;
164164
int old;
165+
bool has_rx, has_tx;
165166

166167
old = atomic_fetch_or(NETBK_COMMON_EOI, &queue->eoi_pending);
167168
WARN(old, "Interrupt while EOI pending\n");
168169

169-
/* Use bitwise or as we need to call both functions. */
170-
if ((!xenvif_handle_tx_interrupt(queue) |
171-
!xenvif_handle_rx_interrupt(queue))) {
170+
has_tx = xenvif_handle_tx_interrupt(queue);
171+
has_rx = xenvif_handle_rx_interrupt(queue);
172+
173+
if (!has_rx && !has_tx) {
172174
atomic_andnot(NETBK_COMMON_EOI, &queue->eoi_pending);
173175
xen_irq_lateeoi(irq, XEN_EOI_FLAG_SPURIOUS);
174176
}

0 commit comments

Comments
 (0)