Hi Jason, Thanks for this problem report and patch! I think the right fix, though, is to change the adapter variables to "unsigned long" (the type of jiffies itself), and use Linux's time_before macro. This is checked in to git.
Eddie Jason Park (Joonwoo Park) wrote: > 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). > > _______________________________________________ > click mailing list > click@amsterdam.lcs.mit.edu > https://amsterdam.lcs.mit.edu/mailman/listinfo/click _______________________________________________ click mailing list click@amsterdam.lcs.mit.edu https://amsterdam.lcs.mit.edu/mailman/listinfo/click