diff options
author | Zoltan Kiss <zoltan.kiss@citrix.com> | 2014-08-07 13:38:38 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-08-07 16:02:56 -0700 |
commit | 743b0a92b92a0e1b6a68497ccd18a0d60a4b6082 (patch) | |
tree | 4845ec99fcac9cfec7e0eb3b1a61d65964e502a3 /drivers/net/xen-netback/netback.c | |
parent | 6c5caae01bf9f0505c272882ef2fc50f4249d8d6 (diff) | |
download | op-kernel-dev-743b0a92b92a0e1b6a68497ccd18a0d60a4b6082.zip op-kernel-dev-743b0a92b92a0e1b6a68497ccd18a0d60a4b6082.tar.gz |
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: Zoltan Kiss <zoltan.kiss@citrix.com>
Signed-off-by: David 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: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/xen-netback/netback.c')
-rw-r--r-- | drivers/net/xen-netback/netback.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-netback/netback.c index aa20933..4734472 100644 --- a/drivers/net/xen-netback/netback.c +++ b/drivers/net/xen-netback/netback.c @@ -2025,9 +2025,15 @@ int xenvif_kthread_guest_rx(void *data) * context so we defer it here, if this thread is * 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); - 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))) { xenvif_rx_purge_event(queue); } else if (!netif_carrier_ok(queue->vif->dev)) { |