pru_send: Allow non-NULL address parameter to be passed
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Sun, 4 Dec 2011 13:21:51 +0000 (21:21 +0800)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Sun, 4 Dec 2011 13:21:51 +0000 (21:21 +0800)
commit7b7dc575a8224f533cec23b942a0aef41b88835c
tree712b3a4f54294ae7cf63c4492a3725d0b91e1c00
parent6ce03112e52be1800f0f88b20a00ca5cef474322
pru_send: Allow non-NULL address parameter to be passed

Currently the passed in address is copied into a newly allocated
memory (grr, additional blocking kmalloc), and the PRUS_FREEADDR
will be set so that protocol thread could know when to free the
address.

Before this change netperf UDP_STREAM (unconnected socket) could
only do ~200Kpps (w/ -m 18), now it could do ~990Kpps (w/ -m 18).
This gives ~500% performance improvement for tiny UDP packet TX.
The improvement is not as good as the connected socket, which is
~600%, mainly because of the additional memory allocation for
the address.  We _may_ further optimize out the address allocation.
sys/kern/uipc_msg.c
sys/kern/uipc_socket.c
sys/net/netmsg.h
sys/netinet/tcp_usrreq.c
sys/netinet/udp_usrreq.c