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

Re: [Xen-devel] [PATCH][RFC] correction trouble of short message in UDP

To: Keir Fraser <keir@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH][RFC] correction trouble of short message in UDP
From: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 26 Jan 2007 01:17:19 +1100
Cc: t.horikoshi@xxxxxxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxx, xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Thu, 25 Jan 2007 06:17:06 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <C1DE6927.8345%keir@xxxxxxxxxxxxx>
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/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <E1HA4q4-0003aC-00@xxxxxxxxxxxxxxxxxxxxxxxx> <C1DE6927.8345%keir@xxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.9i
On Thu, Jan 25, 2007 at 02:03:19PM +0000, Keir Fraser wrote:
> 
> So we should replace current netfront_tx_slot_available implementation with:
>  (tx->req_prod_pvt - tx->rsp_cons) < (TX_MAX_TARGET - MAX_SKB_FRAGS - 2)

Yeah that's the idea.  I was thinking of something like this:

diff -r bea505a69722 linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c
--- a/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c      Tue Jan 23 
15:58:05 2007 +0000
+++ b/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c      Fri Jan 26 
01:14:19 2007 +1100
@@ -138,8 +138,10 @@ static inline int netif_needs_gso(struct
 
 #define GRANT_INVALID_REF      0
 
-#define NET_TX_RING_SIZE __RING_SIZE((struct netif_tx_sring *)0, PAGE_SIZE)
-#define NET_RX_RING_SIZE __RING_SIZE((struct netif_rx_sring *)0, PAGE_SIZE)
+#define NET_TX_RING_SIZE \
+       (__RING_SIZE((struct netif_tx_sring *)0, PAGE_SIZE) & 255)
+#define NET_RX_RING_SIZE \
+       (__RING_SIZE((struct netif_rx_sring *)0, PAGE_SIZE) & 255)
 
 struct netfront_info {
        struct list_head list;
@@ -159,7 +161,7 @@ struct netfront_info {
        /* Receive-ring batched refills. */
 #define RX_MIN_TARGET 8
 #define RX_DFL_MIN_TARGET 64
-#define RX_MAX_TARGET min_t(int, NET_RX_RING_SIZE, 256)
+#define RX_MAX_TARGET NET_RX_RING_SIZE
        unsigned rx_min_target, rx_max_target, rx_target;
        struct sk_buff_head rx_batch;
 
@@ -172,7 +174,7 @@ struct netfront_info {
        struct sk_buff *tx_skbs[NET_TX_RING_SIZE+1];
        struct sk_buff *rx_skbs[NET_RX_RING_SIZE];
 
-#define TX_MAX_TARGET min_t(int, NET_RX_RING_SIZE, 256)
+#define TX_MAX_TARGET NET_TX_RING_SIZE
        grant_ref_t gref_tx_head;
        grant_ref_t grant_tx_ref[NET_TX_RING_SIZE + 1];
        grant_ref_t gref_rx_head;

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

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