Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
d06e021d
cloud-kernel
项目概览
openanolis
/
cloud-kernel
大约 1 年 前同步成功
通知
158
Star
36
Fork
7
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
10
列表
看板
标记
里程碑
合并请求
2
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
cloud-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
10
Issue
10
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
d06e021d
编写于
6月 18, 2007
作者:
D
David S. Miller
提交者:
David S. Miller
10月 10, 2007
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TCP]: Extract DSACK detection code from tcp_sacktag_write_queue().
Signed-off-by:
N
David S. Miller
<
davem@davemloft.net
>
上级
19b2b486
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
36 addition
and
20 deletion
+36
-20
net/ipv4/tcp_input.c
net/ipv4/tcp_input.c
+36
-20
未找到文件。
net/ipv4/tcp_input.c
浏览文件 @
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
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录