WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [linux-2.6.18-xen] xen/netback: Re-factor net_tx_action_

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [linux-2.6.18-xen] xen/netback: Re-factor net_tx_action_dealloc() slightly
From: "Xen patchbot-linux-2.6.18-xen" <patchbot-linux-2.6.18-xen@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 17 Dec 2010 02:20:06 -0800
Delivery-date: Fri, 17 Dec 2010 02:20:17 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# 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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [linux-2.6.18-xen] xen/netback: Re-factor net_tx_action_dealloc() slightly, Xen patchbot-linux-2.6.18-xen <=