summaryrefslogtreecommitdiffstats
path: root/sys/netinet/udp_usrreq.c
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2008-07-02 23:23:27 +0000
committerrwatson <rwatson@FreeBSD.org>2008-07-02 23:23:27 +0000
commit0c50a62527ee21e24fb9e93a0ebf67df0043d601 (patch)
treef93fb0d7ca2098d63cd9cb5c25ccd3e6b4f9b4d6 /sys/netinet/udp_usrreq.c
parenta2caa98b9568eea606d112d9042d80125e5adbb4 (diff)
downloadFreeBSD-src-0c50a62527ee21e24fb9e93a0ebf67df0043d601.zip
FreeBSD-src-0c50a62527ee21e24fb9e93a0ebf67df0043d601.tar.gz
Add soreceive_dgram(9), an optimized socket receive function for use by
datagram-only protocols, such as UDP. This version removes use of sblock(), which is not required due to an inability to interlace data improperly with datagrams, as well as avoiding some of the larger loops and state management that don't apply on datagram sockets. This is experimental code, so hook it up only for UDPv4 for testing; if there are problems we may need to revise it or turn it off by default, but it offers *significant* performance improvements for threaded UDP applications such as BIND9, nsd, and memcached using UDP. Tested by: kris, ps
Diffstat (limited to 'sys/netinet/udp_usrreq.c')
-rw-r--r--sys/netinet/udp_usrreq.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c
index 99f40aa..4479a50 100644
--- a/sys/netinet/udp_usrreq.c
+++ b/sys/netinet/udp_usrreq.c
@@ -1164,6 +1164,7 @@ struct pr_usrreqs udp_usrreqs = {
.pru_disconnect = udp_disconnect,
.pru_peeraddr = in_getpeeraddr,
.pru_send = udp_send,
+ .pru_soreceive = soreceive_dgram,
.pru_sosend = sosend_dgram,
.pru_shutdown = udp_shutdown,
.pru_sockaddr = in_getsockaddr,
OpenPOWER on IntegriCloud