diff options
author | rwatson <rwatson@FreeBSD.org> | 2004-06-09 02:48:23 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2004-06-09 02:48:23 +0000 |
commit | e550332ee64f8101ad3324149dac6ba7717eb210 (patch) | |
tree | 89b4859f2d05637853b2ad2d21a9b8c70a78e145 /sys/net/netisr.h | |
parent | 2356da608a2b3173383651926a19d6b7efca2121 (diff) | |
download | FreeBSD-src-e550332ee64f8101ad3324149dac6ba7717eb210.zip FreeBSD-src-e550332ee64f8101ad3324149dac6ba7717eb210.tar.gz |
Introduce a netisr to deliver kernel-generated routing, avoiding
recursive entering of the socket code from the routing code:
- Modify rt_dispatch() to bundle up the sockaddr family, if any,
associated with a pending mbuf to dispatch to routing sockets, in
an m_tag on the mbuf.
- Allocate NETISR_ROUTE for use by routing sockets.
- Introduce rtsintrq, an ifqueue to be used by the netisr, and
introduce rts_input(), a function to unbundle the tagged sockaddr
and inject the mbuf and address into raw_input(), which previously
occurred in rt_dispatch().
- Introduce rts_init() to initialize rtsintrq, its mutex, and
register the netisr. Perform this at the same point in system
initialization as setup of the domains.
This change introduces asynchrony between the generation of a
pending routing socket message and delivery to sockets for use
by userspace. It avoids socket->routing->rtsock->socket use and
helps to avoid lock order reversals between the routing code and
socket code (in particular, raw socket control blocks), as route
locks are held over calls to rt_dispatch().
Reviewed by: "George V.Neville-Neil" <gnn@neville-neil.com>
Conceptual head nod by: sam
Diffstat (limited to 'sys/net/netisr.h')
-rw-r--r-- | sys/net/netisr.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/net/netisr.h b/sys/net/netisr.h index 177354f..1b11fca 100644 --- a/sys/net/netisr.h +++ b/sys/net/netisr.h @@ -50,6 +50,7 @@ */ #define NETISR_POLL 0 /* polling callback, must be first */ #define NETISR_IP 2 /* same as AF_INET */ +#define NETISR_ROUTE 14 /* routing socket */ #define NETISR_AARP 15 /* Appletalk ARP */ #define NETISR_ATALK2 16 /* Appletalk phase 2 */ #define NETISR_ATALK1 17 /* Appletalk phase 1 */ |