Age | Commit message (Collapse) | Author |
|
|
|
gets only allocated when needed. This way struct socket shrinks
from 472 to 392 bytes on amd64. When splicing gets active, another
88 bytes are allocated for struct sosplice.
OK dlg@
|
|
confirmation: it was only used for netiso, which was deleted a *decade* ago
ok mpi@ claudio@ ports scan by sthen@
|
|
ok miod@ mpi@
|
|
when creating them: pipe2(), dup3(), accept4(), MSG_CMSG_CLOEXEC,
SOCK_CLOEXEC. Includes SOCK_NONBLOCK support.
ok matthew@
|
|
|
|
|
|
correctly aligned. Similar in spirit to 1.119.
|
|
localhost connections.
The plan is to always use the routing table for addresses and routes
resolutions, so there is no future for an option that wants to bypass
it. This option has never been implemented for IPv6 anyway, so let's
just remove the IPv4 bits that you weren't aware of.
Tested a least by lteo@, guenther@ and chrisz@, ok mikeb@, benno@
|
|
struct ucred; struct process then directly links to the ucred
Based on a discussion at c2k10 or so before noting that FreeBSD and
NetBSD did this too.
ok matthew@
|
|
for localhost connections. discussed with deraadt@
|
|
use the routing table there's no future for an option that wants to
bypass it. This option has never been implemented for IPv6 anyway,
so let's just remove the IPv4 bits that you weren't aware of.
Tested by florian@, man pages inputs from jmc@, ok benno@
|
|
not in the original thread.
ok matthew@
|
|
ok mikeb@ deraadt@
|
|
to splice multiple UDP packets in the m_nextpkt list. Some profiling
with TCP splicing showed that checking so_rcv.sb_mb is wrong. It
causes several useless runs through the loop. Better check for
nextrecord which contains the original m_nextpkt value of the mbuf.
OK mikeb@
|
|
|
|
miod ran into.
ok miod matthew
|
|
|
|
This would create a weird set of states in TCP. FreeBSD has the
same check.
Issue found by and OK guenther@
|
|
all in one place. Saves one additional #ifdef, no functional change.
OK mikeb@
|
|
unsplice() the sockets before soidle() goes to splsoftnet. In this
case, unsplice() was called twice. So check wether splicing still
exists within the splsoftnet protection.
Uvm fault in sounsplice() reported by keith at scott-land dot net.
OK claudio@
|
|
spliced and routed to loopback. The content of the pf header in
the mbuf was keeping the divert information on its way. Reinitialize
the whole packet header of the mbuf and remove the mbuf tags when
the packet gets spliced.
OK claudio@ markus@
|
|
the code relevant for UDP from sosend() and soreceive() into somove().
That allows the kernel to directly transfer the UDP data from one
socket to another.
OK claudio@
|
|
has been reached. This creates a read event on the spliced source
socket that can be noticed with select(2). So the kernel passes
control to the relay process immediately. This could be used to
log the end of an http request within a persistent connection.
deraadt@ reyk@ mikeb@ like the idea
|
|
as |= and &= are non-atomic operations. To avoid additional locks,
put the flags that have to be accessed from interrupt into a separate
sb_flagsintr 32 bit integer field. sb_flagsintr is protected by
splsoftnet.
Input from miod@ deraadt@; OK deraadt@
|
|
That is consistent to the SBLASTRECORDCHK and SBLASTMBUFCHK macros.
OK markus@
|
|
or blocking for each send(2) call.
diff from UMEZAWA Takeshi
ok bluhm
|
|
in the release path. Especially accessing m in a KDASSERT() could
go wrong.
OK claudio@
|
|
There was a small race in sorwakeup() where that could happen if
we slept before the SB_SPLICE flag was set.
ok claudio@
|
|
conditions as in soreceive(). My goal is to make socket splicing
less protocol dependent.
ok claudio@
|
|
|
|
chain (m_nextpkt), so the mbuf passed to it must be disconnected completely
from the socket buffer's chains.
Problem noticed by yasuoka@; tweak from krw@, ok deraadt@
|
|
tvtohz() so that the rounding is correct and we don't time out a tick early
ok claudio@
|
|
socket is no longer affected by option SOCKET_SPLICE we can simplyfy the
code. OK bluhm@
|
|
sosplice() to move the data already there, it might sleep in
m_copym().
Another process must not unsplice during that sleep, so also lock
the receive buffer when sosplice is called with fd -1.
The same sleep can allow network interrupts to modify the socket
buffer. So use sbsync() to write back modifications within the
loop instead of fixing the socket buffer after the loop.
OK claudio@
|
|
the size (internalized ones can be larger on some architectures) for
fitting into the socket. Avoid getting confused by sb_hiwat as well.
This fixes a variety of issues where sendmsg() would fail to deliver
a fd set or fail to wait; even leading to file leakage.
Worked on this with claudio for about a week...
|
|
anticipation of further changes to closef(). No binary change.
ok krw@ miod@ deraadt@
|
|
of per-rthread. Handling of per-thread tick and runtime counters
inspired by how FreeBSD does it.
ok kettenis@
|
|
no objection from mcbride@ krw@ markus@ deraadt@
|
|
an SCM_RIGHTS message may sleep. Bits and pieces from NetBSD with some
simplifications by yours truly.
Fixes the "receive 1" panic seen by many.
ok guenther@, claudio@
|
|
also added to the other direction.
ok mikeb@
|
|
field of the `splice' structure can be used to specify a period of
inactivity after which splicing will be dissolved. ETIMEDOUT error
retrieved with a SO_ERROR indicates the idle timeout expiration.
With comments from and OK bluhm.
|
|
the obvious cases to return EINVAL and ENXIO.
ok tedu deraadt
|
|
discussed with and ok claudio
|
|
ok claudio@
|
|
the same variable. Leak found with dlg's magic mbuf leakage finder.
OK henning@, deraadt@
|
|
socketbuffer size of the closed side since on half close the high
watermark was set to 0.
OK blambert@
|
|
end-of-file but still has data in the receive buffer, soreceive()
should block until all data has been moved.
To make kqueue work with socket splicing, it has to report spliced
sockets as non-readable.
ok deraadt@
|
|
socket. soreceive() releases splsoftnet for uiomove(). In that
moment, somove() could pull the mbuf from the receive buffer. After
that, soreceive removed the mbuf again. The corrupted length
accounting resulted in a panic.
The fix is to block read calls in soreceive() until splicing has
been finished.
just commit deraadt@
|
|
immediately by unsetting the SS_ISSENDING flag. This prevents a
possible 5 seconds delay in socket splicing.
ok markus@; commit it deraadt@
|