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

[Xen-changelog] [xen-unstable] [NET] front: Move rx req pushing to one spot



# HG changeset patch
# User kfraser@xxxxxxxxxxxxxxxxxxxxx
# Node ID 275660d492c6ea74d8fbbe26446d06ab71316ac0
# Parent  762ae310d878c286a43110499326dfb7e1e13d53
[NET] front: Move rx req pushing to one spot

This patch moves all rx request pushing to network_alloc_rx_buffers.
This is needed to reduce churn for TSO.  More importantly, this makes
it easier to send notifications when adding rx requests which is
required for having a queue in dom0.

Signed-off-by: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
---
 linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff -r 762ae310d878 -r 275660d492c6 
linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c
--- a/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c      Fri Jul 28 
17:00:10 2006 +0100
+++ b/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c      Fri Jul 28 
17:03:26 2006 +0100
@@ -600,14 +600,17 @@ static void network_alloc_rx_buffers(str
                        /* Could not allocate any skbuffs. Try again later. */
                        mod_timer(&np->rx_refill_timer,
                                  jiffies + (HZ/10));
-                       return;
+                       break;
                }
                __skb_queue_tail(&np->rx_batch, skb);
        }
 
        /* Is the batch large enough to be worthwhile? */
-       if (i < (np->rx_target/2))
+       if (i < (np->rx_target/2)) {
+               if (req_prod > np->rx.sring->req_prod)
+                       goto push;
                return;
+       }
 
        /* Adjust our fill target if we risked running out of buffers. */
        if (((req_prod - np->rx.sring->rsp_prod) < (np->rx_target / 4)) &&
@@ -678,6 +681,7 @@ static void network_alloc_rx_buffers(str
 
        /* Above is a suitable barrier to ensure backend will see requests. */
        np->rx.req_prod_pvt = req_prod + i;
+ push:
        RING_PUSH_REQUESTS(&np->rx);
 }
 
@@ -875,7 +879,6 @@ static void xennet_move_rx_slot(struct n
        RING_GET_REQUEST(&np->rx, np->rx.req_prod_pvt)->id = new;
        RING_GET_REQUEST(&np->rx, np->rx.req_prod_pvt)->gref = ref;
        np->rx.req_prod_pvt++;
-       RING_PUSH_REQUESTS(&np->rx);
 }
 
 static int netif_poll(struct net_device *dev, int *pbudget)
@@ -1207,7 +1210,6 @@ static void network_connect(struct net_d
        }
 
        np->rx.req_prod_pvt = requeue_idx;
-       RING_PUSH_REQUESTS(&np->rx);
 
        /*
         * Step 3: All public and private state should now be sane.  Get

_______________________________________________
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®.