summaryrefslogtreecommitdiffstats
path: root/sys/net/netisr.h
diff options
context:
space:
mode:
authorwpaul <wpaul@FreeBSD.org>2000-01-10 23:12:54 +0000
committerwpaul <wpaul@FreeBSD.org>2000-01-10 23:12:54 +0000
commitcf16a7efdbcb91d113076438baa91ee5e3eb9f0f (patch)
treedcd5228d2a569c3fab5287bd12de2d2971210693 /sys/net/netisr.h
parent6ee166cb62b0355ec455077af6de4c02e59540a4 (diff)
downloadFreeBSD-src-cf16a7efdbcb91d113076438baa91ee5e3eb9f0f.zip
FreeBSD-src-cf16a7efdbcb91d113076438baa91ee5e3eb9f0f.tar.gz
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
Diffstat (limited to 'sys/net/netisr.h')
-rw-r--r--sys/net/netisr.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/net/netisr.h b/sys/net/netisr.h
index b1e32f3..563c4ec 100644
--- a/sys/net/netisr.h
+++ b/sys/net/netisr.h
@@ -64,6 +64,7 @@
#define NETISR_ATALK 16 /* same as AF_APPLETALK */
#define NETISR_ARP 18 /* same as AF_LINK */
#define NETISR_IPX 23 /* same as AF_IPX */
+#define NETISR_USB 25 /* USB soft interrupt */
#define NETISR_ISDN 26 /* same as AF_E164 */
#define NETISR_PPP 27 /* PPP soft interrupt */
#define NETISR_IPV6 28 /* same as AF_INET6 */
OpenPOWER on IntegriCloud