Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
91a79387
Commit
91a79387
authored
Apr 21, 2004
by
David S. Miller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[TCP]: Abstract out all settings of tcp_opt->ca_state into a function.
parent
424be00c
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
18 additions
and
13 deletions
+18
-13
include/net/tcp.h
include/net/tcp.h
+6
-1
net/ipv4/tcp.c
net/ipv4/tcp.c
+1
-1
net/ipv4/tcp_input.c
net/ipv4/tcp_input.c
+9
-9
net/ipv4/tcp_minisocks.c
net/ipv4/tcp_minisocks.c
+1
-1
net/ipv4/tcp_output.c
net/ipv4/tcp_output.c
+1
-1
No files found.
include/net/tcp.h
View file @
91a79387
...
@@ -1212,6 +1212,11 @@ static inline __u32 tcp_recalc_ssthresh(struct tcp_opt *tp)
...
@@ -1212,6 +1212,11 @@ static inline __u32 tcp_recalc_ssthresh(struct tcp_opt *tp)
return
max
(
tp
->
snd_cwnd
>>
1U
,
2U
);
return
max
(
tp
->
snd_cwnd
>>
1U
,
2U
);
}
}
static
inline
void
tcp_set_ca_state
(
struct
tcp_opt
*
tp
,
u8
ca_state
)
{
tp
->
ca_state
=
ca_state
;
}
/* If cwnd > ssthresh, we may raise ssthresh to be half-way to cwnd.
/* If cwnd > ssthresh, we may raise ssthresh to be half-way to cwnd.
* The exception is rate halving phase, when cwnd is decreasing towards
* The exception is rate halving phase, when cwnd is decreasing towards
* ssthresh.
* ssthresh.
...
@@ -1271,7 +1276,7 @@ static inline void tcp_enter_cwr(struct tcp_opt *tp)
...
@@ -1271,7 +1276,7 @@ static inline void tcp_enter_cwr(struct tcp_opt *tp)
tp
->
prior_ssthresh
=
0
;
tp
->
prior_ssthresh
=
0
;
if
(
tp
->
ca_state
<
TCP_CA_CWR
)
{
if
(
tp
->
ca_state
<
TCP_CA_CWR
)
{
__tcp_enter_cwr
(
tp
);
__tcp_enter_cwr
(
tp
);
t
p
->
ca_state
=
TCP_CA_CWR
;
t
cp_set_ca_state
(
tp
,
TCP_CA_CWR
)
;
}
}
}
}
...
...
net/ipv4/tcp.c
View file @
91a79387
...
@@ -2158,7 +2158,7 @@ int tcp_disconnect(struct sock *sk, int flags)
...
@@ -2158,7 +2158,7 @@ int tcp_disconnect(struct sock *sk, int flags)
tp
->
packets_out
=
0
;
tp
->
packets_out
=
0
;
tp
->
snd_ssthresh
=
0x7fffffff
;
tp
->
snd_ssthresh
=
0x7fffffff
;
tp
->
snd_cwnd_cnt
=
0
;
tp
->
snd_cwnd_cnt
=
0
;
t
p
->
ca_state
=
TCP_CA_Open
;
t
cp_set_ca_state
(
tp
,
TCP_CA_Open
)
;
tcp_clear_retrans
(
tp
);
tcp_clear_retrans
(
tp
);
tcp_delack_init
(
tp
);
tcp_delack_init
(
tp
);
tp
->
send_head
=
NULL
;
tp
->
send_head
=
NULL
;
...
...
net/ipv4/tcp_input.c
View file @
91a79387
...
@@ -1003,7 +1003,7 @@ void tcp_enter_frto(struct sock *sk)
...
@@ -1003,7 +1003,7 @@ void tcp_enter_frto(struct sock *sk)
}
}
tcp_sync_left_out
(
tp
);
tcp_sync_left_out
(
tp
);
t
p
->
ca_state
=
TCP_CA_Open
;
t
cp_set_ca_state
(
tp
,
TCP_CA_Open
)
;
tp
->
frto_highmark
=
tp
->
snd_nxt
;
tp
->
frto_highmark
=
tp
->
snd_nxt
;
}
}
...
@@ -1049,7 +1049,7 @@ void tcp_enter_frto_loss(struct sock *sk)
...
@@ -1049,7 +1049,7 @@ void tcp_enter_frto_loss(struct sock *sk)
tp
->
reordering
=
min_t
(
unsigned
int
,
tp
->
reordering
,
tp
->
reordering
=
min_t
(
unsigned
int
,
tp
->
reordering
,
sysctl_tcp_reordering
);
sysctl_tcp_reordering
);
t
p
->
ca_state
=
TCP_CA_Loss
;
t
cp_set_ca_state
(
tp
,
TCP_CA_Loss
)
;
tp
->
high_seq
=
tp
->
frto_highmark
;
tp
->
high_seq
=
tp
->
frto_highmark
;
TCP_ECN_queue_cwr
(
tp
);
TCP_ECN_queue_cwr
(
tp
);
}
}
...
@@ -1112,7 +1112,7 @@ void tcp_enter_loss(struct sock *sk, int how)
...
@@ -1112,7 +1112,7 @@ void tcp_enter_loss(struct sock *sk, int how)
tp
->
reordering
=
min_t
(
unsigned
int
,
tp
->
reordering
,
tp
->
reordering
=
min_t
(
unsigned
int
,
tp
->
reordering
,
sysctl_tcp_reordering
);
sysctl_tcp_reordering
);
t
p
->
ca_state
=
TCP_CA_Loss
;
t
cp_set_ca_state
(
tp
,
TCP_CA_Loss
)
;
tp
->
high_seq
=
tp
->
snd_nxt
;
tp
->
high_seq
=
tp
->
snd_nxt
;
TCP_ECN_queue_cwr
(
tp
);
TCP_ECN_queue_cwr
(
tp
);
}
}
...
@@ -1489,7 +1489,7 @@ static int tcp_try_undo_recovery(struct sock *sk, struct tcp_opt *tp)
...
@@ -1489,7 +1489,7 @@ static int tcp_try_undo_recovery(struct sock *sk, struct tcp_opt *tp)
tcp_moderate_cwnd
(
tp
);
tcp_moderate_cwnd
(
tp
);
return
1
;
return
1
;
}
}
t
p
->
ca_state
=
TCP_CA_Open
;
t
cp_set_ca_state
(
tp
,
TCP_CA_Open
)
;
return
0
;
return
0
;
}
}
...
@@ -1549,7 +1549,7 @@ static int tcp_try_undo_loss(struct sock *sk, struct tcp_opt *tp)
...
@@ -1549,7 +1549,7 @@ static int tcp_try_undo_loss(struct sock *sk, struct tcp_opt *tp)
tp
->
retransmits
=
0
;
tp
->
retransmits
=
0
;
tp
->
undo_marker
=
0
;
tp
->
undo_marker
=
0
;
if
(
!
IsReno
(
tp
))
if
(
!
IsReno
(
tp
))
t
p
->
ca_state
=
TCP_CA_Open
;
t
cp_set_ca_state
(
tp
,
TCP_CA_Open
)
;
return
1
;
return
1
;
}
}
return
0
;
return
0
;
...
@@ -1583,7 +1583,7 @@ static void tcp_try_to_open(struct sock *sk, struct tcp_opt *tp, int flag)
...
@@ -1583,7 +1583,7 @@ static void tcp_try_to_open(struct sock *sk, struct tcp_opt *tp, int flag)
state
=
TCP_CA_Disorder
;
state
=
TCP_CA_Disorder
;
if
(
tp
->
ca_state
!=
state
)
{
if
(
tp
->
ca_state
!=
state
)
{
t
p
->
ca_state
=
state
;
t
cp_set_ca_state
(
tp
,
state
)
;
tp
->
high_seq
=
tp
->
snd_nxt
;
tp
->
high_seq
=
tp
->
snd_nxt
;
}
}
tcp_moderate_cwnd
(
tp
);
tcp_moderate_cwnd
(
tp
);
...
@@ -1658,7 +1658,7 @@ tcp_fastretrans_alert(struct sock *sk, u32 prior_snd_una,
...
@@ -1658,7 +1658,7 @@ tcp_fastretrans_alert(struct sock *sk, u32 prior_snd_una,
* is ACKed for CWR bit to reach receiver. */
* is ACKed for CWR bit to reach receiver. */
if
(
tp
->
snd_una
!=
tp
->
high_seq
)
{
if
(
tp
->
snd_una
!=
tp
->
high_seq
)
{
tcp_complete_cwr
(
tp
);
tcp_complete_cwr
(
tp
);
t
p
->
ca_state
=
TCP_CA_Open
;
t
cp_set_ca_state
(
tp
,
TCP_CA_Open
)
;
}
}
break
;
break
;
...
@@ -1669,7 +1669,7 @@ tcp_fastretrans_alert(struct sock *sk, u32 prior_snd_una,
...
@@ -1669,7 +1669,7 @@ tcp_fastretrans_alert(struct sock *sk, u32 prior_snd_una,
* catching for all duplicate ACKs. */
* catching for all duplicate ACKs. */
IsReno
(
tp
)
||
tp
->
snd_una
!=
tp
->
high_seq
)
{
IsReno
(
tp
)
||
tp
->
snd_una
!=
tp
->
high_seq
)
{
tp
->
undo_marker
=
0
;
tp
->
undo_marker
=
0
;
t
p
->
ca_state
=
TCP_CA_Open
;
t
cp_set_ca_state
(
tp
,
TCP_CA_Open
)
;
}
}
break
;
break
;
...
@@ -1743,7 +1743,7 @@ tcp_fastretrans_alert(struct sock *sk, u32 prior_snd_una,
...
@@ -1743,7 +1743,7 @@ tcp_fastretrans_alert(struct sock *sk, u32 prior_snd_una,
}
}
tp
->
snd_cwnd_cnt
=
0
;
tp
->
snd_cwnd_cnt
=
0
;
t
p
->
ca_state
=
TCP_CA_Recovery
;
t
cp_set_ca_state
(
tp
,
TCP_CA_Recovery
)
;
}
}
if
(
is_dupack
||
tcp_head_timedout
(
sk
,
tp
))
if
(
is_dupack
||
tcp_head_timedout
(
sk
,
tp
))
...
...
net/ipv4/tcp_minisocks.c
View file @
91a79387
...
@@ -769,7 +769,7 @@ struct sock *tcp_create_openreq_child(struct sock *sk, struct open_request *req,
...
@@ -769,7 +769,7 @@ struct sock *tcp_create_openreq_child(struct sock *sk, struct open_request *req,
newtp
->
frto_counter
=
0
;
newtp
->
frto_counter
=
0
;
newtp
->
frto_highmark
=
0
;
newtp
->
frto_highmark
=
0
;
newtp
->
ca_state
=
TCP_CA_Open
;
tcp_set_ca_state
(
newtp
,
TCP_CA_Open
)
;
tcp_init_xmit_timers
(
newsk
);
tcp_init_xmit_timers
(
newsk
);
skb_queue_head_init
(
&
newtp
->
out_of_order_queue
);
skb_queue_head_init
(
&
newtp
->
out_of_order_queue
);
newtp
->
send_head
=
NULL
;
newtp
->
send_head
=
NULL
;
...
...
net/ipv4/tcp_output.c
View file @
91a79387
...
@@ -869,7 +869,7 @@ void tcp_simple_retransmit(struct sock *sk)
...
@@ -869,7 +869,7 @@ void tcp_simple_retransmit(struct sock *sk)
tp
->
snd_ssthresh
=
tcp_current_ssthresh
(
tp
);
tp
->
snd_ssthresh
=
tcp_current_ssthresh
(
tp
);
tp
->
prior_ssthresh
=
0
;
tp
->
prior_ssthresh
=
0
;
tp
->
undo_marker
=
0
;
tp
->
undo_marker
=
0
;
t
p
->
ca_state
=
TCP_CA_Loss
;
t
cp_set_ca_state
(
tp
,
TCP_CA_Loss
)
;
}
}
tcp_xmit_retransmit_queue
(
sk
);
tcp_xmit_retransmit_queue
(
sk
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment