git: icmp: Asynchonize ctlinput/mtudisc/redirect processing
Sepherosa Ziehau
sephe at crater.dragonflybsd.org
Wed Dec 17 05:34:27 PST 2014
commit 130b7902de98ca52e39d03d35a30d759df0cc2fc
Author: Sepherosa Ziehau <sephe at dragonflybsd.org>
Date: Mon Nov 24 09:59:41 2014 +0800
icmp: Asynchonize ctlinput/mtudisc/redirect processing
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).
Summary of changes:
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(-)
http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/130b7902de98ca52e39d03d35a30d759df0cc2fc
--
DragonFly BSD source repository
More information about the Commits
mailing list