Commit ea2c5e13 authored by Wei Liu's avatar Wei Liu Committed by David S. Miller

xen-netback: move NAPI add/remove calls

Originally netif_napi_add was in xenvif_init_queue and netif_napi_del
was in xenvif_deinit_queue, while kthreads were handled in
xenvif_connect and xenvif_disconnect. Move netif_napi_add and
netif_napi_del to xenvif_connect and xenvif_disconnect so that they
reside together with kthread operations.
Signed-off-by: default avatarWei Liu <wei.liu2@citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Zoltan Kiss <zoltan.kiss@citrix.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 68809958
...@@ -524,9 +524,6 @@ int xenvif_init_queue(struct xenvif_queue *queue) ...@@ -524,9 +524,6 @@ int xenvif_init_queue(struct xenvif_queue *queue)
init_timer(&queue->rx_stalled); init_timer(&queue->rx_stalled);
netif_napi_add(queue->vif->dev, &queue->napi, xenvif_poll,
XENVIF_NAPI_WEIGHT);
return 0; return 0;
} }
...@@ -614,6 +611,9 @@ int xenvif_connect(struct xenvif_queue *queue, unsigned long tx_ring_ref, ...@@ -614,6 +611,9 @@ int xenvif_connect(struct xenvif_queue *queue, unsigned long tx_ring_ref,
wake_up_process(queue->task); wake_up_process(queue->task);
wake_up_process(queue->dealloc_task); wake_up_process(queue->dealloc_task);
netif_napi_add(queue->vif->dev, &queue->napi, xenvif_poll,
XENVIF_NAPI_WEIGHT);
return 0; return 0;
err_rx_unbind: err_rx_unbind:
...@@ -672,6 +672,8 @@ void xenvif_disconnect(struct xenvif *vif) ...@@ -672,6 +672,8 @@ void xenvif_disconnect(struct xenvif *vif)
for (queue_index = 0; queue_index < num_queues; ++queue_index) { for (queue_index = 0; queue_index < num_queues; ++queue_index) {
queue = &vif->queues[queue_index]; queue = &vif->queues[queue_index];
netif_napi_del(&queue->napi);
if (queue->task) { if (queue->task) {
del_timer_sync(&queue->rx_stalled); del_timer_sync(&queue->rx_stalled);
kthread_stop(queue->task); kthread_stop(queue->task);
...@@ -704,7 +706,6 @@ void xenvif_disconnect(struct xenvif *vif) ...@@ -704,7 +706,6 @@ void xenvif_disconnect(struct xenvif *vif)
void xenvif_deinit_queue(struct xenvif_queue *queue) void xenvif_deinit_queue(struct xenvif_queue *queue)
{ {
free_xenballooned_pages(MAX_PENDING_REQS, queue->mmap_pages); free_xenballooned_pages(MAX_PENDING_REQS, queue->mmap_pages);
netif_napi_del(&queue->napi);
} }
void xenvif_free(struct xenvif *vif) void xenvif_free(struct xenvif *vif)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment