[Click] jiffies and e1000 polling.

Jason Park (Joonwoo Park) jason at geninetworks.com
Tue Jul 31 03:01:26 EDT 2007


Hi,

Recently, jiffies of the linux runs from -5 min.
So I think that polling patch needed to be fixed like this.

Index: e1000_main.c
===================================================================
--- e1000_main.c.orig
+++ e1000_main.c
@@ -5645,16 +5645,16 @@
    */
   if (got) {
     adapter->rx_state = E1000_RX_STATE_NORMAL;
-    adapter->rx_normal_jiffies = jiffies + HZ;
+    adapter->rx_normal_jiffies = jiffies - INITIAL_JIFFIES + HZ;
   } else {
     int rdfh;
     int rdft;
     switch (adapter->rx_state) {
     case E1000_RX_STATE_NORMAL:
-      if (jiffies < adapter->rx_normal_jiffies)
+      if (jiffies - INITIAL_JIFFIES < adapter->rx_normal_jiffies)
         break;
       adapter->rx_state = E1000_RX_STATE_QUIET;
-      adapter->rx_quiet_jiffies = jiffies + HZ;
+      adapter->rx_quiet_jiffies = jiffies - INITIAL_JIFFIES + HZ;
       adapter->prev_rdfh = E1000_READ_REG(&adapter->hw, RDH1);
       adapter->prev_rdft = E1000_READ_REG(&adapter->hw, RDT1);
       break;
@@ -5666,10 +5666,10 @@
           adapter->prev_rdfh == adapter->prev_rdft) {
         adapter->prev_rdfh = rdfh;
         adapter->prev_rdft = rdft;
-        adapter->rx_quiet_jiffies = jiffies + HZ;
+        adapter->rx_quiet_jiffies = jiffies - INITIAL_JIFFIES + HZ;
         break;
       }
-      if (jiffies < adapter->rx_quiet_jiffies)
+      if (jiffies - INITIAL_JIFFIES < adapter->rx_quiet_jiffies)
         break;
       /* Fall into the lockup case */
     case E1000_RX_STATE_LOCKUP:
@@ -5688,7 +5688,7 @@
                             E1000_DESC_UNUSED(adapter->rx_ring));
       /* reset the lockup detection */
       adapter->rx_state = E1000_RX_STATE_NORMAL;
-      adapter->rx_normal_jiffies = jiffies + HZ;
+      adapter->rx_normal_jiffies = jiffies - INITIAL_JIFFIES + HZ;
       break;
     }
   }

Jason Park (Joonwoo Park).



More information about the click mailing list