diff options
author | Arnaldo Carvalho de Melo <acme@mandriva.com> | 2005-08-10 03:03:31 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2005-08-29 18:56:18 -0400 |
commit | 6687e988d9aeaccad6774e6a8304f681f3ec0a03 (patch) | |
tree | ecd3d28f9989847aa1dcde4782de0210aeadc290 /net/ipv4/tcp_ipv4.c | |
parent | 64ce207306debd7157f47282be94770407bec01c (diff) |
[ICSK]: Move TCP congestion avoidance members to icsk
This changeset basically moves tcp_sk()->{ca_ops,ca_state,etc} to inet_csk(),
minimal renaming/moving done in this changeset to ease review.
Most of it is just changes of struct tcp_sock * to struct sock * parameters.
With this we move to a state closer to two interesting goals:
1. Generalisation of net/ipv4/tcp_diag.c, becoming inet_diag.c, being used
for any INET transport protocol that has struct inet_hashinfo and are
derived from struct inet_connection_sock. Keeps the userspace API, that will
just not display DCCP sockets, while newer versions of tools can support
DCCP.
2. INET generic transport pluggable Congestion Avoidance infrastructure, using
the current TCP CA infrastructure with DCCP.
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp_ipv4.c')
-rw-r--r-- | net/ipv4/tcp_ipv4.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index 32a0ebc589d5..97bbf595230d 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c | |||
@@ -1409,13 +1409,14 @@ struct tcp_func ipv4_specific = { | |||
1409 | */ | 1409 | */ |
1410 | static int tcp_v4_init_sock(struct sock *sk) | 1410 | static int tcp_v4_init_sock(struct sock *sk) |
1411 | { | 1411 | { |
1412 | struct inet_connection_sock *icsk = inet_csk(sk); | ||
1412 | struct tcp_sock *tp = tcp_sk(sk); | 1413 | struct tcp_sock *tp = tcp_sk(sk); |
1413 | 1414 | ||
1414 | skb_queue_head_init(&tp->out_of_order_queue); | 1415 | skb_queue_head_init(&tp->out_of_order_queue); |
1415 | tcp_init_xmit_timers(sk); | 1416 | tcp_init_xmit_timers(sk); |
1416 | tcp_prequeue_init(tp); | 1417 | tcp_prequeue_init(tp); |
1417 | 1418 | ||
1418 | inet_csk(sk)->icsk_rto = TCP_TIMEOUT_INIT; | 1419 | icsk->icsk_rto = TCP_TIMEOUT_INIT; |
1419 | tp->mdev = TCP_TIMEOUT_INIT; | 1420 | tp->mdev = TCP_TIMEOUT_INIT; |
1420 | 1421 | ||
1421 | /* So many TCP implementations out there (incorrectly) count the | 1422 | /* So many TCP implementations out there (incorrectly) count the |
@@ -1433,7 +1434,7 @@ static int tcp_v4_init_sock(struct sock *sk) | |||
1433 | tp->mss_cache = 536; | 1434 | tp->mss_cache = 536; |
1434 | 1435 | ||
1435 | tp->reordering = sysctl_tcp_reordering; | 1436 | tp->reordering = sysctl_tcp_reordering; |
1436 | tp->ca_ops = &tcp_init_congestion_ops; | 1437 | icsk->icsk_ca_ops = &tcp_init_congestion_ops; |
1437 | 1438 | ||
1438 | sk->sk_state = TCP_CLOSE; | 1439 | sk->sk_state = TCP_CLOSE; |
1439 | 1440 | ||
@@ -1456,7 +1457,7 @@ int tcp_v4_destroy_sock(struct sock *sk) | |||
1456 | 1457 | ||
1457 | tcp_clear_xmit_timers(sk); | 1458 | tcp_clear_xmit_timers(sk); |
1458 | 1459 | ||
1459 | tcp_cleanup_congestion_control(tp); | 1460 | tcp_cleanup_congestion_control(sk); |
1460 | 1461 | ||
1461 | /* Cleanup up the write buffer. */ | 1462 | /* Cleanup up the write buffer. */ |
1462 | sk_stream_writequeue_purge(sk); | 1463 | sk_stream_writequeue_purge(sk); |
@@ -1883,7 +1884,7 @@ static void get_tcp4_sock(struct sock *sp, char *tmpbuf, int i) | |||
1883 | jiffies_to_clock_t(timer_expires - jiffies), | 1884 | jiffies_to_clock_t(timer_expires - jiffies), |
1884 | icsk->icsk_retransmits, | 1885 | icsk->icsk_retransmits, |
1885 | sock_i_uid(sp), | 1886 | sock_i_uid(sp), |
1886 | tp->probes_out, | 1887 | icsk->icsk_probes_out, |
1887 | sock_i_ino(sp), | 1888 | sock_i_ino(sp), |
1888 | atomic_read(&sp->sk_refcnt), sp, | 1889 | atomic_read(&sp->sk_refcnt), sp, |
1889 | icsk->icsk_rto, | 1890 | icsk->icsk_rto, |