Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
e4dfd449
cloud-kernel
项目概览
openanolis
/
cloud-kernel
1 年多 前同步成功
通知
161
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看板
提交
e4dfd449
编写于
1月 04, 2006
作者:
A
Arnaldo Carvalho de Melo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[DCCP] ackvec: use u8 for the buf offsets
Signed-off-by:
N
Arnaldo Carvalho de Melo
<
acme@mandriva.com
>
上级
6742bbcb
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
23 addition
and
16 deletion
+23
-16
net/dccp/ackvec.c
net/dccp/ackvec.c
+17
-10
net/dccp/ackvec.h
net/dccp/ackvec.h
+6
-6
未找到文件。
net/dccp/ackvec.c
浏览文件 @
e4dfd449
...
...
@@ -55,8 +55,8 @@ int dccp_insert_option_ackvec(struct sock *sk, struct sk_buff *skb)
from
=
av
->
dccpav_buf
+
av
->
dccpav_buf_head
;
/* Check if buf_head wraps */
if
(
av
->
dccpav_buf_head
+
len
>
av
->
dccpav_vec_len
)
{
const
u32
tailsize
=
(
av
->
dccpav_vec_len
-
av
->
dccpav_buf_head
)
;
if
(
(
int
)
av
->
dccpav_buf_head
+
len
>
av
->
dccpav_vec_len
)
{
const
u32
tailsize
=
av
->
dccpav_vec_len
-
av
->
dccpav_buf_head
;
memcpy
(
to
,
from
,
tailsize
);
to
+=
tailsize
;
...
...
@@ -93,8 +93,14 @@ int dccp_insert_option_ackvec(struct sock *sk, struct sk_buff *skb)
struct
dccp_ackvec
*
dccp_ackvec_alloc
(
const
unsigned
int
len
,
const
gfp_t
priority
)
{
struct
dccp_ackvec
*
av
=
kmalloc
(
sizeof
(
*
av
)
+
len
,
priority
)
;
struct
dccp_ackvec
*
av
;
BUG_ON
(
len
==
0
);
if
(
len
>
DCCP_MAX_ACKVEC_LEN
)
return
NULL
;
av
=
kmalloc
(
sizeof
(
*
av
)
+
len
,
priority
);
if
(
av
!=
NULL
)
{
av
->
dccpav_buf_len
=
len
;
av
->
dccpav_buf_head
=
...
...
@@ -117,13 +123,13 @@ void dccp_ackvec_free(struct dccp_ackvec *av)
}
static
inline
u8
dccp_ackvec_state
(
const
struct
dccp_ackvec
*
av
,
const
u
nsigned
int
index
)
const
u
8
index
)
{
return
av
->
dccpav_buf
[
index
]
&
DCCP_ACKVEC_STATE_MASK
;
}
static
inline
u8
dccp_ackvec_len
(
const
struct
dccp_ackvec
*
av
,
const
u
nsigned
int
index
)
const
u
8
index
)
{
return
av
->
dccpav_buf
[
index
]
&
DCCP_ACKVEC_LEN_MASK
;
}
...
...
@@ -135,7 +141,7 @@ static inline u8 dccp_ackvec_len(const struct dccp_ackvec *av,
*/
static
inline
int
dccp_ackvec_set_buf_head_state
(
struct
dccp_ackvec
*
av
,
const
unsigned
int
packets
,
const
unsigned
char
state
)
const
unsigned
char
state
)
{
unsigned
int
gap
;
signed
long
new_head
;
...
...
@@ -223,7 +229,7 @@ int dccp_ackvec_add(struct dccp_ackvec *av, const struct sock *sk,
* could reduce the complexity of this scan.)
*/
u64
delta
=
dccp_delta_seqno
(
ackno
,
av
->
dccpav_buf_ackno
);
u
nsigned
int
index
=
av
->
dccpav_buf_head
;
u
8
index
=
av
->
dccpav_buf_head
;
while
(
1
)
{
const
u8
len
=
dccp_ackvec_len
(
av
,
index
);
...
...
@@ -301,9 +307,10 @@ static void dccp_ackvec_throw_away_ack_record(struct dccp_ackvec *av)
* draft-ietf-dccp-spec-11.txt Appendix A. -acme
*/
#if 0
av->dccpav_buf_tail = av->dccpav_ack_ptr + 1;
if (av->dccpav_buf_tail >= av->dccpav_vec_len)
av->dccpav_buf_tail -= av->dccpav_vec_len;
u32 new_buf_tail = av->dccpav_ack_ptr + 1;
if (new_buf_tail >= av->dccpav_vec_len)
new_buf_tail -= av->dccpav_vec_len;
av->dccpav_buf_tail = new_buf_tail;
#endif
av
->
dccpav_vec_len
-=
av
->
dccpav_sent_len
;
}
...
...
net/dccp/ackvec.h
浏览文件 @
e4dfd449
...
...
@@ -54,16 +54,16 @@
* @dccpav_buf - circular buffer of acknowledgeable packets
*/
struct
dccp_ackvec
{
unsigned
int
dccpav_buf_head
;
unsigned
int
dccpav_buf_tail
;
u64
dccpav_buf_ackno
;
u64
dccpav_ack_seqno
;
u64
dccpav_ack_ackno
;
unsigned
int
dccpav_ack_ptr
;
unsigned
int
dccpav_sent_len
;
unsigned
int
dccpav_vec_len
;
unsigned
int
dccpav_buf_len
;
struct
timeval
dccpav_time
;
u8
dccpav_buf_head
;
u8
dccpav_buf_tail
;
u8
dccpav_ack_ptr
;
u8
dccpav_sent_len
;
u8
dccpav_vec_len
;
u8
dccpav_buf_len
;
u8
dccpav_buf_nonce
;
u8
dccpav_ack_nonce
;
u8
dccpav_buf
[
0
];
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录