[ovs-dev] [mii 1/2] netdev: Take responsibility for polling MII registers.
blp at nicira.com
Fri May 20 19:17:36 UTC 2011
On Fri, May 20, 2011 at 11:41:24AM -0700, Ethan Jackson wrote:
> > I would consider a different implementation technique for actually
> > reading the miimon. ?Instead of doing it proactively from
> > netdev_linux_run(), do it lazily from netdev_linux_get_carrier(): if
> > the timer has expired, read the miimon status, otherwise return the
> > cached status. ?Then call timer_wait() to wake up for the next poll.
> I thought about this. The only problem I can think of with this
> strategy is the netdev_monitor. I need to be alerted when the MII
> registers change to wake up the relevant monitors. I can't figure out
> how to do that using a lazy strategy, (though I may be wrong).
You've got a point. OK, let's leave this as-is.
> I agree that it's kind of ugly to iterate over all the netdevs simply
> for MII register status. One thing I could considering doing is
> maintaining a list of netdevs with MII enabled and simply iterate over
> those if you think it's worth it.
It's probably not worth optimizing. Let's not worry about it yet.
More information about the dev