netdev
[Top] [All Lists]

Re: PATCH 2.4.0.9.2: export ethtool interface

To: Andrew Morton <andrewm@xxxxxxxxxx>
Subject: Re: PATCH 2.4.0.9.2: export ethtool interface
From: Donald Becker <becker@xxxxxxxxx>
Date: Wed, 20 Sep 2000 12:05:50 -0400 (EDT)
Cc: "howling@xxxxxxxx" <havanna_moon@xxxxxxx>, netdev@xxxxxxxxxxx
In-reply-to: <39C883CF.9FB262FC@xxxxxxxxxx>
Sender: owner-netdev@xxxxxxxxxxx
On Wed, 20 Sep 2000, Andrew Morton wrote:

> "howling@xxxxxxxx" wrote:
> > 
> > Routers have a tendency not to announce routes for networks
> > that are physically down, i miss that in linux. Mr. Becker
> > suggested using libmii was a no-no-never solution (up to a few
> > ms lockup of the machine per poll) for this issue. Select as
> > you suggest seems ideal.
> 
> mm.. I've clocked an mdio_read() at 300 usecs.

Yup, reading a bunch of MII registers isn't something we want to do without
a good reason.  Some have suggested /proc/bus/mii/eth0, where all 32 MII
registers could be read at once.  This has semantic problems with the
"sticky bits", and it could take 300*32 usec.  Try reading that once per
timer tick ;->

It's much more reasonable to have the driver do this on a 1/3/5/10 second
periodic check (a low-rate poll).

[[ Note: The typical case shouldn't take 300 usec, but on a busy PCI bus
without MII preamble supression, it might take even longer to read a
register. ]]

>   Not a thing you'd want
> to poll very frequently, particularly as some drivers are racy in this
> area, and the consequences of hitting the race could be quite bad.  
> spin_lock_bh() is the correct solution for mdio protection, BTW.

Or having the timer based media monitor just skip the check until the next
tick if the lock is set.  Imagine taking timer interrupt during the
user-level ioctl()...  (There are a few other dangerous cases to consider as
well.) 



Donald Becker                           becker@xxxxxxxxx
Scyld Computing Corporation             http://www.scyld.com
410 Severn Ave. Suite 210               Beowulf-II Cluster Distribution
Annapolis MD 21403


<Prev in Thread] Current Thread [Next in Thread>