cleanup of interface shutdown/detach Was: cvs commit: src/sys/dev/an
glebius at FreeBSD.org
Wed Sep 21 12:03:14 PDT 2005
On Wed, Sep 21, 2005 at 02:55:57PM -0400, John Baldwin wrote:
J> > 4. Remove IFF_DRV_RUNNING check from ether_output().
J> I think you can leave #4 in if the race doesn't hurt anything.
This check confuses people, is incorrect and useless. It confuses
people, because they think that the !IFF_DRV_RUNNING condition is
checked. It is incorrect because upper layer must not touch/look
at if_drv_flags. It is useless because the flag is checked without
driver mutex being acquired, and thus does not protect from anything.
Yesterday I have fixed panic in em(4) that was "protected" by this
check. The correct way is to check the flag in interface start
method, with driver mutex held.
Totus tuus, Glebius.
More information about the cvs-src