From 857e4745c6998c63fa433cf7e0d0e7da6d0d18a7 Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Fri, 14 Sep 2012 01:47:19 -0700 Subject: [PATCH] kernel - Fix unix domain socket portfn routing * sonewconn_faddr() / sonewconn() was improperly overriding the sync_port setting for unix domain sockets, causing unnecessary netmsg traffic to the netisr threads. * This should significantly improve unix domain socket performance. With-help-from: sephe --- sys/kern/uipc_socket2.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/kern/uipc_socket2.c b/sys/kern/uipc_socket2.c index 75e6245551..8b2707042c 100644 --- a/sys/kern/uipc_socket2.c +++ b/sys/kern/uipc_socket2.c @@ -347,7 +347,10 @@ sonewconn_faddr(struct socket *head, int connstatus, * which occur to our cpu allowing us to complete the attachment * without racing anything. */ - sosetport(so, netisr_portfn(mycpu->gd_cpuid)); + if (head->so_proto->pr_flags & PR_SYNC_PORT) + sosetport(so, &netisr_sync_port); + else + sosetport(so, netisr_portfn(mycpu->gd_cpuid)); if ((head->so_options & SO_ACCEPTFILTER) != 0) connstatus = 0; so->so_head = head; -- 2.41.0