icmp: Asynchonize ctlinput/mtudisc/redirect processing

Operating Systems / DragonFlyBSD - Sepherosa Ziehau [dragonflybsd.org] - 17 December 2014 07:34 UTC

Supportive facilities added:- Embed netmsg_ctlinput into mbuf (used by input ICMP datagram) so that we don't need to do additional memory allocation to forward the pr_ctlinput to all netisrs for certain types of ICMP datagrams.
- Add/Expose so_pr_ctlport().- Return target netisr's cpuid from pr_ctlport. If the returned cpuid equals to ncpus, it means that pr_ctlinput needs to be run in all netisrs.- Support 'direct' mode for TCP/UDP's pr_ctlinput. The caller of the 'direct' mode pr_ctlinput will do the message forwarding.

ICMP pr_ctlinput/mtudisc/redirect processing changes:- For mtudisc and redirect we unconditionally forward the message embedded in input ICMP datagram to all netisrs, and call pr_ctlinput in 'direct' mode.- For pr_ctlinput, we first call so_pr_ctlport() to see whether we need to forward the message embedded in input ICMP datagram to all netisrs, and act accordingly.- Once pr_ctlinput/mtudisc/redirect processing is done, the message embedded in the input ICMP datagram is forwarded back to the netisr0 to run rip_input().

After this commit, netisr0 will not be blocked for ICMP pr_ctlinput/ mtudisc/redirect processing. This also fixes the mtudisc (originally only cpu0's routes get mtu updates).

130b790 icmp: Asynchonize ctlinput/mtudisc/redirect processing
sys/kern/uipc_domain.c | 12 ++
sys/kern/uipc_msg.c | 45 ++++-
sys/net/netisr.c | 5 +-
sys/net/netmsg.h | 10 +
sys/net/route.c | 2 +-
sys/net/route.h | 2 +
sys/netinet/ip_demux.c | 23 ++-
sys/netinet/ip_icmp.c | 465 +++++++++++++++++++++++++++++++++++++++-------
sys/netinet/tcp_subr.c | 14 +-
sys/netinet/tcp_var.h | 2 +-
sys/netinet/udp_usrreq.c | 15 +-
sys/netinet/udp_var.h | 2 +-
sys/sys/mbuf.h | 4 +-
sys/sys/protosw.h | 5 +-
sys/sys/socketops.h | 6 +
15 files changed, 520 insertions(+), 92 deletions(-)

Upstream: gitweb.dragonflybsd.org


  • Share