tcp: reflect tos value received in SYN to the socket
authorWei Wang <weiwan@google.com>
Thu, 10 Sep 2020 00:50:48 +0000 (17:50 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 10 Sep 2020 20:15:40 +0000 (13:15 -0700)
commitac8f1710c12bb4c3626280ce03f05459ba8feef6
treef9db7718210545aa9708155babb2b1df39fb0fce
parentde033b7d1568a8f1252055c96cdd99954d5450c4
tcp: reflect tos value received in SYN to the socket

This commit adds a new TCP feature to reflect the tos value received in
SYN, and send it out on the SYN-ACK, and eventually set the tos value of
the established socket with this reflected tos value. This provides a
way to set the traffic class/QoS level for all traffic in the same
connection to be the same as the incoming SYN request. It could be
useful in data centers to provide equivalent QoS according to the
incoming request.
This feature is guarded by /proc/sys/net/ipv4/tcp_reflect_tos, and is by
default turned off.

Signed-off-by: Wei Wang <weiwan@google.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/netns/ipv4.h
net/ipv4/sysctl_net_ipv4.c
net/ipv4/tcp_ipv4.c
net/ipv6/tcp_ipv6.c