Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
f6e63cfb
cloud-kernel
项目概览
openanolis
/
cloud-kernel
1 年多 前同步成功
通知
160
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看板
提交
f6e63cfb
编写于
10月 04, 2005
作者:
L
Linus Torvalds
浏览文件
操作
浏览文件
下载
差异文件
Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
上级
fad1c45c
e6308be8
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
24 addition
and
3 deletion
+24
-3
net/ipv4/fib_trie.c
net/ipv4/fib_trie.c
+21
-2
net/ipv6/udp.c
net/ipv6/udp.c
+3
-1
未找到文件。
net/ipv4/fib_trie.c
浏览文件 @
f6e63cfb
...
@@ -286,6 +286,8 @@ static inline void check_tnode(const struct tnode *tn)
...
@@ -286,6 +286,8 @@ static inline void check_tnode(const struct tnode *tn)
static
int
halve_threshold
=
25
;
static
int
halve_threshold
=
25
;
static
int
inflate_threshold
=
50
;
static
int
inflate_threshold
=
50
;
static
int
halve_threshold_root
=
15
;
static
int
inflate_threshold_root
=
25
;
static
void
__alias_free_mem
(
struct
rcu_head
*
head
)
static
void
__alias_free_mem
(
struct
rcu_head
*
head
)
...
@@ -449,6 +451,8 @@ static struct node *resize(struct trie *t, struct tnode *tn)
...
@@ -449,6 +451,8 @@ static struct node *resize(struct trie *t, struct tnode *tn)
int
i
;
int
i
;
int
err
=
0
;
int
err
=
0
;
struct
tnode
*
old_tn
;
struct
tnode
*
old_tn
;
int
inflate_threshold_use
;
int
halve_threshold_use
;
if
(
!
tn
)
if
(
!
tn
)
return
NULL
;
return
NULL
;
...
@@ -541,10 +545,17 @@ static struct node *resize(struct trie *t, struct tnode *tn)
...
@@ -541,10 +545,17 @@ static struct node *resize(struct trie *t, struct tnode *tn)
check_tnode
(
tn
);
check_tnode
(
tn
);
/* Keep root node larger */
if
(
!
tn
->
parent
)
inflate_threshold_use
=
inflate_threshold_root
;
else
inflate_threshold_use
=
inflate_threshold
;
err
=
0
;
err
=
0
;
while
((
tn
->
full_children
>
0
&&
while
((
tn
->
full_children
>
0
&&
50
*
(
tn
->
full_children
+
tnode_child_length
(
tn
)
-
tn
->
empty_children
)
>=
50
*
(
tn
->
full_children
+
tnode_child_length
(
tn
)
-
tn
->
empty_children
)
>=
inflate_threshold
*
tnode_child_length
(
tn
)))
{
inflate_threshold
_use
*
tnode_child_length
(
tn
)))
{
old_tn
=
tn
;
old_tn
=
tn
;
tn
=
inflate
(
t
,
tn
);
tn
=
inflate
(
t
,
tn
);
...
@@ -564,10 +575,18 @@ static struct node *resize(struct trie *t, struct tnode *tn)
...
@@ -564,10 +575,18 @@ static struct node *resize(struct trie *t, struct tnode *tn)
* node is above threshold.
* node is above threshold.
*/
*/
/* Keep root node larger */
if
(
!
tn
->
parent
)
halve_threshold_use
=
halve_threshold_root
;
else
halve_threshold_use
=
halve_threshold
;
err
=
0
;
err
=
0
;
while
(
tn
->
bits
>
1
&&
while
(
tn
->
bits
>
1
&&
100
*
(
tnode_child_length
(
tn
)
-
tn
->
empty_children
)
<
100
*
(
tnode_child_length
(
tn
)
-
tn
->
empty_children
)
<
halve_threshold
*
tnode_child_length
(
tn
))
{
halve_threshold
_use
*
tnode_child_length
(
tn
))
{
old_tn
=
tn
;
old_tn
=
tn
;
tn
=
halve
(
t
,
tn
);
tn
=
halve
(
t
,
tn
);
...
...
net/ipv6/udp.c
浏览文件 @
f6e63cfb
...
@@ -99,7 +99,7 @@ static int udp_v6_get_port(struct sock *sk, unsigned short snum)
...
@@ -99,7 +99,7 @@ static int udp_v6_get_port(struct sock *sk, unsigned short snum)
next:
;
next:
;
}
}
result
=
best
;
result
=
best
;
for
(
;;
result
+=
UDP_HTABLE_SIZE
)
{
for
(
i
=
0
;
i
<
(
1
<<
16
)
/
UDP_HTABLE_SIZE
;
i
++
,
result
+=
UDP_HTABLE_SIZE
)
{
if
(
result
>
sysctl_local_port_range
[
1
])
if
(
result
>
sysctl_local_port_range
[
1
])
result
=
sysctl_local_port_range
[
0
]
result
=
sysctl_local_port_range
[
0
]
+
((
result
-
sysctl_local_port_range
[
0
])
&
+
((
result
-
sysctl_local_port_range
[
0
])
&
...
@@ -107,6 +107,8 @@ static int udp_v6_get_port(struct sock *sk, unsigned short snum)
...
@@ -107,6 +107,8 @@ static int udp_v6_get_port(struct sock *sk, unsigned short snum)
if
(
!
udp_lport_inuse
(
result
))
if
(
!
udp_lport_inuse
(
result
))
break
;
break
;
}
}
if
(
i
>=
(
1
<<
16
)
/
UDP_HTABLE_SIZE
)
goto
fail
;
gotit:
gotit:
udp_port_rover
=
snum
=
result
;
udp_port_rover
=
snum
=
result
;
}
else
{
}
else
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录