summaryrefslogtreecommitdiffstats
path: root/include/net/sock.h
diff options
context:
space:
mode:
authorTom Herbert <tom@herbertland.com>2015-07-28 16:02:06 -0700
committerDavid S. Miller <davem@davemloft.net>2015-07-29 22:44:05 -0700
commit265f94ff54d62503663d9c788ba1f082e448f8b8 (patch)
tree23b4f2c90130092b17f1c560331266cb85cb4a26 /include/net/sock.h
parent877d1f6291f8e391237e324be58479a3e3a7407c (diff)
downloadlinux-265f94ff54d62503663d9c788ba1f082e448f8b8.tar.bz2
net: Recompute sk_txhash on negative routing advice
When a connection is failing a transport protocol calls dst_negative_advice to try to get a better route. This patch includes changing the sk_txhash in that function. This provides a rudimentary method to try to find a different path in the network since sk_txhash affects ECMP on the local host and through the network (via flow labels or UDP source port in encapsulation). Signed-off-by: Tom Herbert <tom@herbertland.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/sock.h')
-rw-r--r--include/net/sock.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/net/sock.h b/include/net/sock.h
index fe735c4841f6..24aa75c5317a 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -1695,6 +1695,12 @@ static inline void sk_set_txhash(struct sock *sk)
sk->sk_txhash = 1;
}
+static inline void sk_rethink_txhash(struct sock *sk)
+{
+ if (sk->sk_txhash)
+ sk_set_txhash(sk);
+}
+
static inline struct dst_entry *
__sk_dst_get(struct sock *sk)
{
@@ -1719,6 +1725,8 @@ static inline void dst_negative_advice(struct sock *sk)
{
struct dst_entry *ndst, *dst = __sk_dst_get(sk);
+ sk_rethink_txhash(sk);
+
if (dst && dst->ops->negative_advice) {
ndst = dst->ops->negative_advice(dst);