kernel - Fix unix domain socket portfn routing
authorMatthew Dillon <dillon@apollo.backplane.com>
Fri, 14 Sep 2012 08:47:19 +0000 (01:47 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Fri, 14 Sep 2012 08:47:19 +0000 (01:47 -0700)
* 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

index 75e6245..8b27070 100644 (file)
@@ -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;