aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorWei Liu <wei.liu2@citrix.com>2014-08-12 06:48:08 -0400
committerDavid S. Miller <davem@davemloft.net>2014-08-13 23:07:44 -0400
commitb1252858213f39700dac1bc3295b6e88f6cce24b (patch)
treea97ba22dad20761ac3eddcd7cf51463a872c4d60 /drivers/net
parenta64bd934528e26e8956112e43a279fba2ee0634e (diff)
xen-netback: remove loop waiting function
The original implementation relies on a loop to check if all inflight packets are freed. Now we have proper reference counting, there's no need to use loop anymore. Signed-off-by: Wei Liu <wei.liu2@citrix.com> Cc: Ian Campbell <ian.campbell@citrix.com> Cc: Zoltan Kiss <zoltan.kiss@citrix.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/xen-netback/interface.c29
1 files changed, 0 insertions, 29 deletions
diff --git a/drivers/net/xen-netback/interface.c b/drivers/net/xen-netback/interface.c
index 0aaca902699a..e29e15dca86e 100644
--- a/drivers/net/xen-netback/interface.c
+++ b/drivers/net/xen-netback/interface.c
@@ -660,25 +660,6 @@ void xenvif_carrier_off(struct xenvif *vif)
660 rtnl_unlock(); 660 rtnl_unlock();
661} 661}
662 662
663static void xenvif_wait_unmap_timeout(struct xenvif_queue *queue,
664 unsigned int worst_case_skb_lifetime)
665{
666 int i, unmap_timeout = 0;
667
668 for (i = 0; i < MAX_PENDING_REQS; ++i) {
669 if (queue->grant_tx_handle[i] != NETBACK_INVALID_HANDLE) {
670 unmap_timeout++;
671 schedule_timeout(msecs_to_jiffies(1000));
672 if (unmap_timeout > worst_case_skb_lifetime &&
673 net_ratelimit())
674 netdev_err(queue->vif->dev,
675 "Page still granted! Index: %x\n",
676 i);
677 i = -1;
678 }
679 }
680}
681
682void xenvif_disconnect(struct xenvif *vif) 663void xenvif_disconnect(struct xenvif *vif)
683{ 664{
684 struct xenvif_queue *queue = NULL; 665 struct xenvif_queue *queue = NULL;
@@ -731,21 +712,11 @@ void xenvif_free(struct xenvif *vif)
731 struct xenvif_queue *queue = NULL; 712 struct xenvif_queue *queue = NULL;
732 unsigned int num_queues = vif->num_queues; 713 unsigned int num_queues = vif->num_queues;
733 unsigned int queue_index; 714 unsigned int queue_index;
734 /* Here we want to avoid timeout messages if an skb can be legitimately
735 * stuck somewhere else. Realistically this could be an another vif's
736 * internal or QDisc queue. That another vif also has this
737 * rx_drain_timeout_msecs timeout, so give it time to drain out.
738 * Although if that other guest wakes up just before its timeout happens
739 * and takes only one skb from QDisc, it can hold onto other skbs for a
740 * longer period.
741 */
742 unsigned int worst_case_skb_lifetime = (rx_drain_timeout_msecs/1000);
743 715
744 unregister_netdev(vif->dev); 716 unregister_netdev(vif->dev);
745 717
746 for (queue_index = 0; queue_index < num_queues; ++queue_index) { 718 for (queue_index = 0; queue_index < num_queues; ++queue_index) {
747 queue = &vif->queues[queue_index]; 719 queue = &vif->queues[queue_index];
748 xenvif_wait_unmap_timeout(queue, worst_case_skb_lifetime);
749 xenvif_deinit_queue(queue); 720 xenvif_deinit_queue(queue);
750 } 721 }
751 722