Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 21 Sep 2005 22:23:38 +0300
From:      Ruslan Ermilov <ru@FreeBSD.org>
To:        John Baldwin <jhb@FreeBSD.org>
Cc:        cvs-src@FreeBSD.org, src-committers@FreeBSD.org, Robert Watson <rwatson@FreeBSD.org>, cvs-all@FreeBSD.org, "M. Warner Losh" <imp@bsdimp.com>
Subject:   Re: cvs commit: src/sys/dev/an if_an.c src/sys/dev/arl if_arl_isa.c src/sys/dev/awi if_awi_pccard.c src/sys/dev/cm if_cm_isa.c src/sys/dev/cnw if_cnw.c src/sys/dev/cp if_cp.c src/sys/dev/cs if_cs.c src/sys/dev/ed if_ed.c src/sys/dev/em if_em.c ...
Message-ID:  <20050921192338.GB24516@ip.net.ua>
In-Reply-To: <200509211455.59154.jhb@FreeBSD.org>
References:  <200509190310.j8J3ALgt095979@repoman.freebsd.org> <20050920223315.V34322@fledge.watson.org> <20050921154153.GB22964@ip.net.ua> <200509211455.59154.jhb@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--MW5yreqqjyrRcusr
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Wed, Sep 21, 2005 at 02:55:57PM -0400, John Baldwin wrote:
[...]
> > 3.  Fix all drivers to check IFF_DRV_RUNNING in foo_start() and exit
> >     if it's unset.  This should fix another half of shutdown panics,
> >     e.g. the one demonstrated by glebius@ in recent if_em.c commit.
> >
> > 4.  Remove IFF_DRV_RUNNING check from ether_output().
> >
> > 5.  Fix all drivers to set some flag in foo_detach() and foo_shutdown()
> >     and refuse to work in foo_ioctl() if it's set.  This should fix
> >     panics when BPF listener is attached while interface goes away or
> >     module is unloaded.
> >
> > Relevant PRs: kern/85005, kern/62889.
> >
> > Attached is a demo patch for rl(4) that does all of the above
> > except #4.
>=20
> I think you can leave #4 in if the race doesn't hurt anything.  3) alread=
y=20
> handles the condition you are worried about.  I'd rather 5) be simpler in=
=20
> that it only check in the flags case to not force the driver lock to be=
=20
> acquired for all the ioctls that the driver doesn't actually handle. =20
> Actually, I think I'd really prefer that we think about how to fix the BP=
F=20
> issue in BPF itself if possible.  It may be that we don't need to set the=
=20
> flags (i.e. skip the actual ioctl) if the interface is in the process of=
=20
> detaching and we can make that change centrally without having to scatter=
=20
> gone flags in all the drivers.
>=20
BPF is just one (known) problem, but we'd like to fix it once and for
all, "ifconfig during detach" Warner mentioned is just another one.
I'd very much like some generic solution that doesn't involve adding
this check to every foo_ioctl(), but I have no idea at the moment.


Cheers,
--=20
Ruslan Ermilov
ru@FreeBSD.org
FreeBSD committer

--MW5yreqqjyrRcusr
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (FreeBSD)

iD8DBQFDMbM6qRfpzJluFF4RAnoXAJ9WgHEJUT2FKfREcy1Cgo3Qx7JQzwCfe26s
8RfkLXow/GfLIA5gNBtexHY=
=mmEk
-----END PGP SIGNATURE-----

--MW5yreqqjyrRcusr--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050921192338.GB24516>