[1/2] xen-netback: Disable NAPI after disabling interrupts

Message ID 1414510171-12853-2-git-send-email-david.vrabel@citrix.com
State New
Headers show

Commit Message

David Vrabel Oct. 28, 2014, 3:29 p.m.
From: Zoltan Kiss <zoltan.kiss@linaro.org>

Otherwise the interrupt handler still calls napi_complete. Although it
won't schedule NAPI again as either NAPI_STATE_DISABLE or
NAPI_STATE_SCHED is set, it is just unnecessary, and it makes more
sense to do this way.

Signed-off-by: Zoltan Kiss <zoltan.kiss@linaro.org>
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
---
 drivers/net/xen-netback/interface.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Wei Liu Oct. 29, 2014, 11:05 a.m. | #1
On Tue, Oct 28, 2014 at 03:29:30PM +0000, David Vrabel wrote:
> From: Zoltan Kiss <zoltan.kiss@linaro.org>
> 
> Otherwise the interrupt handler still calls napi_complete. Although it
> won't schedule NAPI again as either NAPI_STATE_DISABLE or
> NAPI_STATE_SCHED is set, it is just unnecessary, and it makes more
> sense to do this way.
> 
> Signed-off-by: Zoltan Kiss <zoltan.kiss@linaro.org>
> Signed-off-by: David Vrabel <david.vrabel@citrix.com>

Acked-by: Wei Liu <wei.liu2@citrix.com>

> ---
>  drivers/net/xen-netback/interface.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/xen-netback/interface.c b/drivers/net/xen-netback/interface.c
> index 895fe84..a6a32d3 100644
> --- a/drivers/net/xen-netback/interface.c
> +++ b/drivers/net/xen-netback/interface.c
> @@ -235,10 +235,10 @@ static void xenvif_down(struct xenvif *vif)
>  
>  	for (queue_index = 0; queue_index < num_queues; ++queue_index) {
>  		queue = &vif->queues[queue_index];
> -		napi_disable(&queue->napi);
>  		disable_irq(queue->tx_irq);
>  		if (queue->tx_irq != queue->rx_irq)
>  			disable_irq(queue->rx_irq);
> +		napi_disable(&queue->napi);
>  		del_timer_sync(&queue->credit_timeout);
>  	}
>  }
> -- 
> 1.7.10.4
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/drivers/net/xen-netback/interface.c b/drivers/net/xen-netback/interface.c
index 895fe84..a6a32d3 100644
--- a/drivers/net/xen-netback/interface.c
+++ b/drivers/net/xen-netback/interface.c
@@ -235,10 +235,10 @@  static void xenvif_down(struct xenvif *vif)
 
 	for (queue_index = 0; queue_index < num_queues; ++queue_index) {
 		queue = &vif->queues[queue_index];
-		napi_disable(&queue->napi);
 		disable_irq(queue->tx_irq);
 		if (queue->tx_irq != queue->rx_irq)
 			disable_irq(queue->rx_irq);
+		napi_disable(&queue->napi);
 		del_timer_sync(&queue->credit_timeout);
 	}
 }