[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [linux-2.6.18-xen] xen/netback: Re-factor net_tx_action_dealloc() slightly



# HG changeset patch
# User Keir Fraser <keir@xxxxxxx>
# Date 1292580521 0
# Node ID e4ee8e5b6f937f6c848aae567c9b7ff63acb41f4
# Parent  f3d9d0deec4e192bfed66e26de11d2569ebc3615
xen/netback: Re-factor net_tx_action_dealloc() slightly

There is no need for processing of the pending_inuse list to be within
the dealloc_prod/cons loop.

Signed-off-by: Paul Durrant <paul.durrant@xxxxxxxxxx>
Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>
---
 drivers/xen/netback/netback.c |   25 ++++++++++++-------------
 1 files changed, 12 insertions(+), 13 deletions(-)

diff -r f3d9d0deec4e -r e4ee8e5b6f93 drivers/xen/netback/netback.c
--- a/drivers/xen/netback/netback.c     Fri Dec 10 10:48:31 2010 +0000
+++ b/drivers/xen/netback/netback.c     Fri Dec 17 10:08:41 2010 +0000
@@ -915,7 +915,6 @@ inline static void net_tx_action_dealloc
        u16 pending_idx;
        PEND_RING_IDX dc, dp;
        netif_t *netif;
-       int ret;
        LIST_HEAD(list);
 
        dc = dealloc_cons;
@@ -950,11 +949,17 @@ inline static void net_tx_action_dealloc
                        gop++;
                }
 
-               if (netbk_copy_skb_mode != NETBK_DELAYED_COPY_SKB ||
-                   list_empty(&pending_inuse_head))
-                       break;
-
-               /* Copy any entries that have been pending for too long. */
+       } while (dp != dealloc_prod);
+
+       dealloc_cons = dc;
+
+       if (HYPERVISOR_grant_table_op(GNTTABOP_unmap_grant_ref,
+                                     tx_unmap_ops, gop - tx_unmap_ops))
+               BUG();
+
+       /* Copy any entries that have been pending for too long. */
+       if (netbk_copy_skb_mode == NETBK_DELAYED_COPY_SKB &&
+           !list_empty(&pending_inuse_head)) {
                list_for_each_entry_safe(inuse, n, &pending_inuse_head, list) {
                        if (time_after(inuse->alloc_time + HZ / 2, jiffies))
                                break;
@@ -976,13 +981,7 @@ inline static void net_tx_action_dealloc
 
                        break;
                }
-       } while (dp != dealloc_prod);
-
-       dealloc_cons = dc;
-
-       ret = HYPERVISOR_grant_table_op(
-               GNTTABOP_unmap_grant_ref, tx_unmap_ops, gop - tx_unmap_ops);
-       BUG_ON(ret);
+       }
 
        list_for_each_entry_safe(inuse, n, &list, list) {
                pending_idx = inuse - pending_inuse;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.