#
219503cf |
| 22-Nov-2016 |
Sepherosa Ziehau <sephe@dragonflybsd.org> |
udp: Don't propagate connect error, as long as the inpcb has local port.
This fixes the UDP socket disconnect->[read/write] support; before this fix, the immediate read/write after disconnect will g
udp: Don't propagate connect error, as long as the inpcb has local port.
This fixes the UDP socket disconnect->[read/write] support; before this fix, the immediate read/write after disconnect will get EAFNOTSUPPORT.
show more ...
|
Revision tags: v4.6.1, v4.6.0, v4.6.0rc2, v4.6.0rc, v4.7.0, v4.4.3, v4.4.2 |
|
#
0723a285 |
| 07-Dec-2015 |
Sepherosa Ziehau <sephe@dragonflybsd.org> |
inpcb: Split portinfo token into tokens for porthash head
And use pooled token for porthash head. This avoids another 10K/s ~20K/s contention during local port selection.
|
Revision tags: v4.4.1, v4.4.0, v4.5.0, v4.4.0rc |
|
#
1b40a5cf |
| 17-Nov-2015 |
Sepherosa Ziehau <sephe@dragonflybsd.org> |
udp: Wakeup callers sleeping on failed to connect socket.
|
#
296c350d |
| 15-Nov-2015 |
Sepherosa Ziehau <sephe@dragonflybsd.org> |
udp: Fix bind races due to async close and random socket inital msgport
Bind for UDP sockets is now serialized by local port based netisr. And on detach path, the UDP inpcb is removed from local po
udp: Fix bind races due to async close and random socket inital msgport
Bind for UDP sockets is now serialized by local port based netisr. And on detach path, the UDP inpcb is removed from local port hash before other netisrs are synchronized, so that the local port for the detaching UDP inpcb could be recycled timely.
show more ...
|
#
5aaa7016 |
| 23-Oct-2015 |
Sepherosa Ziehau <sephe@dragonflybsd.org> |
udp: Implement asynchronized pru_connect.
This is mainly used to improve UDP connect(2) performance. Most of the DNS resolvers (getaddrinfo(3) and curl's DNS resolver, etc) and RTP application will
udp: Implement asynchronized pru_connect.
This is mainly used to improve UDP connect(2) performance. Most of the DNS resolvers (getaddrinfo(3) and curl's DNS resolver, etc) and RTP application will see improvement.
Before this commit the user space thread uses connect(2) will have to wait for the netisr to complete all preceeding messages. This could be performance hit for connect(2): the user space thread is suspended, even if the UDP connect(2) should always be nonblocking.
The only drawback is that bunch of datagrams sent immediately after connect(2) may not appear on the network in the sending order, but UDP applications should always be able to handle out-of-order data- grams.
UDP's asynchronous pru_connect implementation will set ISCONNECTED before dispatching connect message to netisr. The errors like EADDRNOTAVAIL, i.e. out of local port space, will be notified through later send(2)/recv(2), or getsockopt(2) SOL_SOCKET/SO_ERROR.
The measured effect of this change on 2-ways E5-2600v2 with Intel 82599 (10Gbe) using tools/kq_connect_client -u, i.e. UDP socket/ connect/send /close before initiating a TCP connection: - Connect rate increases by ~45Kconns/s; we are now doing 300Kconns/s. - IPIs rate to the CPUs not running netisrs reduces (23Kipis/s -> 16Kipis/s).
show more ...
|
#
9ca1e337 |
| 23-Oct-2015 |
Sepherosa Ziehau <sephe@dragonflybsd.org> |
udp: Save original protocol processing port for later synchronizing.
Unlike TCP, user could send data w/ address to a UDP socket that connect(2) is being called (those data messages will be on the o
udp: Save original protocol processing port for later synchronizing.
Unlike TCP, user could send data w/ address to a UDP socket that connect(2) is being called (those data messages will be on the original protocol processing port and forwarded to the new protocol processing port later), and then close the UDP socket (the detach message could be sent to the new protocol processing port before the inflight data messages). The inflight data messages will cause later panic, since the socket/inp has been destroyed by the detach message. I will have to say this probably will never happen for any real world applications.
We fix this by recording the original message port, and synchronize inflight data messages on it upon detaching. If the connect(2) moves between protocol processing ports more than once, we will go though all UDP processing netisrs to synchronize all possible inflight data messages.
show more ...
|
#
8756ce91 |
| 29-Oct-2015 |
Sepherosa Ziehau <sephe@dragonflybsd.org> |
udp/usrreq: Add brackets properly
The brackets were left out pretty accidentally, but the code also worked pretty accidentally:
int error = 0;
if (ai != NULL) error = udp_preattach(...);
if (
udp/usrreq: Add brackets properly
The brackets were left out pretty accidentally, but the code also worked pretty accidentally:
int error = 0;
if (ai != NULL) error = udp_preattach(...);
if (error) goto out else { /* mismatched comment */ }
Reported-by: s4 on DragonFlyDigest
show more ...
|
#
2e3ddc46 |
| 22-Oct-2015 |
Sepherosa Ziehau <sephe@dragonflybsd.org> |
udp/usrreq: Implement asynchronized pru_attach for UDP
The idea is same as c892825ffb53edaa4e5d7270b9254de80099dc53
The measured effect of this change on 2-ways E5-2600v2 with Intel 82599 (10Gbe) u
udp/usrreq: Implement asynchronized pru_attach for UDP
The idea is same as c892825ffb53edaa4e5d7270b9254de80099dc53
The measured effect of this change on 2-ways E5-2600v2 with Intel 82599 (10Gbe) using tools/kq_connect_client -u, i.e. UDP socket/connect/send /close before initiating a TCP connection: - Connect rate increases by ~15Kconns/s; we are now doing 260Kconns/s. - IPIs rate to the CPUs not running netisrs reduces (36Kipis/s -> 23Kipis/s).
show more ...
|
#
933cb27e |
| 21-Oct-2015 |
Sepherosa Ziehau <sephe@dragonflybsd.org> |
udp/usrreq: Add missing return
|
#
d6ed1969 |
| 21-Oct-2015 |
Sepherosa Ziehau <sephe@dragonflybsd.org> |
udp/usrreq: Fix up cleanup so_pcb checks
- pru_attach must not be called twice, so so_pcb must be NULL. - Check so_pcb in udp_ctloutput; this prepares asynchronized udp pru_attach.
|
Revision tags: v4.2.4 |
|
#
471bee20 |
| 31-Jul-2015 |
Sepherosa Ziehau <sephe@dragonflybsd.org> |
net: Factor out ASSERT_IN_NETISR and ASSERT_IS_NETISR
|
Revision tags: v4.3.1, v4.2.3, v4.2.1, v4.2.0, v4.0.6, v4.3.0, v4.2.0rc, v4.0.5, v4.0.4 |
|
#
b5ed98c8 |
| 25-Feb-2015 |
Sepherosa Ziehau <sephe@dragonflybsd.org> |
udp: Disable direct detach only if multicast options are to be set.
|
#
f8c58116 |
| 25-Feb-2015 |
Sepherosa Ziehau <sephe@dragonflybsd.org> |
udp: Disable direct detach, if multicast options are set.
Add additional comment about disabling direct detach when setting multicast options.
Submitted-by: Romick DragonFly-bug: http://bugs.dragon
udp: Disable direct detach, if multicast options are set.
Add additional comment about disabling direct detach when setting multicast options.
Submitted-by: Romick DragonFly-bug: http://bugs.dragonflybsd.org/issues/2792
show more ...
|
#
b5523eac |
| 19-Feb-2015 |
Sascha Wildner <saw@online.de> |
kernel: Move us to using M_NOWAIT and M_WAITOK for mbuf functions.
The main reason is that our having to use the MB_WAIT and MB_DONTWAIT flags was a recurring issue when porting drivers from FreeBSD
kernel: Move us to using M_NOWAIT and M_WAITOK for mbuf functions.
The main reason is that our having to use the MB_WAIT and MB_DONTWAIT flags was a recurring issue when porting drivers from FreeBSD because it tended to get forgotten and the code would compile anyway with the wrong constants. And since MB_WAIT and MB_DONTWAIT ended up as ocflags for an objcache_get() or objcache_reclaimlist call (which use M_WAITOK and M_NOWAIT), it was just one big converting back and forth with some sanitization in between.
This commit allows M_* again for the mbuf functions and keeps the sanitizing as it was before: when M_WAITOK is among the passed flags, objcache functions will be called with M_WAITOK and when it is absent, they will be called with M_NOWAIT. All other flags are scrubbed by the MB_OCFLAG() macro which does the same as the former MBTOM().
Approved-by: dillon
show more ...
|
Revision tags: v4.0.3, v4.0.2 |
|
#
727ccde8 |
| 18-Dec-2014 |
Sepherosa Ziehau <sephe@dragonflybsd.org> |
inet/inet6: Remove the v4-mapped address support
This greatly simplies the code (even the IPv4 code) and avoids all kinds of possible port theft.
INPCB: - Nuke IN6P_IPV6_V6ONLY, which is always on
inet/inet6: Remove the v4-mapped address support
This greatly simplies the code (even the IPv4 code) and avoids all kinds of possible port theft.
INPCB: - Nuke IN6P_IPV6_V6ONLY, which is always on after this commit. - Change inp_vflag into inp_af (AF_INET or AF_INET6), since the socket is either IPv6 or IPv4, but never both. Set inpcb.inp_af in in_pcballoc() instead of in every pru_attach methods. Add INP_ISIPV4() and INP_ISIPV6() macros to check inpcb family (socket family and inpcb.inp_af are same). - Nuke the convoluted code in in_pcbbind() and in6_pcbbind() which is used to allow wildcard binding to accepting IPv4 connections on IPv6 wildcard bound sockets. - Nuke the code in in_pcblookup_pkthash() to match IPv4 faddr with IPv6 wildcard bound socket. - Nuke in6_mapped_{peeraddr,sockaddr,savefaddr}(); use in6_{setpeeraddr, setsockaddr,savefaddr}() directly. - Nuke v4-mapped address convertion functions. - Don't allow binding to v4-mapped address in in6_pcbind(). - Don't allow connecting to v4-mapped address in in6_pcbconnect().
TCP: - Nuke the code in tcp_output() which takes care of the IP header TTL setting for v4-mapped IPv6 socket. - Don't allow binding to v4-mapped address (through in6_pcbbind()). - Don't allow connecting to v4-mapped address and nuke the related code (PRUC_NAMALLOC etc.). - Nuke the code (PRUC_FALLBACK etc.) to fallback to IPv4 connection if IPv6 connection fails, which is wrong. - Nuke the code for v4-mapped IPv6 socket in tcp6_soport().
UDP: - Nuke the code for v4-mapped IPv6 socket in udp_input() and udp_append(). - Don't allow binding to v4-mapped address (through in6_pcbbind()). - Don't allow connecting to v4-mapped address. - Don't allow sending datagrams to v4-mapped address and nuke the related code in udp6_output(). - Nuke the code for v4-mapped IPv6 socket in udp6_disconnect()
RIP: - Don't allow sending packets to v4-mapped address. - Don't allow binding to v4-mapped address. - Don't allow connecting to v4-mapped address.
Misc fixup: - Don't force rip pru_attach method to return 0. If in_pcballoc() fails, just return the error code.
show more ...
|
Revision tags: v4.0.1 |
|
#
130b7902 |
| 24-Nov-2014 |
Sepherosa Ziehau <sephe@dragonflybsd.org> |
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 al
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).
show more ...
|
#
6cabdef3 |
| 23-Nov-2014 |
Sepherosa Ziehau <sephe@dragonflybsd.org> |
udp: Fix parameter order of udp_addrcpu()
|
#
dfa15443 |
| 23-Nov-2014 |
Sepherosa Ziehau <sephe@dragonflybsd.org> |
udp: Unify ctlinput and ctlport cmd/faddr/icmp_ip processing
|
#
7195d381 |
| 23-Nov-2014 |
Sepherosa Ziehau <sephe@dragonflybsd.org> |
inpcb: Define inp_notify_t
|
#
df6e7fc0 |
| 18-Nov-2014 |
Sepherosa Ziehau <sephe@dragonflybsd.org> |
udp: Minor udp_ctlinput cleanup
|
Revision tags: v4.0.0, v4.0.0rc3, v4.0.0rc2, v4.0.0rc, v4.1.0 |
|
#
12cb5d89 |
| 13-Oct-2014 |
Markus Pfeiffer <markus.pfeiffer@morphism.de> |
netinet: Remove check for jailed process
This check caused jailed processes to not be able to do name lookups via libc anymore, since a connect() on a udp socket failed.
Reviewed-by: Sepherosa Zieh
netinet: Remove check for jailed process
This check caused jailed processes to not be able to do name lookups via libc anymore, since a connect() on a udp socket failed.
Reviewed-by: Sepherosa Ziehau <sepherosa@gmail.com>
show more ...
|
#
fc330c07 |
| 03-Oct-2014 |
Sepherosa Ziehau <sephe@dragonflybsd.org> |
udp: Add assertion for preconditions for direct detach
|
#
37c11aff |
| 03-Oct-2014 |
Sepherosa Ziehau <sephe@dragonflybsd.org> |
udp: Add NOTINHASH assertion to udp_inswildcardhash()
So that we could catch programming bugs earlier.
|
#
08caceca |
| 03-Oct-2014 |
Sepherosa Ziehau <sephe@dragonflybsd.org> |
udp: Use ncpus2 instead of ncpus, since udp uses ncpus2 netisrs
There is actually no functional change.
|
#
cbc3e519 |
| 03-Oct-2014 |
Sepherosa Ziehau <sephe@dragonflybsd.org> |
inpcb: Factor out in_pcbresetroute()
|