Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
kernel_linux
提交
1d248b1c
K
kernel_linux
项目概览
OpenHarmony
/
kernel_linux
上一次同步 3 年多
通知
13
Star
8
Fork
2
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
kernel_linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
1d248b1c
编写于
7月 03, 2012
作者:
D
David S. Miller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
net: Pass neighbours and dest address into NETEVENT_REDIRECT events.
Signed-off-by:
N
David S. Miller
<
davem@davemloft.net
>
上级
fccd7d5c
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
19 addition
and
15 deletion
+19
-15
drivers/net/ethernet/chelsio/cxgb3/cxgb3_offload.c
drivers/net/ethernet/chelsio/cxgb3/cxgb3_offload.c
+9
-14
include/net/netevent.h
include/net/netevent.h
+4
-0
net/ipv6/route.c
net/ipv6/route.c
+6
-1
未找到文件。
drivers/net/ethernet/chelsio/cxgb3/cxgb3_offload.c
浏览文件 @
1d248b1c
...
...
@@ -62,7 +62,8 @@ static const unsigned int MAX_ATIDS = 64 * 1024;
static
const
unsigned
int
ATID_BASE
=
0x10000
;
static
void
cxgb_neigh_update
(
struct
neighbour
*
neigh
);
static
void
cxgb_redirect
(
struct
dst_entry
*
old
,
struct
dst_entry
*
new
);
static
void
cxgb_redirect
(
struct
dst_entry
*
old
,
struct
neighbour
*
old_neigh
,
struct
dst_entry
*
new
,
struct
neighbour
*
new_neigh
);
static
inline
int
offload_activated
(
struct
t3cdev
*
tdev
)
{
...
...
@@ -968,8 +969,9 @@ static int nb_callback(struct notifier_block *self, unsigned long event,
}
case
(
NETEVENT_REDIRECT
):{
struct
netevent_redirect
*
nr
=
ctx
;
cxgb_redirect
(
nr
->
old
,
nr
->
new
);
cxgb_neigh_update
(
dst_get_neighbour_noref
(
nr
->
new
));
cxgb_redirect
(
nr
->
old
,
nr
->
old_neigh
,
nr
->
new
,
nr
->
new_neigh
);
cxgb_neigh_update
(
nr
->
new_neigh
);
break
;
}
default:
...
...
@@ -1107,10 +1109,10 @@ static void set_l2t_ix(struct t3cdev *tdev, u32 tid, struct l2t_entry *e)
tdev
->
send
(
tdev
,
skb
);
}
static
void
cxgb_redirect
(
struct
dst_entry
*
old
,
struct
dst_entry
*
new
)
static
void
cxgb_redirect
(
struct
dst_entry
*
old
,
struct
neighbour
*
old_neigh
,
struct
dst_entry
*
new
,
struct
neighbour
*
new_neigh
)
{
struct
net_device
*
olddev
,
*
newdev
;
struct
neighbour
*
n
;
struct
tid_info
*
ti
;
struct
t3cdev
*
tdev
;
u32
tid
;
...
...
@@ -1118,15 +1120,8 @@ static void cxgb_redirect(struct dst_entry *old, struct dst_entry *new)
struct
l2t_entry
*
e
;
struct
t3c_tid_entry
*
te
;
n
=
dst_get_neighbour_noref
(
old
);
if
(
!
n
)
return
;
olddev
=
n
->
dev
;
n
=
dst_get_neighbour_noref
(
new
);
if
(
!
n
)
return
;
newdev
=
n
->
dev
;
olddev
=
old_neigh
->
dev
;
newdev
=
new_neigh
->
dev
;
if
(
!
is_offloading
(
olddev
))
return
;
...
...
include/net/netevent.h
浏览文件 @
1d248b1c
...
...
@@ -12,10 +12,14 @@
*/
struct
dst_entry
;
struct
neighbour
;
struct
netevent_redirect
{
struct
dst_entry
*
old
;
struct
neighbour
*
old_neigh
;
struct
dst_entry
*
new
;
struct
neighbour
*
new_neigh
;
const
void
*
daddr
;
};
enum
netevent_notif_type
{
...
...
net/ipv6/route.c
浏览文件 @
1d248b1c
...
...
@@ -1687,6 +1687,7 @@ void rt6_redirect(const struct in6_addr *dest, const struct in6_addr *src,
struct
rt6_info
*
rt
,
*
nrt
=
NULL
;
struct
netevent_redirect
netevent
;
struct
net
*
net
=
dev_net
(
neigh
->
dev
);
struct
neighbour
*
old_neigh
;
rt
=
ip6_route_redirect
(
dest
,
src
,
saddr
,
neigh
->
dev
);
...
...
@@ -1714,7 +1715,8 @@ void rt6_redirect(const struct in6_addr *dest, const struct in6_addr *src,
dst_confirm
(
&
rt
->
dst
);
/* Duplicate redirect: silently ignore. */
if
(
neigh
==
dst_get_neighbour_noref_raw
(
&
rt
->
dst
))
old_neigh
=
dst_get_neighbour_noref_raw
(
&
rt
->
dst
);
if
(
neigh
==
old_neigh
)
goto
out
;
nrt
=
ip6_rt_copy
(
rt
,
dest
);
...
...
@@ -1732,7 +1734,10 @@ void rt6_redirect(const struct in6_addr *dest, const struct in6_addr *src,
goto
out
;
netevent
.
old
=
&
rt
->
dst
;
netevent
.
old_neigh
=
old_neigh
;
netevent
.
new
=
&
nrt
->
dst
;
netevent
.
new_neigh
=
neigh
;
netevent
.
daddr
=
dest
;
call_netevent_notifiers
(
NETEVENT_REDIRECT
,
&
netevent
);
if
(
rt
->
rt6i_flags
&
RTF_CACHE
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录