net: make TOS / DSCP compile time configurable

This commit is contained in:
Thomas Schoebel-Theuer 2018-05-15 14:54:14 +02:00
parent 734df921d8
commit 1615dbf538
2 changed files with 11 additions and 0 deletions

View File

@ -105,6 +105,15 @@ config MARS_SEPARATE_PORTS
If unsure, say Y.
config MARS_IPv4_TOS
bool "use TOS / DSCP in IPv4"
depends on MARS_SEPARATE_PORTS
default y
---help---
Tag IP traffic differently for different ports.
In certain private networks, this can improve certain
network bottlenecks.
config MARS_MEM_RETRY
bool "make MARS memory allocation more robust"
depends on MARS

View File

@ -189,7 +189,9 @@ void _set_socketopts(struct socket *sock, struct mars_tcp_params *params)
sock->sk->sk_reuse = 1;
_setsockopt(sock, SOL_SOCKET, SO_SNDBUFFORCE, params->tcp_window_size);
_setsockopt(sock, SOL_SOCKET, SO_RCVBUFFORCE, params->tcp_window_size);
#ifdef CONFIG_MARS_IPv4_TOS
_setsockopt(sock, SOL_IP, IP_TOS, params->ip_tos);
#endif
_setsockopt(sock, IPPROTO_TCP, TCP_NODELAY, params->tcp_nodelay);
_setsockopt(sock, SOL_SOCKET, SO_KEEPALIVE, x_true);
_setsockopt(sock, IPPROTO_TCP, TCP_KEEPCNT, params->tcp_keepcnt);