aboutsummaryrefslogtreecommitdiffstats
path: root/driver/receive.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* driver: receive: drop handshakes if queue lock is contendedJason A. Donenfeld2021-09-091-1/+4
| | | | | | | | | | | | If we're being delivered packets from multiple CPUs so quickly that the ring lock is contended for CPU tries, then it's safe to assume that the queue is near capacity anyway, so just drop the packet rather than spinning. This helps deal with multicore DoS that can interfere with data path performance. It _still_ does not completely fix the issue, but it again chips away at it. Reported-by: Streun Fabio <fstreun@student.ethz.ch> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* driver: receive: use ring buffer for incoming handshakesJason A. Donenfeld2021-08-091-5/+7
| | | | | | | | | | | | | | Apparently the spinlock on incoming_handshake's skb_queue is highly contended, and a torrent of handshake or cookie packets can bring the data plane to its knees, simply by virtue of enqueueing the handshake packets to be processed asynchronously. So, we try switching this to a ring buffer to hopefully have less lock contention. If this is still a problem, we can resurrect the MPMC ring buffer, but for now let's see if good old ptr_ring does the trick. Reported-by: Streun Fabio <fstreun@student.ethz.ch> Reported-by: Joel Wanner <joel.wanner@inf.ethz.ch> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* driver: receive: simplify endpoint settingJason A. Donenfeld2021-08-081-7/+3
| | | | | | | This is a holdover from Linux, where we reset the packet before consuming. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* driver: memory: move NBL pools to global scopeJason A. Donenfeld2021-08-041-7/+7
| | | | | | | This is preparation for the next commit, which will attempt to allocate everything at once for the RX path. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* driver: receive: don't use ParentNetBuffer when passing off NBLs to NDISJason A. Donenfeld2021-08-031-1/+0
| | | | | | | | | Otherwise WFP attempts to correlate flows and winds up dereferencing garbage in ParentNetBuffer->NetBufferListInfo[WfpNetBufferListInfo]. Reported-by: Sam Sun <sam@samczsun.com> Reported-by: Jauder Ho <jauderho@gmail.com> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* driver: do rx and tx on same threads as encryption and decryptionJason A. Donenfeld2021-08-021-9/+10
| | | | | | | This seems surprising to me, but the Windows scheduler doesn't behave as expected, and this is actually faster. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* Introduce WireGuardNTJason A. Donenfeld2021-08-021-0/+634
Co-authored-by: Simon Rozman <simon@rozman.si> Signed-off-by: Simon Rozman <simon@rozman.si> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>