diff options
Diffstat (limited to 'net/ipv4/tcp_input.c')
-rw-r--r-- | net/ipv4/tcp_input.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index ed11931f340f..d3dfff78fa19 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c | |||
@@ -5872,10 +5872,9 @@ static inline void pr_drop_req(struct request_sock *req, __u16 port, int family) | |||
5872 | * TCP ECN negotiation. | 5872 | * TCP ECN negotiation. |
5873 | * | 5873 | * |
5874 | * Exception: tcp_ca wants ECN. This is required for DCTCP | 5874 | * Exception: tcp_ca wants ECN. This is required for DCTCP |
5875 | * congestion control; it requires setting ECT on all packets, | 5875 | * congestion control: Linux DCTCP asserts ECT on all packets, |
5876 | * including SYN. We inverse the test in this case: If our | 5876 | * including SYN, which is most optimal solution; however, |
5877 | * local socket wants ECN, but peer only set ece/cwr (but not | 5877 | * others, such as FreeBSD do not. |
5878 | * ECT in IP header) its probably a non-DCTCP aware sender. | ||
5879 | */ | 5878 | */ |
5880 | static void tcp_ecn_create_request(struct request_sock *req, | 5879 | static void tcp_ecn_create_request(struct request_sock *req, |
5881 | const struct sk_buff *skb, | 5880 | const struct sk_buff *skb, |
@@ -5885,18 +5884,15 @@ static void tcp_ecn_create_request(struct request_sock *req, | |||
5885 | const struct tcphdr *th = tcp_hdr(skb); | 5884 | const struct tcphdr *th = tcp_hdr(skb); |
5886 | const struct net *net = sock_net(listen_sk); | 5885 | const struct net *net = sock_net(listen_sk); |
5887 | bool th_ecn = th->ece && th->cwr; | 5886 | bool th_ecn = th->ece && th->cwr; |
5888 | bool ect, need_ecn, ecn_ok; | 5887 | bool ect, ecn_ok; |
5889 | 5888 | ||
5890 | if (!th_ecn) | 5889 | if (!th_ecn) |
5891 | return; | 5890 | return; |
5892 | 5891 | ||
5893 | ect = !INET_ECN_is_not_ect(TCP_SKB_CB(skb)->ip_dsfield); | 5892 | ect = !INET_ECN_is_not_ect(TCP_SKB_CB(skb)->ip_dsfield); |
5894 | need_ecn = tcp_ca_needs_ecn(listen_sk); | ||
5895 | ecn_ok = net->ipv4.sysctl_tcp_ecn || dst_feature(dst, RTAX_FEATURE_ECN); | 5893 | ecn_ok = net->ipv4.sysctl_tcp_ecn || dst_feature(dst, RTAX_FEATURE_ECN); |
5896 | 5894 | ||
5897 | if (!ect && !need_ecn && ecn_ok) | 5895 | if ((!ect && ecn_ok) || tcp_ca_needs_ecn(listen_sk)) |
5898 | inet_rsk(req)->ecn_ok = 1; | ||
5899 | else if (ect && need_ecn) | ||
5900 | inet_rsk(req)->ecn_ok = 1; | 5896 | inet_rsk(req)->ecn_ok = 1; |
5901 | } | 5897 | } |
5902 | 5898 | ||