Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 10 Jan 2000 15:12:55 -0800 (PST)
From:      Bill Paul <wpaul@FreeBSD.org>
To:        cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   cvs commit: src/sys/modules/usb Makefile src/sys/dev/usb usb_ethersubr.c usb_ethersubr.h if_aue.c if_kue.c src/sys/net netisr.h src/sys/conf files
Message-ID:  <200001102312.PAA38819@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
wpaul       2000/01/10 15:12:55 PST

  Modified files:
    sys/modules/usb      Makefile 
    sys/dev/usb          if_aue.c if_kue.c 
    sys/net              netisr.h 
    sys/conf             files 
  Added files:
    sys/dev/usb          usb_ethersubr.c usb_ethersubr.h 
  Log:
  Attempt to fix a problem with receiving packets on USB ethernet interfaces.
  Packets are received inside USB bulk transfer callbacks, which run at
  splusb() (actually splbio()). The packet input queues are meant to be
  manipulated at splimp(). However the locking apparently breaks down under
  certain circumstances and the input queues can get trampled.
  
  There's a similar problem with if_ppp, which is driven by hardware/tty
  interrupts from the serial driver, but which must also manipulate the
  packet input queues at splimp(). The fix there is to use a netisr, and
  that's the fix I used here. (I can hear you groaning back there. Hush up.)
  
  The usb_ethersubr module maintains a single queue of its own. When a
  packet is received in the USB callback routine, it's placed on this
  queue with usb_ether_input(). This routine also schedules a soft net
  interrupt with schednetisr(). The ISR routine then runs later, at
  splnet, outside of the USB callback/interrupt context, and passes the
  packet to ether_input(), hopefully in a safe manner.
  
  The reason this is implemented as a separate module is that there are
  a limited number of NETISRs that we can use, and snarfing one up for
  each driver that needs it is wasteful (there will be three once I get
  the CATC driver done). It also reduces code duplication to a certain
  small extent. Unfortunately, it also needs to be linked in with the
  usb.ko module in order for the USB ethernet drivers to share it.
  
  Also removed some uneeded includes from if_aue.c and if_kue.c
  
  Fix suggested by: peter
  Not rejected as a hairbrained idea by: n_hibma
  
  Revision  Changes    Path
  1.5       +3 -2      src/sys/modules/usb/Makefile
  1.5       +9 -25     src/sys/dev/usb/if_aue.c
  1.9       +8 -23     src/sys/dev/usb/if_kue.c
  1.20      +2 -1      src/sys/net/netisr.h
  1.315     +2 -1      src/sys/conf/files



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




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