]> git.ipfire.org Git - thirdparty/suricata.git/commit
tcp: zero copy fast path in app-layer reassembly
authorVictor Julien <victor@inliniac.net>
Fri, 16 Jan 2015 10:53:29 +0000 (11:53 +0100)
committerVictor Julien <victor@inliniac.net>
Wed, 4 Feb 2015 10:23:46 +0000 (11:23 +0100)
commit2bba5eb7044504044b9a0e913e95fa4f542e49e4
tree89006c1b4afeb3c4e4a17f0d269c36853caa08d8
parent8c1bc7cfb6adddfbfcbad6ee087b5fd45383cd66
tcp: zero copy fast path in app-layer reassembly

Create 2 'fast paths' for app layer reassembly. Both are about reducing
copying. In the cases described below, we pass the segment's data
directly to the app layer API, instead of first copying it into a buffer
than we then pass. This safes a copy.

The first is for the case when we have just one single segment that was
just ack'd. As we know that we won't use any other segment this round,
we can just use the segment data.

The second case is more aggressive. When the segment meets a certain
size limit (currently hardcoded at 128 bytes), we pass it to the
app-layer API directly. Thus invoking the app-layer somewhat more often
to safe some copies.
src/stream-tcp-reassemble.c