Commit 265f94ff authored by Tom Herbert's avatar Tom Herbert Committed by David S. Miller
Browse files

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: default avatarTom Herbert <tom@herbertland.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 877d1f62
......@@ -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);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment