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 /include/net/inet_connection_sock.h | |
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 'include/net/inet_connection_sock.h')
-rw-r--r-- | include/net/inet_connection_sock.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/include/net/inet_connection_sock.h b/include/net/inet_connection_sock.h index bec19d5cff26..4d7e708c07d1 100644 --- a/include/net/inet_connection_sock.h +++ b/include/net/inet_connection_sock.h | |||
@@ -27,6 +27,7 @@ | |||
27 | 27 | ||
28 | struct inet_bind_bucket; | 28 | struct inet_bind_bucket; |
29 | struct inet_hashinfo; | 29 | struct inet_hashinfo; |
30 | struct tcp_congestion_ops; | ||
30 | 31 | ||
31 | /** inet_connection_sock - INET connection oriented sock | 32 | /** inet_connection_sock - INET connection oriented sock |
32 | * | 33 | * |
@@ -35,10 +36,13 @@ struct inet_hashinfo; | |||
35 | * @icsk_timeout: Timeout | 36 | * @icsk_timeout: Timeout |
36 | * @icsk_retransmit_timer: Resend (no ack) | 37 | * @icsk_retransmit_timer: Resend (no ack) |
37 | * @icsk_rto: Retransmit timeout | 38 | * @icsk_rto: Retransmit timeout |
39 | * @icsk_ca_ops Pluggable congestion control hook | ||
40 | * @icsk_ca_state: Congestion control state | ||
38 | * @icsk_retransmits: Number of unrecovered [RTO] timeouts | 41 | * @icsk_retransmits: Number of unrecovered [RTO] timeouts |
39 | * @icsk_pending: Scheduled timer event | 42 | * @icsk_pending: Scheduled timer event |
40 | * @icsk_backoff: Backoff | 43 | * @icsk_backoff: Backoff |
41 | * @icsk_syn_retries: Number of allowed SYN (or equivalent) retries | 44 | * @icsk_syn_retries: Number of allowed SYN (or equivalent) retries |
45 | * @icsk_probes_out: unanswered 0 window probes | ||
42 | * @icsk_ack: Delayed ACK control data | 46 | * @icsk_ack: Delayed ACK control data |
43 | */ | 47 | */ |
44 | struct inet_connection_sock { | 48 | struct inet_connection_sock { |
@@ -50,10 +54,14 @@ struct inet_connection_sock { | |||
50 | struct timer_list icsk_retransmit_timer; | 54 | struct timer_list icsk_retransmit_timer; |
51 | struct timer_list icsk_delack_timer; | 55 | struct timer_list icsk_delack_timer; |
52 | __u32 icsk_rto; | 56 | __u32 icsk_rto; |
57 | struct tcp_congestion_ops *icsk_ca_ops; | ||
58 | __u8 icsk_ca_state; | ||
53 | __u8 icsk_retransmits; | 59 | __u8 icsk_retransmits; |
54 | __u8 icsk_pending; | 60 | __u8 icsk_pending; |
55 | __u8 icsk_backoff; | 61 | __u8 icsk_backoff; |
56 | __u8 icsk_syn_retries; | 62 | __u8 icsk_syn_retries; |
63 | __u8 icsk_probes_out; | ||
64 | /* 2 BYTES HOLE, TRY TO PACK! */ | ||
57 | struct { | 65 | struct { |
58 | __u8 pending; /* ACK is pending */ | 66 | __u8 pending; /* ACK is pending */ |
59 | __u8 quick; /* Scheduled number of quick acks */ | 67 | __u8 quick; /* Scheduled number of quick acks */ |
@@ -65,6 +73,8 @@ struct inet_connection_sock { | |||
65 | __u16 last_seg_size; /* Size of last incoming segment */ | 73 | __u16 last_seg_size; /* Size of last incoming segment */ |
66 | __u16 rcv_mss; /* MSS used for delayed ACK decisions */ | 74 | __u16 rcv_mss; /* MSS used for delayed ACK decisions */ |
67 | } icsk_ack; | 75 | } icsk_ack; |
76 | u32 icsk_ca_priv[16]; | ||
77 | #define ICSK_CA_PRIV_SIZE (16 * sizeof(u32)) | ||
68 | }; | 78 | }; |
69 | 79 | ||
70 | #define ICSK_TIME_RETRANS 1 /* Retransmit timer */ | 80 | #define ICSK_TIME_RETRANS 1 /* Retransmit timer */ |
@@ -77,6 +87,11 @@ static inline struct inet_connection_sock *inet_csk(const struct sock *sk) | |||
77 | return (struct inet_connection_sock *)sk; | 87 | return (struct inet_connection_sock *)sk; |
78 | } | 88 | } |
79 | 89 | ||
90 | static inline void *inet_csk_ca(const struct sock *sk) | ||
91 | { | ||
92 | return (void *)inet_csk(sk)->icsk_ca_priv; | ||
93 | } | ||
94 | |||
80 | extern struct sock *inet_csk_clone(struct sock *sk, | 95 | extern struct sock *inet_csk_clone(struct sock *sk, |
81 | const struct request_sock *req, | 96 | const struct request_sock *req, |
82 | const unsigned int __nocast priority); | 97 | const unsigned int __nocast priority); |