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-devel

[Xen-devel] [PATCH] linux-2.6.18/netback: Re-factor net_tx_action_deallo

To: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] linux-2.6.18/netback: Re-factor net_tx_action_dealloc() slightly
From: "Jan Beulich" <JBeulich@xxxxxxxxxx>
Date: Fri, 17 Dec 2010 09:44:01 +0000
Cc: paul.durrant@xxxxxxxxxx
Delivery-date: Fri, 17 Dec 2010 01:45:39 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
From: Paul Durrant <paul.durrant@xxxxxxxxxx>
Subject: 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>

--- sle10sp4-2010-12-15.orig/drivers/xen/netback/netback.c
+++ sle10sp4-2010-12-15/drivers/xen/netback/netback.c
@@ -924,7 +924,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;
@@ -959,11 +958,17 @@ inline static void net_tx_action_dealloc
                        gop++;
                }
 
-               if (netbk_copy_skb_mode != NETBK_DELAYED_COPY_SKB ||
-                   list_empty(&pending_inuse_head))
-                       break;
+       } while (dp != dealloc_prod);
+
+       dealloc_cons = dc;
 
-               /* Copy any entries that have been pending for too long. */
+       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;
@@ -985,13 +990,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;



Attachment: xen-netback-tx_action_dealloc-refactor.patch
Description: Text document

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] linux-2.6.18/netback: Re-factor net_tx_action_dealloc() slightly, Jan Beulich <=