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

[Xen-devel] [patch] netback: Xennet half die---netback driver didn't detect the jiffies wrapping correctly.



Netback driver use " time_after_eq()" to check the jiffies wrapping, while this 
function was only called when the credit is  running out.
So, if the jiffies wrapped and the credit isn't run out in first half jiffies 
circle, the time_after_eq() cannot check the wrapping any more.

This will cause the credit_timerout.expires is set to dozens of days in future. 
The netback will stop receiving data from netfront. 

For example: 
Jiffies initialized to 0xffffff-(300*HZ), and the credit_timeout.expires was 
initialized to 0xffffff00, 
After dozens of days,  when the jiffies grow to upper than 0x80000000, and the 
time_after_eq() will cannot check for the wrapping.



--- drivers/xen/netback/netback.c.org   2012-11-30 15:48:13.109039998 -0500
+++ drivers/xen/netback/netback.c       2012-11-30 15:48:55.212072898 -0500
@@ -1272,6 +1272,10 @@ static void net_tx_action(unsigned long
                rmb(); /* Ensure that we see the request before we copy it. */
                memcpy(&txreq, RING_GET_REQUEST(&netif->tx, i), sizeof(txreq));
 
+        /* Check for the jiffies wrapping */
+        if (time_after_eq(jiffies, netif->credit_timeout.expires))
+            netif->credit_timeout.expires = jiffies;
+
                /* Credit-based scheduling. */
                if (txreq.size > netif->remaining_credit) {
                        unsigned long now = jiffies;





 Protected by Websense Hosted Email Security -- www.websense.com 

Attachment: xen-netback-jiffies-wrapping.patch
Description: xen-netback-jiffies-wrapping.patch

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

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