Skip to content

Commit

Permalink
net: Recompute sk_txhash on negative routing advice
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Tom Herbert authored and David S. Miller committed Jul 30, 2015
1 parent 877d1f6 commit 265f94f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions include/net/sock.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -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);

Expand Down

0 comments on commit 265f94f

Please sign in to comment.