Mark USB ethernet devices as IFF_NEEDSGIANT, since the USB framework

if_start routines cannot currently be entered without Giant.  When
the kernel is running with debug.mpsafenet != 0, this will defer
if_start execution to a task queue thread holding Giant, which may
introduce additional latency, but avoid incorrect execution.

Suggested by:	dfr
This commit is contained in:
Robert Watson 2004-08-11 03:38:55 +00:00
parent 38c9c1708b
commit 1510469e95
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=133466
6 changed files with 12 additions and 6 deletions

View File

@ -717,7 +717,8 @@ USB_ATTACH(aue)
ifp->if_softc = sc;
if_initname(ifp, "aue", sc->aue_unit);
ifp->if_mtu = ETHERMTU;
ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST |
IFF_NEEDSGIANT;
ifp->if_ioctl = aue_ioctl;
ifp->if_start = aue_start;
ifp->if_watchdog = aue_watchdog;

View File

@ -476,7 +476,8 @@ USB_ATTACH(axe)
ifp->if_softc = sc;
if_initname(ifp, "axe", sc->axe_unit);
ifp->if_mtu = ETHERMTU;
ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST |
IFF_NEEDSGIANT;
ifp->if_ioctl = axe_ioctl;
ifp->if_start = axe_start;
ifp->if_watchdog = axe_watchdog;

View File

@ -507,7 +507,8 @@ USB_ATTACH(cue)
ifp->if_softc = sc;
if_initname(ifp, "cue", sc->cue_unit);
ifp->if_mtu = ETHERMTU;
ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST |
IFF_NEEDSGIANT;
ifp->if_ioctl = cue_ioctl;
ifp->if_start = cue_start;
ifp->if_watchdog = cue_watchdog;

View File

@ -481,7 +481,8 @@ USB_ATTACH(kue)
ifp->if_softc = sc;
if_initname(ifp, "kue", sc->kue_unit);
ifp->if_mtu = ETHERMTU;
ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST |
IFF_NEEDSGIANT;
ifp->if_ioctl = kue_ioctl;
ifp->if_start = kue_start;
ifp->if_watchdog = kue_watchdog;

View File

@ -660,7 +660,8 @@ USB_ATTACH(rue)
ifp->if_softc = sc;
if_initname(ifp, "rue", sc->rue_unit);
ifp->if_mtu = ETHERMTU;
ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST |
IFF_NEEDSGIANT;
ifp->if_ioctl = rue_ioctl;
ifp->if_start = rue_start;
ifp->if_watchdog = rue_watchdog;

View File

@ -400,7 +400,8 @@ USB_ATTACH(udav)
#elif defined(__FreeBSD__)
if_initname(ifp, "udav", device_get_unit(self));
#endif
ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST |
IFF_NEEDSGIANT;
ifp->if_start = udav_start;
ifp->if_ioctl = udav_ioctl;
ifp->if_watchdog = udav_watchdog;