tcp: Remove sanity checks from BufferQueue in release builds

Each TCPEndpoint has two BufferQueue members, one for the send queue
and one for the receive queue.

If DEBUG_BUFFER_QUEUE is enabled, then most methods of BufferQueue
call BufferQueue::Verify(), sometimes twice. This member function
performs some sanity checking which requires iterating through every
net_buffer in the queue.

Disabling this in a debug build improved throughput by a factor of 5x
over the loopback interface on my laptop. Using iperf the measured
throughput went from 900Mbps to around 4.8Gbps.

This patch turns this sanity checking off for release builds.

* Rename DEBUG_BUFFER_QUEUE to DEBUG_TCP_BUFFER_QUEUE
* Change the default in BufferQueue.h to disabled
* Set DEBUG_TCP_BUFFER_QUEUE to KDEBUG_LEVEL_2 in
  kernel_debug_config.h

Change-Id: I262dac5d7e2889d2942bbdcf6b667cc0cbafa4c8
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2780
Reviewed-by: waddlesplash <[email protected]>
This commit is contained in:
Kyle Ambroff-Kao
2020-05-23 02:32:58 +00:00
committed by waddlesplash
parent 82817fee45
commit 44a4bc5fd6
5 changed files with 13 additions and 11 deletions
@@ -140,4 +140,10 @@
#define SYSTEM_PROFILE_INTERVAL 10000
// Network
// Enables additional assertions in the tcp add-on.
#define DEBUG_TCP_BUFFER_QUEUE KDEBUG_LEVEL_2
#endif // KERNEL_DEBUG_CONFIG_H