]> xenbits.xensource.com Git - people/ssmith/nc2-2.6.27.git/commitdiff
commit d50cf9db5c4126be36997b5de7aebff5cbec7c13
authorSteven Smith <ssmith@weybridge.uk.xensource.com>
Fri, 19 Jun 2009 14:35:17 +0000 (15:35 +0100)
committerSteven Smith <ssmith@weybridge.uk.xensource.com>
Tue, 30 Jun 2009 12:02:13 +0000 (13:02 +0100)
Author: Jose Renato Santos <jsantos@hpl.hp.com>
Date:   Wed Jun 17 10:31:59 2009 -0700

    Deliver receive-side-copied packets as soon as grant copy is completed
    to benefit from cache locality.

Signed-off-by: Jose Renato Santos <jsantos@hpl.hp.com>
drivers/xen/netchannel2/chan.c
drivers/xen/netchannel2/netchannel2_core.h
drivers/xen/netchannel2/recv_packet.c

index 1a1309ef7e6bcb7c3ff7123f93f5eb477a8e4081..08ed641b96eef3b1811d72bc0e0ad3ac0593a7e1 100644 (file)
@@ -1112,6 +1112,7 @@ static void nc2_action(unsigned long ignore)
         }
         spin_unlock_irqrestore(&pending_interfaces_lock,
                                flags);
-       receive_pending_skbs();
+        if(!skb_queue_empty(&pending_rx_queue)) 
+               receive_pending_skbs();
         EXIT();
 }
index 20c1a8b0eba4402dc441c5edacd3882769b0179e..f18039b6a06e030a07ce58eb3e219e084d2fb8e9 100644 (file)
@@ -1123,6 +1123,8 @@ static inline void sanity_check_list(struct list_head *lh)
 extern struct hypercall_batcher pending_rx_hypercalls;
 extern struct ethtool_ops nc2_ethtool_ops;
 
+extern struct sk_buff_head pending_rx_queue;
+
 void nc2_init_poller(struct netchannel2_ring_pair *ncrp);
 void nc2_start_polling(struct netchannel2_ring_pair *ncrp);
 void nc2_stop_polling(struct netchannel2_ring_pair *ncrp);
index 2a2398fd561f48b95f27506d8e4914a9f1d484c4..03a37eb1f3f6181ecf6572b0e8d1f364dd8a3ccc 100644 (file)
@@ -6,7 +6,7 @@
 #include "netchannel2_core.h"
 
 /* Only accessed from the tasklet, so no synchronisation needed. */
-static struct sk_buff_head pending_rx_queue;
+struct sk_buff_head pending_rx_queue;
 
 /* Send as many finish packet messages as will fit on the ring. */
 void send_finish_packet_messages(struct netchannel2_ring_pair *ncrp)
@@ -254,6 +254,20 @@ void nc2_handle_packet_msg(struct netchannel2 *nc,
                 }
 
                 __skb_queue_tail(&pending_rx_queue, skb);
+
+               if (pending_rx_hypercalls.nr_pending_gops >= RX_GRANT_COPY_BATCH) {
+                       flush_prepared_grant_copies(&pending_rx_hypercalls,
+                                                   nc2_rscb_on_gntcopy_fail);
+                       /* since receive could generate ACKs to the start_xmit()
+                          function we need to release the ring lock */
+                       spin_unlock(&ncrp->lock);
+                       /* we should receive the packet as soon as the copy is
+                          complete to benefit from cache locality */
+                       receive_pending_skbs();
+                       spin_lock(&ncrp->lock);
+
+               }
+
         }
         return;