tcp.c (9e9fd65d1fa51d919d54d731be0e66492b5b6c5a) | tcp.c (46d3ceabd8d98ed0ad10f20c595ca784e34786c5) |
---|---|
1/* 2 * INET An implementation of the TCP/IP protocol suite for the LINUX 3 * operating system. INET is implemented using the BSD Socket 4 * interface as the means of communication with the user level. 5 * 6 * Implementation of the Transmission Control Protocol(TCP). 7 * 8 * Authors: Ross Biro --- 362 unchanged lines hidden (view full) --- 371void tcp_init_sock(struct sock *sk) 372{ 373 struct inet_connection_sock *icsk = inet_csk(sk); 374 struct tcp_sock *tp = tcp_sk(sk); 375 376 skb_queue_head_init(&tp->out_of_order_queue); 377 tcp_init_xmit_timers(sk); 378 tcp_prequeue_init(tp); | 1/* 2 * INET An implementation of the TCP/IP protocol suite for the LINUX 3 * operating system. INET is implemented using the BSD Socket 4 * interface as the means of communication with the user level. 5 * 6 * Implementation of the Transmission Control Protocol(TCP). 7 * 8 * Authors: Ross Biro --- 362 unchanged lines hidden (view full) --- 371void tcp_init_sock(struct sock *sk) 372{ 373 struct inet_connection_sock *icsk = inet_csk(sk); 374 struct tcp_sock *tp = tcp_sk(sk); 375 376 skb_queue_head_init(&tp->out_of_order_queue); 377 tcp_init_xmit_timers(sk); 378 tcp_prequeue_init(tp); |
379 INIT_LIST_HEAD(&tp->tsq_node); |
|
379 380 icsk->icsk_rto = TCP_TIMEOUT_INIT; 381 tp->mdev = TCP_TIMEOUT_INIT; 382 383 /* So many TCP implementations out there (incorrectly) count the 384 * initial SYN frame in their delayed-ACK and congestion control 385 * algorithms that we must have the following bandaid to talk 386 * efficiently to them. -DaveM --- 404 unchanged lines hidden (view full) --- 791 xmit_size_goal = mss_now; 792 793 if (large_allowed && sk_can_gso(sk)) { 794 xmit_size_goal = ((sk->sk_gso_max_size - 1) - 795 inet_csk(sk)->icsk_af_ops->net_header_len - 796 inet_csk(sk)->icsk_ext_hdr_len - 797 tp->tcp_header_len); 798 | 380 381 icsk->icsk_rto = TCP_TIMEOUT_INIT; 382 tp->mdev = TCP_TIMEOUT_INIT; 383 384 /* So many TCP implementations out there (incorrectly) count the 385 * initial SYN frame in their delayed-ACK and congestion control 386 * algorithms that we must have the following bandaid to talk 387 * efficiently to them. -DaveM --- 404 unchanged lines hidden (view full) --- 792 xmit_size_goal = mss_now; 793 794 if (large_allowed && sk_can_gso(sk)) { 795 xmit_size_goal = ((sk->sk_gso_max_size - 1) - 796 inet_csk(sk)->icsk_af_ops->net_header_len - 797 inet_csk(sk)->icsk_ext_hdr_len - 798 tp->tcp_header_len); 799 |
800 /* TSQ : try to have two TSO segments in flight */ 801 xmit_size_goal = min_t(u32, xmit_size_goal, 802 sysctl_tcp_limit_output_bytes >> 1); 803 |
|
799 xmit_size_goal = tcp_bound_to_half_wnd(tp, xmit_size_goal); 800 801 /* We try hard to avoid divides here */ 802 old_size_goal = tp->xmit_size_goal_segs * mss_now; 803 804 if (likely(old_size_goal <= xmit_size_goal && 805 old_size_goal + mss_now > xmit_size_goal)) { 806 xmit_size_goal = old_size_goal; --- 2498 unchanged lines hidden (view full) --- 3305 3306 sg_init_one(&sg, key->key, key->keylen); 3307 return crypto_hash_update(&hp->md5_desc, &sg, key->keylen); 3308} 3309EXPORT_SYMBOL(tcp_md5_hash_key); 3310 3311#endif 3312 | 804 xmit_size_goal = tcp_bound_to_half_wnd(tp, xmit_size_goal); 805 806 /* We try hard to avoid divides here */ 807 old_size_goal = tp->xmit_size_goal_segs * mss_now; 808 809 if (likely(old_size_goal <= xmit_size_goal && 810 old_size_goal + mss_now > xmit_size_goal)) { 811 xmit_size_goal = old_size_goal; --- 2498 unchanged lines hidden (view full) --- 3310 3311 sg_init_one(&sg, key->key, key->keylen); 3312 return crypto_hash_update(&hp->md5_desc, &sg, key->keylen); 3313} 3314EXPORT_SYMBOL(tcp_md5_hash_key); 3315 3316#endif 3317 |
3313/** 3314 * Each Responder maintains up to two secret values concurrently for | 3318/* Each Responder maintains up to two secret values concurrently for |
3315 * efficient secret rollover. Each secret value has 4 states: 3316 * 3317 * Generating. (tcp_secret_generating != tcp_secret_primary) 3318 * Generates new Responder-Cookies, but not yet used for primary 3319 * verification. This is a short-term state, typically lasting only 3320 * one round trip time (RTT). 3321 * 3322 * Primary. (tcp_secret_generating == tcp_secret_primary) --- 235 unchanged lines hidden (view full) --- 3558 3559 sysctl_tcp_rmem[0] = SK_MEM_QUANTUM; 3560 sysctl_tcp_rmem[1] = 87380; 3561 sysctl_tcp_rmem[2] = max(87380, max_rshare); 3562 3563 pr_info("Hash tables configured (established %u bind %u)\n", 3564 tcp_hashinfo.ehash_mask + 1, tcp_hashinfo.bhash_size); 3565 | 3319 * efficient secret rollover. Each secret value has 4 states: 3320 * 3321 * Generating. (tcp_secret_generating != tcp_secret_primary) 3322 * Generates new Responder-Cookies, but not yet used for primary 3323 * verification. This is a short-term state, typically lasting only 3324 * one round trip time (RTT). 3325 * 3326 * Primary. (tcp_secret_generating == tcp_secret_primary) --- 235 unchanged lines hidden (view full) --- 3562 3563 sysctl_tcp_rmem[0] = SK_MEM_QUANTUM; 3564 sysctl_tcp_rmem[1] = 87380; 3565 sysctl_tcp_rmem[2] = max(87380, max_rshare); 3566 3567 pr_info("Hash tables configured (established %u bind %u)\n", 3568 tcp_hashinfo.ehash_mask + 1, tcp_hashinfo.bhash_size); 3569 |
3570 tcp_metrics_init(); 3571 |
|
3566 tcp_register_congestion_control(&tcp_reno); 3567 3568 memset(&tcp_secret_one.secrets[0], 0, sizeof(tcp_secret_one.secrets)); 3569 memset(&tcp_secret_two.secrets[0], 0, sizeof(tcp_secret_two.secrets)); 3570 tcp_secret_one.expires = jiffy; /* past due */ 3571 tcp_secret_two.expires = jiffy; /* past due */ 3572 tcp_secret_generating = &tcp_secret_one; 3573 tcp_secret_primary = &tcp_secret_one; 3574 tcp_secret_retiring = &tcp_secret_two; 3575 tcp_secret_secondary = &tcp_secret_two; | 3572 tcp_register_congestion_control(&tcp_reno); 3573 3574 memset(&tcp_secret_one.secrets[0], 0, sizeof(tcp_secret_one.secrets)); 3575 memset(&tcp_secret_two.secrets[0], 0, sizeof(tcp_secret_two.secrets)); 3576 tcp_secret_one.expires = jiffy; /* past due */ 3577 tcp_secret_two.expires = jiffy; /* past due */ 3578 tcp_secret_generating = &tcp_secret_one; 3579 tcp_secret_primary = &tcp_secret_one; 3580 tcp_secret_retiring = &tcp_secret_two; 3581 tcp_secret_secondary = &tcp_secret_two; |
3582 tcp_tasklet_init(); |
|
3576} | 3583} |