Skip to content

Commit 265f94f

Browse files
tomratbertdavem330
authored andcommitted
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>
1 parent 877d1f6 commit 265f94f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

include/net/sock.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1695,6 +1695,12 @@ static inline void sk_set_txhash(struct sock *sk)
16951695
sk->sk_txhash = 1;
16961696
}
16971697

1698+
static inline void sk_rethink_txhash(struct sock *sk)
1699+
{
1700+
if (sk->sk_txhash)
1701+
sk_set_txhash(sk);
1702+
}
1703+
16981704
static inline struct dst_entry *
16991705
__sk_dst_get(struct sock *sk)
17001706
{
@@ -1719,6 +1725,8 @@ static inline void dst_negative_advice(struct sock *sk)
17191725
{
17201726
struct dst_entry *ndst, *dst = __sk_dst_get(sk);
17211727

1728+
sk_rethink_txhash(sk);
1729+
17221730
if (dst && dst->ops->negative_advice) {
17231731
ndst = dst->ops->negative_advice(dst);
17241732

0 commit comments

Comments
 (0)