diff options
author | Wei Liu <wei.liu2@citrix.com> | 2014-08-25 11:44:00 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-08-25 20:31:42 -0400 |
commit | e24f8191cc35ae3780b4656a6befae8b8657edc2 (patch) | |
tree | 63977cacb2047745e2bb00e06446dfaae7ff3548 | |
parent | 8dbb200fa4589174202a131bd6dc45b7d569df96 (diff) |
xen-netback: move netif_napi_add before binding interrupt
Interrupt is enabled when bind_interdomain_evtchn_to_irqhandler returns.
If there's interrupt pending interrupt handler is invoked.
NAPI needs to be initialised before binding interrupt otherwise the
interrupt handler will try to scheduling a NAPI instance that is not
initialised yet, resulting in kernel OOPS.
This fixes a regression introduced in ea2c5e13 ("xen-netback: move NAPI
add/remove calls").
Ideally function calls to create kthreads should also be moved before
binding but I intent to fix this regression with minimal changes and
refactor the code with another patch.
Reported-by: Thomas Leonard <talex5@gmail.com>
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/xen-netback/interface.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/xen-netback/interface.c b/drivers/net/xen-netback/interface.c index e29e15dca86e..f379689dde30 100644 --- a/drivers/net/xen-netback/interface.c +++ b/drivers/net/xen-netback/interface.c | |||
@@ -576,6 +576,9 @@ int xenvif_connect(struct xenvif_queue *queue, unsigned long tx_ring_ref, | |||
576 | init_waitqueue_head(&queue->dealloc_wq); | 576 | init_waitqueue_head(&queue->dealloc_wq); |
577 | atomic_set(&queue->inflight_packets, 0); | 577 | atomic_set(&queue->inflight_packets, 0); |
578 | 578 | ||
579 | netif_napi_add(queue->vif->dev, &queue->napi, xenvif_poll, | ||
580 | XENVIF_NAPI_WEIGHT); | ||
581 | |||
579 | if (tx_evtchn == rx_evtchn) { | 582 | if (tx_evtchn == rx_evtchn) { |
580 | /* feature-split-event-channels == 0 */ | 583 | /* feature-split-event-channels == 0 */ |
581 | err = bind_interdomain_evtchn_to_irqhandler( | 584 | err = bind_interdomain_evtchn_to_irqhandler( |
@@ -629,9 +632,6 @@ int xenvif_connect(struct xenvif_queue *queue, unsigned long tx_ring_ref, | |||
629 | wake_up_process(queue->task); | 632 | wake_up_process(queue->task); |
630 | wake_up_process(queue->dealloc_task); | 633 | wake_up_process(queue->dealloc_task); |
631 | 634 | ||
632 | netif_napi_add(queue->vif->dev, &queue->napi, xenvif_poll, | ||
633 | XENVIF_NAPI_WEIGHT); | ||
634 | |||
635 | return 0; | 635 | return 0; |
636 | 636 | ||
637 | err_rx_unbind: | 637 | err_rx_unbind: |