Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
dee9f4bc
R
raspberrypi-kernel
项目概览
openeuler
/
raspberrypi-kernel
通知
13
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
raspberrypi-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
dee9f4bc
编写于
2月 22, 2011
作者:
D
David S. Miller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
net: Make flow cache paths use a const struct flowi.
Signed-off-by:
N
David S. Miller
<
davem@davemloft.net
>
上级
4ca2e685
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
23 addition
and
18 deletion
+23
-18
include/net/dst.h
include/net/dst.h
+6
-4
include/net/flow.h
include/net/flow.h
+2
-2
net/core/flow.c
net/core/flow.c
+7
-7
net/xfrm/xfrm_policy.c
net/xfrm/xfrm_policy.c
+8
-5
未找到文件。
include/net/dst.h
浏览文件 @
dee9f4bc
...
...
@@ -428,20 +428,22 @@ enum {
struct
flowi
;
#ifndef CONFIG_XFRM
static
inline
int
xfrm_lookup
(
struct
net
*
net
,
struct
dst_entry
**
dst_p
,
struct
flowi
*
fl
,
struct
sock
*
sk
,
int
flags
)
const
struct
flowi
*
fl
,
struct
sock
*
sk
,
int
flags
)
{
return
0
;
}
static
inline
int
__xfrm_lookup
(
struct
net
*
net
,
struct
dst_entry
**
dst_p
,
struct
flowi
*
fl
,
struct
sock
*
sk
,
int
flags
)
const
struct
flowi
*
fl
,
struct
sock
*
sk
,
int
flags
)
{
return
0
;
}
#else
extern
int
xfrm_lookup
(
struct
net
*
net
,
struct
dst_entry
**
dst_p
,
struct
flowi
*
fl
,
struct
sock
*
sk
,
int
flags
);
const
struct
flowi
*
fl
,
struct
sock
*
sk
,
int
flags
);
extern
int
__xfrm_lookup
(
struct
net
*
net
,
struct
dst_entry
**
dst_p
,
struct
flowi
*
fl
,
struct
sock
*
sk
,
int
flags
);
const
struct
flowi
*
fl
,
struct
sock
*
sk
,
int
flags
);
#endif
#endif
...
...
include/net/flow.h
浏览文件 @
dee9f4bc
...
...
@@ -102,11 +102,11 @@ struct flow_cache_ops {
};
typedef
struct
flow_cache_object
*
(
*
flow_resolve_t
)(
struct
net
*
net
,
struct
flowi
*
key
,
u16
family
,
struct
net
*
net
,
const
struct
flowi
*
key
,
u16
family
,
u8
dir
,
struct
flow_cache_object
*
oldobj
,
void
*
ctx
);
extern
struct
flow_cache_object
*
flow_cache_lookup
(
struct
net
*
net
,
struct
flowi
*
key
,
u16
family
,
struct
net
*
net
,
const
struct
flowi
*
key
,
u16
family
,
u8
dir
,
flow_resolve_t
resolver
,
void
*
ctx
);
extern
void
flow_cache_flush
(
void
);
...
...
net/core/flow.c
浏览文件 @
dee9f4bc
...
...
@@ -172,9 +172,9 @@ static void flow_new_hash_rnd(struct flow_cache *fc,
static
u32
flow_hash_code
(
struct
flow_cache
*
fc
,
struct
flow_cache_percpu
*
fcp
,
struct
flowi
*
key
)
const
struct
flowi
*
key
)
{
u32
*
k
=
(
u32
*
)
key
;
const
u32
*
k
=
(
const
u32
*
)
key
;
return
jhash2
(
k
,
(
sizeof
(
*
key
)
/
sizeof
(
u32
)),
fcp
->
hash_rnd
)
&
(
flow_cache_hash_size
(
fc
)
-
1
);
...
...
@@ -186,17 +186,17 @@ typedef unsigned long flow_compare_t;
* important assumptions that we can here, such as alignment and
* constant size.
*/
static
int
flow_key_compare
(
struct
flowi
*
key1
,
struct
flowi
*
key2
)
static
int
flow_key_compare
(
const
struct
flowi
*
key1
,
const
struct
flowi
*
key2
)
{
flow_compare_t
*
k1
,
*
k1_lim
,
*
k2
;
const
flow_compare_t
*
k1
,
*
k1_lim
,
*
k2
;
const
int
n_elem
=
sizeof
(
struct
flowi
)
/
sizeof
(
flow_compare_t
);
BUILD_BUG_ON
(
sizeof
(
struct
flowi
)
%
sizeof
(
flow_compare_t
));
k1
=
(
flow_compare_t
*
)
key1
;
k1
=
(
const
flow_compare_t
*
)
key1
;
k1_lim
=
k1
+
n_elem
;
k2
=
(
flow_compare_t
*
)
key2
;
k2
=
(
const
flow_compare_t
*
)
key2
;
do
{
if
(
*
k1
++
!=
*
k2
++
)
...
...
@@ -207,7 +207,7 @@ static int flow_key_compare(struct flowi *key1, struct flowi *key2)
}
struct
flow_cache_object
*
flow_cache_lookup
(
struct
net
*
net
,
struct
flowi
*
key
,
u16
family
,
u8
dir
,
flow_cache_lookup
(
struct
net
*
net
,
const
struct
flowi
*
key
,
u16
family
,
u8
dir
,
flow_resolve_t
resolver
,
void
*
ctx
)
{
struct
flow_cache
*
fc
=
&
flow_cache_global
;
...
...
net/xfrm/xfrm_policy.c
浏览文件 @
dee9f4bc
...
...
@@ -954,7 +954,7 @@ __xfrm_policy_lookup(struct net *net, const struct flowi *fl, u16 family, u8 dir
}
static
struct
flow_cache_object
*
xfrm_policy_lookup
(
struct
net
*
net
,
struct
flowi
*
fl
,
u16
family
,
xfrm_policy_lookup
(
struct
net
*
net
,
const
struct
flowi
*
fl
,
u16
family
,
u8
dir
,
struct
flow_cache_object
*
old_obj
,
void
*
ctx
)
{
struct
xfrm_policy
*
pol
;
...
...
@@ -990,7 +990,8 @@ static inline int policy_to_flow_dir(int dir)
}
}
static
struct
xfrm_policy
*
xfrm_sk_policy_lookup
(
struct
sock
*
sk
,
int
dir
,
struct
flowi
*
fl
)
static
struct
xfrm_policy
*
xfrm_sk_policy_lookup
(
struct
sock
*
sk
,
int
dir
,
const
struct
flowi
*
fl
)
{
struct
xfrm_policy
*
pol
;
...
...
@@ -1629,7 +1630,7 @@ xfrm_resolve_and_create_bundle(struct xfrm_policy **pols, int num_pols,
}
static
struct
flow_cache_object
*
xfrm_bundle_lookup
(
struct
net
*
net
,
struct
flowi
*
fl
,
u16
family
,
u8
dir
,
xfrm_bundle_lookup
(
struct
net
*
net
,
const
struct
flowi
*
fl
,
u16
family
,
u8
dir
,
struct
flow_cache_object
*
oldflo
,
void
*
ctx
)
{
struct
dst_entry
*
dst_orig
=
(
struct
dst_entry
*
)
ctx
;
...
...
@@ -1733,7 +1734,8 @@ xfrm_bundle_lookup(struct net *net, struct flowi *fl, u16 family, u8 dir,
* At the moment we eat a raw IP route. Mostly to speed up lookups
* on interfaces with disabled IPsec.
*/
int
__xfrm_lookup
(
struct
net
*
net
,
struct
dst_entry
**
dst_p
,
struct
flowi
*
fl
,
int
__xfrm_lookup
(
struct
net
*
net
,
struct
dst_entry
**
dst_p
,
const
struct
flowi
*
fl
,
struct
sock
*
sk
,
int
flags
)
{
struct
xfrm_policy
*
pols
[
XFRM_POLICY_TYPE_MAX
];
...
...
@@ -1889,7 +1891,8 @@ int __xfrm_lookup(struct net *net, struct dst_entry **dst_p, struct flowi *fl,
}
EXPORT_SYMBOL
(
__xfrm_lookup
);
int
xfrm_lookup
(
struct
net
*
net
,
struct
dst_entry
**
dst_p
,
struct
flowi
*
fl
,
int
xfrm_lookup
(
struct
net
*
net
,
struct
dst_entry
**
dst_p
,
const
struct
flowi
*
fl
,
struct
sock
*
sk
,
int
flags
)
{
int
err
=
__xfrm_lookup
(
net
,
dst_p
,
fl
,
sk
,
flags
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录