aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp_minisocks.c
diff options
context:
space:
mode:
authorChristoph Paasch <christoph.paasch@uclouvain.be>2013-03-17 04:23:34 -0400
committerDavid S. Miller <davem@davemloft.net>2013-03-17 14:35:13 -0400
commit1a2c6181c4a1922021b4d7df373bba612c3e5f04 (patch)
tree1346c9b1db83495a98fbcf95f8e521c67fc55cb9 /net/ipv4/tcp_minisocks.c
parent94d8f2b133c9ff97105adc1233d1a35e16e1e7a6 (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/ipv4/tcp_minisocks.c')
-rw-r--r--net/ipv4/tcp_minisocks.c40
1 files changed, 5 insertions, 35 deletions
diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c
index 4bdb09fca401..8f0234f8bb95 100644
--- a/net/ipv4/tcp_minisocks.c
+++ b/net/ipv4/tcp_minisocks.c
@@ -93,13 +93,12 @@ tcp_timewait_state_process(struct inet_timewait_sock *tw, struct sk_buff *skb,
93 const struct tcphdr *th) 93 const struct tcphdr *th)
94{ 94{
95 struct tcp_options_received tmp_opt; 95 struct tcp_options_received tmp_opt;
96 const u8 *hash_location;
97 struct tcp_timewait_sock *tcptw = tcp_twsk((struct sock *)tw); 96 struct tcp_timewait_sock *tcptw = tcp_twsk((struct sock *)tw);
98 bool paws_reject = false; 97 bool paws_reject = false;
99 98
100 tmp_opt.saw_tstamp = 0; 99 tmp_opt.saw_tstamp = 0;
101 if (th->doff > (sizeof(*th) >> 2) && tcptw->tw_ts_recent_stamp) { 100 if (th->doff > (sizeof(*th) >> 2) && tcptw->tw_ts_recent_stamp) {
102 tcp_parse_options(skb, &tmp_opt, &hash_location, 0, NULL); 101 tcp_parse_options(skb, &tmp_opt, 0, NULL);
103 102
104 if (tmp_opt.saw_tstamp) { 103 if (tmp_opt.saw_tstamp) {
105 tmp_opt.rcv_tsecr -= tcptw->tw_ts_offset; 104 tmp_opt.rcv_tsecr -= tcptw->tw_ts_offset;
@@ -388,32 +387,6 @@ struct sock *tcp_create_openreq_child(struct sock *sk, struct request_sock *req,
388 struct tcp_request_sock *treq = tcp_rsk(req); 387 struct tcp_request_sock *treq = tcp_rsk(req);
389 struct inet_connection_sock *newicsk = inet_csk(newsk); 388 struct inet_connection_sock *newicsk = inet_csk(newsk);
390 struct tcp_sock *newtp = tcp_sk(newsk); 389 struct tcp_sock *newtp = tcp_sk(newsk);
391 struct tcp_sock *oldtp = tcp_sk(sk);
392 struct tcp_cookie_values *oldcvp = oldtp->cookie_values;
393
394 /* TCP Cookie Transactions require space for the cookie pair,
395 * as it differs for each connection. There is no need to
396 * copy any s_data_payload stored at the original socket.
397 * Failure will prevent resuming the connection.
398 *
399 * Presumed copied, in order of appearance:
400 * cookie_in_always, cookie_out_never
401 */
402 if (oldcvp != NULL) {
403 struct tcp_cookie_values *newcvp =
404 kzalloc(sizeof(*newtp->cookie_values),
405 GFP_ATOMIC);
406
407 if (newcvp != NULL) {
408 kref_init(&newcvp->kref);
409 newcvp->cookie_desired =
410 oldcvp->cookie_desired;
411 newtp->cookie_values = newcvp;
412 } else {
413 /* Not Yet Implemented */
414 newtp->cookie_values = NULL;
415 }
416 }
417 390
418 /* Now setup tcp_sock */ 391 /* Now setup tcp_sock */
419 newtp->pred_flags = 0; 392 newtp->pred_flags = 0;
@@ -422,8 +395,7 @@ struct sock *tcp_create_openreq_child(struct sock *sk, struct request_sock *req,
422 newtp->rcv_nxt = treq->rcv_isn + 1; 395 newtp->rcv_nxt = treq->rcv_isn + 1;
423 396
424 newtp->snd_sml = newtp->snd_una = 397 newtp->snd_sml = newtp->snd_una =
425 newtp->snd_nxt = newtp->snd_up = 398 newtp->snd_nxt = newtp->snd_up = treq->snt_isn + 1;
426 treq->snt_isn + 1 + tcp_s_data_size(oldtp);
427 399
428 tcp_prequeue_init(newtp); 400 tcp_prequeue_init(newtp);
429 INIT_LIST_HEAD(&newtp->tsq_node); 401 INIT_LIST_HEAD(&newtp->tsq_node);
@@ -460,8 +432,7 @@ struct sock *tcp_create_openreq_child(struct sock *sk, struct request_sock *req,
460 tcp_set_ca_state(newsk, TCP_CA_Open); 432 tcp_set_ca_state(newsk, TCP_CA_Open);
461 tcp_init_xmit_timers(newsk); 433 tcp_init_xmit_timers(newsk);
462 skb_queue_head_init(&newtp->out_of_order_queue); 434 skb_queue_head_init(&newtp->out_of_order_queue);
463 newtp->write_seq = newtp->pushed_seq = 435 newtp->write_seq = newtp->pushed_seq = treq->snt_isn + 1;
464 treq->snt_isn + 1 + tcp_s_data_size(oldtp);
465 436
466 newtp->rx_opt.saw_tstamp = 0; 437 newtp->rx_opt.saw_tstamp = 0;
467 438
@@ -538,7 +509,6 @@ struct sock *tcp_check_req(struct sock *sk, struct sk_buff *skb,
538 bool fastopen) 509 bool fastopen)
539{ 510{
540 struct tcp_options_received tmp_opt; 511 struct tcp_options_received tmp_opt;
541 const u8 *hash_location;
542 struct sock *child; 512 struct sock *child;
543 const struct tcphdr *th = tcp_hdr(skb); 513 const struct tcphdr *th = tcp_hdr(skb);
544 __be32 flg = tcp_flag_word(th) & (TCP_FLAG_RST|TCP_FLAG_SYN|TCP_FLAG_ACK); 514 __be32 flg = tcp_flag_word(th) & (TCP_FLAG_RST|TCP_FLAG_SYN|TCP_FLAG_ACK);
@@ -548,7 +518,7 @@ struct sock *tcp_check_req(struct sock *sk, struct sk_buff *skb,
548 518
549 tmp_opt.saw_tstamp = 0; 519 tmp_opt.saw_tstamp = 0;
550 if (th->doff > (sizeof(struct tcphdr)>>2)) { 520 if (th->doff > (sizeof(struct tcphdr)>>2)) {
551 tcp_parse_options(skb, &tmp_opt, &hash_location, 0, NULL); 521 tcp_parse_options(skb, &tmp_opt, 0, NULL);
552 522
553 if (tmp_opt.saw_tstamp) { 523 if (tmp_opt.saw_tstamp) {
554 tmp_opt.ts_recent = req->ts_recent; 524 tmp_opt.ts_recent = req->ts_recent;
@@ -648,7 +618,7 @@ struct sock *tcp_check_req(struct sock *sk, struct sk_buff *skb,
648 */ 618 */
649 if ((flg & TCP_FLAG_ACK) && !fastopen && 619 if ((flg & TCP_FLAG_ACK) && !fastopen &&
650 (TCP_SKB_CB(skb)->ack_seq != 620 (TCP_SKB_CB(skb)->ack_seq !=
651 tcp_rsk(req)->snt_isn + 1 + tcp_s_data_size(tcp_sk(sk)))) 621 tcp_rsk(req)->snt_isn + 1))
652 return sk; 622 return sk;
653 623
654 /* Also, it would be not so bad idea to check rcv_tsecr, which 624 /* Also, it would be not so bad idea to check rcv_tsecr, which