[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1407348973-2433-4-git-send-email-zoltan.kiss@citrix.com>
Date: Wed, 6 Aug 2014 19:16:12 +0100
From: Zoltan Kiss <zoltan.kiss@...rix.com>
To: Wei Liu <wei.liu2@...rix.com>,
Ian Campbell <Ian.Campbell@...rix.com>
CC: Zoltan Kiss <zoltan.kiss@...rix.com>,
David Vrabel <david.vrabel@...rix.com>,
<netdev@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<xen-devel@...ts.xenproject.org>
Subject: [PATCH] xen-netback: Small fixes around internal queue purging
This patch adds an extra internal queue purging for xenvif_carrier_off. It makes
sense to do this when the carrier is switched off.
Also, it uses the proper helper instead of a while loop to the purging at
another place.
Signed-off-by: Zoltan Kiss <zoltan.kiss@...rix.com>
Signed-off-by: David Vrabel <david.vrabel@...rix.com>
Cc: netdev@...r.kernel.org
Cc: linux-kernel@...r.kernel.org
Cc: xen-devel@...ts.xenproject.org
diff --git a/drivers/net/xen-netback/interface.c b/drivers/net/xen-netback/interface.c
index cbe6b51..df9507e 100644
--- a/drivers/net/xen-netback/interface.c
+++ b/drivers/net/xen-netback/interface.c
@@ -533,6 +533,9 @@ void xenvif_carrier_off(struct xenvif *vif)
}
rtnl_unlock();
+
+ skb_queue_purge(&vif->rx_queue);
+ vif->rx_last_skb_slots = 0;
}
void xenvif_disconnect(struct xenvif *vif)
diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-netback/netback.c
index e462cf2c..f728f73 100644
--- a/drivers/net/xen-netback/netback.c
+++ b/drivers/net/xen-netback/netback.c
@@ -1932,7 +1932,6 @@ static void xenvif_start_queue(struct xenvif *vif)
int xenvif_kthread_guest_rx(void *data)
{
struct xenvif *vif = data;
- struct sk_buff *skb;
while (!kthread_should_stop()) {
wait_event_interruptible(vif->wq,
@@ -2009,8 +2008,7 @@ int xenvif_kthread_guest_rx(void *data)
}
/* Bin any remaining skbs */
- while ((skb = skb_dequeue(&vif->rx_queue)) != NULL)
- dev_kfree_skb(skb);
+ skb_queue_purge(&vif->rx_queue);
return 0;
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists