Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linux-davinci
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
linux
linux-davinci
Commits
d06e021d
Commit
d06e021d
authored
Jun 18, 2007
by
David S. Miller
Committed by
David S. Miller
Oct 10, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[TCP]: Extract DSACK detection code from tcp_sacktag_write_queue().
Signed-off-by:
David S. Miller
<
davem@davemloft.net
>
parent
19b2b486
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
20 deletions
+36
-20
net/ipv4/tcp_input.c
net/ipv4/tcp_input.c
+36
-20
No files found.
net/ipv4/tcp_input.c
View file @
d06e021d
...
...
@@ -960,6 +960,39 @@ static void tcp_update_reordering(struct sock *sk, const int metric,
* Both of these heuristics are not used in Loss state, when we cannot
* account for retransmits accurately.
*/
static
int
tcp_check_dsack
(
struct
tcp_sock
*
tp
,
struct
sk_buff
*
ack_skb
,
struct
tcp_sack_block_wire
*
sp
,
int
num_sacks
,
u32
prior_snd_una
)
{
u32
start_seq_0
=
ntohl
(
get_unaligned
(
&
sp
[
0
].
start_seq
));
u32
end_seq_0
=
ntohl
(
get_unaligned
(
&
sp
[
0
].
end_seq
));
int
dup_sack
=
0
;
if
(
before
(
start_seq_0
,
TCP_SKB_CB
(
ack_skb
)
->
ack_seq
))
{
dup_sack
=
1
;
tp
->
rx_opt
.
sack_ok
|=
4
;
NET_INC_STATS_BH
(
LINUX_MIB_TCPDSACKRECV
);
}
else
if
(
num_sacks
>
1
)
{
u32
end_seq_1
=
ntohl
(
get_unaligned
(
&
sp
[
1
].
end_seq
));
u32
start_seq_1
=
ntohl
(
get_unaligned
(
&
sp
[
1
].
start_seq
));
if
(
!
after
(
end_seq_0
,
end_seq_1
)
&&
!
before
(
start_seq_0
,
start_seq_1
))
{
dup_sack
=
1
;
tp
->
rx_opt
.
sack_ok
|=
4
;
NET_INC_STATS_BH
(
LINUX_MIB_TCPDSACKOFORECV
);
}
}
/* D-SACK for already forgotten data... Do dumb counting. */
if
(
dup_sack
&&
!
after
(
end_seq_0
,
prior_snd_una
)
&&
after
(
end_seq_0
,
tp
->
undo_marker
))
tp
->
undo_retrans
--
;
return
dup_sack
;
}
static
int
tcp_sacktag_write_queue
(
struct
sock
*
sk
,
struct
sk_buff
*
ack_skb
,
u32
prior_snd_una
)
{
...
...
@@ -985,27 +1018,10 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff *ack_skb, u32 prior_snd_
}
prior_fackets
=
tp
->
fackets_out
;
/* Check for D-SACK. */
if
(
before
(
ntohl
(
sp
[
0
].
start_seq
),
TCP_SKB_CB
(
ack_skb
)
->
ack_seq
))
{
flag
|=
FLAG_DSACKING_ACK
;
found_dup_sack
=
1
;
tp
->
rx_opt
.
sack_ok
|=
4
;
NET_INC_STATS_BH
(
LINUX_MIB_TCPDSACKRECV
);
}
else
if
(
num_sacks
>
1
&&
!
after
(
ntohl
(
sp
[
0
].
end_seq
),
ntohl
(
sp
[
1
].
end_seq
))
&&
!
before
(
ntohl
(
sp
[
0
].
start_seq
),
ntohl
(
sp
[
1
].
start_seq
)))
{
found_dup_sack
=
tcp_check_dsack
(
tp
,
ack_skb
,
sp
,
num_sacks
,
prior_snd_una
);
if
(
found_dup_sack
)
flag
|=
FLAG_DSACKING_ACK
;
found_dup_sack
=
1
;
tp
->
rx_opt
.
sack_ok
|=
4
;
NET_INC_STATS_BH
(
LINUX_MIB_TCPDSACKOFORECV
);
}
/* D-SACK for already forgotten data...
* Do dumb counting. */
if
(
found_dup_sack
&&
!
after
(
ntohl
(
sp
[
0
].
end_seq
),
prior_snd_una
)
&&
after
(
ntohl
(
sp
[
0
].
end_seq
),
tp
->
undo_marker
))
tp
->
undo_retrans
--
;
/* Eliminate too old ACKs, but take into
* account more or less fresh ones, they can
...
...
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