Commit 743b0a92 authored by Zoltan Kiss's avatar Zoltan Kiss Committed by David S. Miller

xen-netback: Fix vif->disable handling

In the patch called "xen-netback: Turn off the carrier if the guest is not able
to receive" new branches were introduced to this if statement, risking that a
queue with non-zero id can reenable the disabled interface.
Signed-off-by: default avatarZoltan Kiss <zoltan.kiss@citrix.com>
Signed-off-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
Cc: netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: xen-devel@lists.xenproject.org
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 6c5caae0
...@@ -2025,9 +2025,15 @@ int xenvif_kthread_guest_rx(void *data) ...@@ -2025,9 +2025,15 @@ int xenvif_kthread_guest_rx(void *data)
* context so we defer it here, if this thread is * context so we defer it here, if this thread is
* associated with queue 0. * associated with queue 0.
*/ */
if (unlikely(queue->vif->disabled && queue->id == 0)) if (unlikely(queue->vif->disabled && queue->id == 0)) {
xenvif_carrier_off(queue->vif); xenvif_carrier_off(queue->vif);
else if (unlikely(test_and_clear_bit(QUEUE_STATUS_RX_PURGE_EVENT, } else if (unlikely(queue->vif->disabled)) {
/* kthread_stop() would be called upon this thread soon,
* be a bit proactive
*/
skb_queue_purge(&queue->rx_queue);
queue->rx_last_skb_slots = 0;
} else if (unlikely(test_and_clear_bit(QUEUE_STATUS_RX_PURGE_EVENT,
&queue->status))) { &queue->status))) {
xenvif_rx_purge_event(queue); xenvif_rx_purge_event(queue);
} else if (!netif_carrier_ok(queue->vif->dev)) { } else if (!netif_carrier_ok(queue->vif->dev)) {
......
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