]> xenbits.xensource.com Git - people/liuw/linux.git/commitdiff
xen-netback: remove loop waiting function for-thomas2
authorWei Liu <wei.liu2@citrix.com>
Thu, 7 Aug 2014 12:00:19 +0000 (13:00 +0100)
committerWei Liu <wei.liu2@citrix.com>
Fri, 8 Aug 2014 14:58:16 +0000 (15:58 +0100)
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>
Conflicts:
drivers/net/xen-netback/interface.c
liuw: fix conflict

drivers/net/xen-netback/interface.c

index 020b72f66fae64172bf36c09d8e0d2a49b5cb452..040012ec7c0b250265ae0f58989417ca08d7a394 100644 (file)
@@ -644,25 +644,6 @@ void xenvif_carrier_off(struct xenvif *vif)
        rtnl_unlock();
 }
 
-static void xenvif_wait_unmap_timeout(struct xenvif_queue *queue,
-                                     unsigned int worst_case_skb_lifetime)
-{
-       int i, unmap_timeout = 0;
-
-       for (i = 0; i < MAX_PENDING_REQS; ++i) {
-               if (queue->grant_tx_handle[i] != NETBACK_INVALID_HANDLE) {
-                       unmap_timeout++;
-                       schedule_timeout(msecs_to_jiffies(1000));
-                       if (unmap_timeout > worst_case_skb_lifetime &&
-                           net_ratelimit())
-                               netdev_err(queue->vif->dev,
-                                          "Page still granted! Index: %x\n",
-                                          i);
-                       i = -1;
-               }
-       }
-}
-
 void xenvif_disconnect(struct xenvif *vif)
 {
        struct xenvif_queue *queue = NULL;
@@ -722,25 +703,11 @@ void xenvif_free(struct xenvif *vif)
        struct xenvif_queue *queue = NULL;
        unsigned int num_queues = vif->num_queues;
        unsigned int queue_index;
-       /* Here we want to avoid timeout messages if an skb can be legitimately
-        * stuck somewhere else. Realistically this could be an another vif's
-        * internal or QDisc queue. That another vif also has this
-        * rx_drain_timeout_msecs timeout, but the timer only ditches the
-        * internal queue. After that, the QDisc queue can put in worst case
-        * XEN_NETIF_RX_RING_SIZE / MAX_SKB_FRAGS skbs into that another vif's
-        * internal queue, so we need several rounds of such timeouts until we
-        * can be sure that no another vif should have skb's from us. We are
-        * not sending more skb's, so newly stuck packets are not interesting
-        * for us here.
-        */
-       unsigned int worst_case_skb_lifetime = (rx_drain_timeout_msecs/1000) *
-               DIV_ROUND_UP(XENVIF_QUEUE_LENGTH, (XEN_NETIF_RX_RING_SIZE / MAX_SKB_FRAGS));
 
        unregister_netdev(vif->dev);
 
        for (queue_index = 0; queue_index < num_queues; ++queue_index) {
                queue = &vif->queues[queue_index];
-               xenvif_wait_unmap_timeout(queue, worst_case_skb_lifetime);
                xenvif_deinit_queue(queue);
        }