ia64/xen-unstable

changeset 10860:23c37bc942da

[NET] front: Added feature-rx-notify

This patch adds support to the frontend for notifying the backend whenever
the rx ring is refilled. This is required in order for the backend to
get a tx queue.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

Modified to only send notification if req_event index is set
appropriately.

Signed-off-by: Keir Fraser <keir@xensource.com>
author kfraser@localhost.localdomain
date Fri Jul 28 17:13:08 2006 +0100 (2006-07-28)
parents 2e91ad1a89ce
children 93c785354dd1
files linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c xen/include/public/io/netif.h
line diff
     1.1 --- a/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c	Fri Jul 28 17:04:55 2006 +0100
     1.2 +++ b/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c	Fri Jul 28 17:13:08 2006 +0100
     1.3 @@ -326,6 +326,12 @@ again:
     1.4  		goto abort_transaction;
     1.5  	}
     1.6  
     1.7 +	err = xenbus_printf(xbt, dev->nodename, "feature-rx-notify", "%d", 1);
     1.8 +	if (err) {
     1.9 +		message = "writing feature-rx-notify";
    1.10 +		goto abort_transaction;
    1.11 +	}
    1.12 +
    1.13  	err = xenbus_transaction_end(xbt, 0);
    1.14  	if (err) {
    1.15  		if (err == -EAGAIN)
    1.16 @@ -569,7 +575,7 @@ static void network_alloc_rx_buffers(str
    1.17  	unsigned short id;
    1.18  	struct netfront_info *np = netdev_priv(dev);
    1.19  	struct sk_buff *skb;
    1.20 -	int i, batch_target;
    1.21 +	int i, batch_target, notify;
    1.22  	RING_IDX req_prod = np->rx.req_prod_pvt;
    1.23  	struct xen_memory_reservation reservation;
    1.24  	grant_ref_t ref;
    1.25 @@ -682,7 +688,9 @@ static void network_alloc_rx_buffers(str
    1.26  	/* Above is a suitable barrier to ensure backend will see requests. */
    1.27  	np->rx.req_prod_pvt = req_prod + i;
    1.28   push:
    1.29 -	RING_PUSH_REQUESTS(&np->rx);
    1.30 +	RING_PUSH_REQUESTS_AND_CHECK_NOTIFY(&np->rx, notify);
    1.31 +	if (notify)
    1.32 +		notify_remote_via_irq(np->irq);
    1.33  }
    1.34  
    1.35  static void xennet_make_frags(struct sk_buff *skb, struct net_device *dev,
     2.1 --- a/xen/include/public/io/netif.h	Fri Jul 28 17:04:55 2006 +0100
     2.2 +++ b/xen/include/public/io/netif.h	Fri Jul 28 17:13:08 2006 +0100
     2.3 @@ -13,10 +13,11 @@
     2.4  #include "../grant_table.h"
     2.5  
     2.6  /*
     2.7 - * Note that there is *never* any need to notify the backend when
     2.8 - * enqueuing receive requests (struct netif_rx_request). Notifications
     2.9 - * after enqueuing any other type of message should be conditional on
    2.10 + * Notifications after enqueuing any type of message should be conditional on
    2.11   * the appropriate req_event or rsp_event field in the shared ring.
    2.12 + * If the client sends notification for rx requests then it should specify
    2.13 + * feature 'feature-rx-notify' via xenbus. Otherwise the backend will assume
    2.14 + * that it cannot safely queue packets (as it may not be kicked to send them).
    2.15   */
    2.16  
    2.17  /*