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

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



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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.