summaryrefslogtreecommitdiffstats
path: root/net/core/sock.c
diff options
context:
space:
mode:
authorTom Herbert <tom@herbertland.com>2016-02-24 10:02:52 -0800
committerDavid S. Miller <davem@davemloft.net>2016-02-25 22:01:22 -0500
commita87cb3e48ee86d29868d3f59cfb9ce1a8fa63314 (patch)
tree4002824d66c34364f18019c659aa6adaedb9ab27 /net/core/sock.c
parentf1705ec197e705b79ea40fe7a2cc5acfa1d3bfac (diff)
downloadlinux-a87cb3e48ee86d29868d3f59cfb9ce1a8fa63314.tar.gz
linux-a87cb3e48ee86d29868d3f59cfb9ce1a8fa63314.tar.bz2
linux-a87cb3e48ee86d29868d3f59cfb9ce1a8fa63314.zip
net: Facility to report route quality of connected sockets
This patch add the SO_CNX_ADVICE socket option (setsockopt only). The purpose is to allow an application to give feedback to the kernel about the quality of the network path for a connected socket. The value argument indicates the type of quality report. For this initial patch the only supported advice is a value of 1 which indicates "bad path, please reroute"-- the action taken by the kernel is to call dst_negative_advice which will attempt to choose a different ECMP route, reset the TX hash for flow label and UDP source port in encapsulation, etc. This facility should be useful for connected UDP sockets where only the application can provide any feedback about path quality. It could also be useful for TCP applications that have additional knowledge about the path outside of the normal TCP control loop. Signed-off-by: Tom Herbert <tom@herbertland.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/sock.c')
-rw-r--r--net/core/sock.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/net/core/sock.c b/net/core/sock.c
index 46dc8ad7d050..4493ff820c2c 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -987,6 +987,10 @@ set_rcvbuf:
sk->sk_incoming_cpu = val;
break;
+ case SO_CNX_ADVICE:
+ if (val == 1)
+ dst_negative_advice(sk);
+ break;
default:
ret = -ENOPROTOOPT;
break;