diff options
author | Christoph Paasch <christoph.paasch@uclouvain.be> | 2013-03-17 04:23:34 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-03-17 14:35:13 -0400 |
commit | 1a2c6181c4a1922021b4d7df373bba612c3e5f04 (patch) | |
tree | 1346c9b1db83495a98fbcf95f8e521c67fc55cb9 /net/ipv6/tcp_ipv6.c | |
parent | 94d8f2b133c9ff97105adc1233d1a35e16e1e7a6 (diff) |
tcp: Remove TCPCT
TCPCT uses option-number 253, reserved for experimental use and should
not be used in production environments.
Further, TCPCT does not fully implement RFC 6013.
As a nice side-effect, removing TCPCT increases TCP's performance for
very short flows:
Doing an apache-benchmark with -c 100 -n 100000, sending HTTP-requests
for files of 1KB size.
before this patch:
average (among 7 runs) of 20845.5 Requests/Second
after:
average (among 7 runs) of 21403.6 Requests/Second
Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/tcp_ipv6.c')
-rw-r--r-- | net/ipv6/tcp_ipv6.c | 56 |
1 files changed, 4 insertions, 52 deletions
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index 9b6460055df5..0a97add2ab74 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c | |||
@@ -454,7 +454,6 @@ out: | |||
454 | static int tcp_v6_send_synack(struct sock *sk, struct dst_entry *dst, | 454 | static int tcp_v6_send_synack(struct sock *sk, struct dst_entry *dst, |
455 | struct flowi6 *fl6, | 455 | struct flowi6 *fl6, |
456 | struct request_sock *req, | 456 | struct request_sock *req, |
457 | struct request_values *rvp, | ||
458 | u16 queue_mapping) | 457 | u16 queue_mapping) |
459 | { | 458 | { |
460 | struct inet6_request_sock *treq = inet6_rsk(req); | 459 | struct inet6_request_sock *treq = inet6_rsk(req); |
@@ -466,7 +465,7 @@ static int tcp_v6_send_synack(struct sock *sk, struct dst_entry *dst, | |||
466 | if (!dst && (dst = inet6_csk_route_req(sk, fl6, req)) == NULL) | 465 | if (!dst && (dst = inet6_csk_route_req(sk, fl6, req)) == NULL) |
467 | goto done; | 466 | goto done; |
468 | 467 | ||
469 | skb = tcp_make_synack(sk, dst, req, rvp, NULL); | 468 | skb = tcp_make_synack(sk, dst, req, NULL); |
470 | 469 | ||
471 | if (skb) { | 470 | if (skb) { |
472 | __tcp_v6_send_check(skb, &treq->loc_addr, &treq->rmt_addr); | 471 | __tcp_v6_send_check(skb, &treq->loc_addr, &treq->rmt_addr); |
@@ -481,13 +480,12 @@ done: | |||
481 | return err; | 480 | return err; |
482 | } | 481 | } |
483 | 482 | ||
484 | static int tcp_v6_rtx_synack(struct sock *sk, struct request_sock *req, | 483 | static int tcp_v6_rtx_synack(struct sock *sk, struct request_sock *req) |
485 | struct request_values *rvp) | ||
486 | { | 484 | { |
487 | struct flowi6 fl6; | 485 | struct flowi6 fl6; |
488 | int res; | 486 | int res; |
489 | 487 | ||
490 | res = tcp_v6_send_synack(sk, NULL, &fl6, req, rvp, 0); | 488 | res = tcp_v6_send_synack(sk, NULL, &fl6, req, 0); |
491 | if (!res) | 489 | if (!res) |
492 | TCP_INC_STATS_BH(sock_net(sk), TCP_MIB_RETRANSSEGS); | 490 | TCP_INC_STATS_BH(sock_net(sk), TCP_MIB_RETRANSSEGS); |
493 | return res; | 491 | return res; |
@@ -940,9 +938,7 @@ static struct sock *tcp_v6_hnd_req(struct sock *sk,struct sk_buff *skb) | |||
940 | */ | 938 | */ |
941 | static int tcp_v6_conn_request(struct sock *sk, struct sk_buff *skb) | 939 | static int tcp_v6_conn_request(struct sock *sk, struct sk_buff *skb) |
942 | { | 940 | { |
943 | struct tcp_extend_values tmp_ext; | ||
944 | struct tcp_options_received tmp_opt; | 941 | struct tcp_options_received tmp_opt; |
945 | const u8 *hash_location; | ||
946 | struct request_sock *req; | 942 | struct request_sock *req; |
947 | struct inet6_request_sock *treq; | 943 | struct inet6_request_sock *treq; |
948 | struct ipv6_pinfo *np = inet6_sk(sk); | 944 | struct ipv6_pinfo *np = inet6_sk(sk); |
@@ -980,50 +976,7 @@ static int tcp_v6_conn_request(struct sock *sk, struct sk_buff *skb) | |||
980 | tcp_clear_options(&tmp_opt); | 976 | tcp_clear_options(&tmp_opt); |
981 | tmp_opt.mss_clamp = IPV6_MIN_MTU - sizeof(struct tcphdr) - sizeof(struct ipv6hdr); | 977 | tmp_opt.mss_clamp = IPV6_MIN_MTU - sizeof(struct tcphdr) - sizeof(struct ipv6hdr); |
982 | tmp_opt.user_mss = tp->rx_opt.user_mss; | 978 | tmp_opt.user_mss = tp->rx_opt.user_mss; |
983 | tcp_parse_options(skb, &tmp_opt, &hash_location, 0, NULL); | 979 | tcp_parse_options(skb, &tmp_opt, 0, NULL); |
984 | |||
985 | if (tmp_opt.cookie_plus > 0 && | ||
986 | tmp_opt.saw_tstamp && | ||
987 | !tp->rx_opt.cookie_out_never && | ||
988 | (sysctl_tcp_cookie_size > 0 || | ||
989 | (tp->cookie_values != NULL && | ||
990 | tp->cookie_values->cookie_desired > 0))) { | ||
991 | u8 *c; | ||
992 | u32 *d; | ||
993 | u32 *mess = &tmp_ext.cookie_bakery[COOKIE_DIGEST_WORDS]; | ||
994 | int l = tmp_opt.cookie_plus - TCPOLEN_COOKIE_BASE; | ||
995 | |||
996 | if (tcp_cookie_generator(&tmp_ext.cookie_bakery[0]) != 0) | ||
997 | goto drop_and_free; | ||
998 | |||
999 | /* Secret recipe starts with IP addresses */ | ||
1000 | d = (__force u32 *)&ipv6_hdr(skb)->daddr.s6_addr32[0]; | ||
1001 | *mess++ ^= *d++; | ||
1002 | *mess++ ^= *d++; | ||
1003 | *mess++ ^= *d++; | ||
1004 | *mess++ ^= *d++; | ||
1005 | d = (__force u32 *)&ipv6_hdr(skb)->saddr.s6_addr32[0]; | ||
1006 | *mess++ ^= *d++; | ||
1007 | *mess++ ^= *d++; | ||
1008 | *mess++ ^= *d++; | ||
1009 | *mess++ ^= *d++; | ||
1010 | |||
1011 | /* plus variable length Initiator Cookie */ | ||
1012 | c = (u8 *)mess; | ||
1013 | while (l-- > 0) | ||
1014 | *c++ ^= *hash_location++; | ||
1015 | |||
1016 | want_cookie = false; /* not our kind of cookie */ | ||
1017 | tmp_ext.cookie_out_never = 0; /* false */ | ||
1018 | tmp_ext.cookie_plus = tmp_opt.cookie_plus; | ||
1019 | } else if (!tp->rx_opt.cookie_in_always) { | ||
1020 | /* redundant indications, but ensure initialization. */ | ||
1021 | tmp_ext.cookie_out_never = 1; /* true */ | ||
1022 | tmp_ext.cookie_plus = 0; | ||
1023 | } else { | ||
1024 | goto drop_and_free; | ||
1025 | } | ||
1026 | tmp_ext.cookie_in_always = tp->rx_opt.cookie_in_always; | ||
1027 | 980 | ||
1028 | if (want_cookie && !tmp_opt.saw_tstamp) | 981 | if (want_cookie && !tmp_opt.saw_tstamp) |
1029 | tcp_clear_options(&tmp_opt); | 982 | tcp_clear_options(&tmp_opt); |
@@ -1101,7 +1054,6 @@ have_isn: | |||
1101 | goto drop_and_release; | 1054 | goto drop_and_release; |
1102 | 1055 | ||
1103 | if (tcp_v6_send_synack(sk, dst, &fl6, req, | 1056 | if (tcp_v6_send_synack(sk, dst, &fl6, req, |
1104 | (struct request_values *)&tmp_ext, | ||
1105 | skb_get_queue_mapping(skb)) || | 1057 | skb_get_queue_mapping(skb)) || |
1106 | want_cookie) | 1058 | want_cookie) |
1107 | goto drop_and_free; | 1059 | goto drop_and_free; |