USB network device drivers now usable with debug.mpsafenet=1 (was:cvs commit: src/sys/dev/usb if_aue.c if_axe.c if_cue.c if_kue.c if_rue.c if_udav.c (fwd))

Robert Watson rwatson at
Tue Aug 10 21:29:00 PDT 2004

FYI, with this change it should be substantially safer to run a Giant-free
network stack with USB network devices, despite the USB device framework
not being MPSAFE.  I have similar patches for a number of non-locked
network device drivers, including Firewire networking and older ethernet
devices, and will merge those in the next few days.

This may result in a performance hit for these devices, which may or may
not be made up for by removing the Giant lock from the network stack. 
However, it gives us some room to keep these devices operational in a
Giant-free world to allow more time for the device drivers to be made

For those interested in the continuing evolution of the netperf work, a
change log can be found at:

I'll send out an updated version of my notice on using the network stack
without the Giant lock in a couple of days once I've wrapped up my current
batch of merging.

Robert N M Watson             FreeBSD Core Team, TrustedBSD Projects
robert at      Principal Research Scientist, McAfee Research

---------- Forwarded message ----------
Date: Wed, 11 Aug 2004 03:38:55 +0000 (UTC)
From: Robert Watson <rwatson at>
To: src-committers at, cvs-src at, cvs-all at
Subject: cvs commit: src/sys/dev/usb if_aue.c if_axe.c if_cue.c if_kue.c         if_rue.c if_udav.c

rwatson     2004-08-11 03:38:55 UTC

  FreeBSD src repository

  Modified files:
    sys/dev/usb          if_aue.c if_axe.c if_cue.c if_kue.c 
                         if_rue.c if_udav.c 
  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
  Revision  Changes    Path
  1.86      +2 -1      src/sys/dev/usb/if_aue.c
  1.21      +2 -1      src/sys/dev/usb/if_axe.c
  1.52      +2 -1      src/sys/dev/usb/if_cue.c
  1.58      +2 -1      src/sys/dev/usb/if_kue.c
  1.16      +2 -1      src/sys/dev/usb/if_rue.c
  1.8       +2 -1      src/sys/dev/usb/if_udav.c

More information about the freebsd-current mailing list