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

Re: [Xen-devel] network hang trigger

I've just modified the netfront.c (haven't touched netback.c yet). I've done two modifications: (1) free sk_buff properly on the transmit path (2) In netif_poll(...) function, packets **should not** be passed to netif_rx(); instead, use: int netif_receive_skb(struct sk_buff *skb).

With these two modifications, under 'ping -s 6000', network only occasionally loses a few packets but *very soon* recovers. It's much more stable than before. I'll take a closer look at netfront.c and netback.c tomorrow.

Here is the patch. Please try it out. With your results, the changes may get pushed into the repository.

-- Bin Ren

===== linux-2.6.8.1-xen-sparse/drivers/xen/netfront/netfront.c 1.49 vs edited ===== --- 1.49/linux-2.6.8.1-xen-sparse/drivers/xen/netfront/netfront.c 2004-08-27 13:28:33 +01:00 +++ edited/linux-2.6.8.1-xen-sparse/drivers/xen/netfront/netfront.c 2004-09-16 00:34:33 +01:00 @@ -329,7 +329,7 @@
    {
        printk(KERN_ALERT "%s: full queue wasn't stopped!\n", dev->name);
        netif_stop_queue(dev);
-        return -ENOBUFS;
+       goto drop;
    }

    if ( unlikely((((unsigned long)skb->data & ~PAGE_MASK) + skb->len) >=
@@ -337,7 +337,7 @@
    {
        struct sk_buff *new_skb;
        if ( unlikely((new_skb = alloc_skb_page()) == NULL) )
-            return 1;
+            goto drop;
        skb_put(new_skb, skb->len);
        memcpy(new_skb->data, skb->data, skb->len);
        dev_kfree_skb(skb);
@@ -349,7 +349,7 @@
    if ( np->backend_state != BEST_CONNECTED )
    {
        spin_unlock_irq(&np->tx_lock);
-        return 1;
+        goto drop;
    }

    i = np->tx->req_prod;
@@ -385,6 +385,10 @@
        notify_via_evtchn(np->evtchn);

    return 0;
+
+ drop:
+    dev_kfree_skb(skb);
+    return 0;
}


@@ -501,7 +505,7 @@
        skb->protocol = eth_type_trans(skb, dev);

        /* Pass it up. */
-        netif_rx(skb);
+        netif_receive_skb(skb);
        dev->last_rx = jiffies;
    }


-------------------------------------------------------
This SF.Net email is sponsored by: thawte's Crypto Challenge Vl
Crack the code and win a Sony DCRHC40 MiniDV Digital Handycam
Camcorder. More prizes in the weekly Lunch Hour Challenge.
Sign up NOW http://ad.doubleclick.net/clk;10740251;10262165;m
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/xen-devel