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 1/4] xen: netback: Fixes for delayed copy of tx netwo

To: jeremy@xxxxxxxx
Subject: [Xen-devel] [PATCH 1/4] xen: netback: Fixes for delayed copy of tx network packets.
From: Ian Campbell <ian.campbell@xxxxxxxxxx>
Date: Fri, 11 Jun 2010 15:19:08 +0100
Cc: Steven.Smith@xxxxxxxxxxxxx, Keir Fraser <keir.fraser@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx, Ian Campbell <ian.campbell@xxxxxxxxxx>, JBeulich@xxxxxxxxxx
Delivery-date: Fri, 11 Jun 2010 07:22:03 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <1276265928.19091.3469.camel@xxxxxxxxxxxxxxxxxxxxxx>
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>
References: <1276265928.19091.3469.camel@xxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
From: Keir Fraser <keir.fraser@xxxxxxxxxx>

 - Should call net_tx_action_dealloc() even when dealloc ring is
   empty, as there may in any case be work to do on the
   pending_inuse list.
 - Should not exit directly from the middle of the tx_action tasklet,
   as the tx_pending_timer should always be checked and updated at the
   end of the tasklet.

Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
[picked from linux-2.6.18-xen.hg 959:1a97bd686258, ported across a43e2175 
"xen/netback: move code around"]
---
 drivers/xen/netback/netback.c |   25 ++++++++++++-------------
 1 files changed, 12 insertions(+), 13 deletions(-)

diff --git a/drivers/xen/netback/netback.c b/drivers/xen/netback/netback.c
index b23fab0..9e4793f 100644
--- a/drivers/xen/netback/netback.c
+++ b/drivers/xen/netback/netback.c
@@ -1384,16 +1384,6 @@ static void net_tx_submit(struct xen_netbk *netbk)
                netif_rx_ni(skb);
                netif->dev->last_rx = jiffies;
        }
-
-       if (netbk_copy_skb_mode == NETBK_DELAYED_COPY_SKB &&
-           !list_empty(&netbk->pending_inuse_head)) {
-               struct netbk_tx_pending_inuse *oldest;
-
-               oldest = list_entry(netbk->pending_inuse_head.next,
-                                   struct netbk_tx_pending_inuse, list);
-               mod_timer(&netbk->netbk_tx_pending_timer,
-                               oldest->alloc_time + HZ);
-       }
 }
 
 /* Called after netfront has transmitted */
@@ -1403,19 +1393,28 @@ static void net_tx_action(unsigned long data)
        unsigned nr_mops;
        int ret;
 
-       if (netbk->dealloc_cons != netbk->dealloc_prod)
-               net_tx_action_dealloc(netbk);
+       net_tx_action_dealloc(netbk);
 
        nr_mops = net_tx_build_mops(netbk);
 
        if (nr_mops == 0)
-               return;
+               goto out;
 
        ret = HYPERVISOR_grant_table_op(GNTTABOP_map_grant_ref,
                                        netbk->tx_map_ops, nr_mops);
        BUG_ON(ret);
 
        net_tx_submit(netbk);
+out:
+       if (netbk_copy_skb_mode == NETBK_DELAYED_COPY_SKB &&
+           !list_empty(&netbk->pending_inuse_head)) {
+               struct netbk_tx_pending_inuse *oldest;
+
+               oldest = list_entry(netbk->pending_inuse_head.next,
+                                   struct netbk_tx_pending_inuse, list);
+               mod_timer(&netbk->netbk_tx_pending_timer,
+                               oldest->alloc_time + HZ);
+       }
 }
 
 static void netif_idx_release(struct xen_netbk *netbk, u16 pending_idx)
-- 
1.5.6.5


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