Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
b6211ae7
K
Kernel
项目概览
openeuler
/
Kernel
1 年多 前同步成功
通知
8
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
b6211ae7
编写于
5月 28, 2009
作者:
D
David S. Miller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
atm: Use SKB queue and list helpers instead of doing it by-hand.
Signed-off-by:
N
David S. Miller
<
davem@davemloft.net
>
上级
46c37672
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
17 addition
and
36 deletion
+17
-36
net/atm/br2684.c
net/atm/br2684.c
+9
-17
net/atm/clip.c
net/atm/clip.c
+8
-19
未找到文件。
net/atm/br2684.c
浏览文件 @
b6211ae7
...
@@ -445,9 +445,10 @@ static void br2684_push(struct atm_vcc *atmvcc, struct sk_buff *skb)
...
@@ -445,9 +445,10 @@ static void br2684_push(struct atm_vcc *atmvcc, struct sk_buff *skb)
*/
*/
static
int
br2684_regvcc
(
struct
atm_vcc
*
atmvcc
,
void
__user
*
arg
)
static
int
br2684_regvcc
(
struct
atm_vcc
*
atmvcc
,
void
__user
*
arg
)
{
{
struct
sk_buff_head
queue
;
int
err
;
int
err
;
struct
br2684_vcc
*
brvcc
;
struct
br2684_vcc
*
brvcc
;
struct
sk_buff
*
skb
;
struct
sk_buff
*
skb
,
*
tmp
;
struct
sk_buff_head
*
rq
;
struct
sk_buff_head
*
rq
;
struct
br2684_dev
*
brdev
;
struct
br2684_dev
*
brdev
;
struct
net_device
*
net_dev
;
struct
net_device
*
net_dev
;
...
@@ -505,29 +506,20 @@ static int br2684_regvcc(struct atm_vcc *atmvcc, void __user * arg)
...
@@ -505,29 +506,20 @@ static int br2684_regvcc(struct atm_vcc *atmvcc, void __user * arg)
barrier
();
barrier
();
atmvcc
->
push
=
br2684_push
;
atmvcc
->
push
=
br2684_push
;
__skb_queue_head_init
(
&
queue
);
rq
=
&
sk_atm
(
atmvcc
)
->
sk_receive_queue
;
rq
=
&
sk_atm
(
atmvcc
)
->
sk_receive_queue
;
spin_lock_irqsave
(
&
rq
->
lock
,
flags
);
spin_lock_irqsave
(
&
rq
->
lock
,
flags
);
if
(
skb_queue_empty
(
rq
))
{
skb_queue_splice_init
(
rq
,
&
queue
);
skb
=
NULL
;
}
else
{
/* NULL terminate the list. */
rq
->
prev
->
next
=
NULL
;
skb
=
rq
->
next
;
}
rq
->
prev
=
rq
->
next
=
(
struct
sk_buff
*
)
rq
;
rq
->
qlen
=
0
;
spin_unlock_irqrestore
(
&
rq
->
lock
,
flags
);
spin_unlock_irqrestore
(
&
rq
->
lock
,
flags
);
while
(
skb
)
{
skb_queue_walk_safe
(
&
queue
,
skb
,
tmp
)
{
struct
sk_buff
*
next
=
skb
->
next
;
struct
net_device
*
dev
=
skb
->
dev
;
skb
->
next
=
skb
->
prev
=
NULL
;
dev
->
stats
.
rx_bytes
-=
skb
->
len
;
br2684_push
(
atmvcc
,
skb
);
dev
->
stats
.
rx_packets
--
;
skb
->
dev
->
stats
.
rx_bytes
-=
skb
->
len
;
skb
->
dev
->
stats
.
rx_packets
--
;
skb
=
next
;
br2684_push
(
atmvcc
,
skb
)
;
}
}
__module_get
(
THIS_MODULE
);
__module_get
(
THIS_MODULE
);
return
0
;
return
0
;
...
...
net/atm/clip.c
浏览文件 @
b6211ae7
...
@@ -445,9 +445,9 @@ static int clip_start_xmit(struct sk_buff *skb, struct net_device *dev)
...
@@ -445,9 +445,9 @@ static int clip_start_xmit(struct sk_buff *skb, struct net_device *dev)
static
int
clip_mkip
(
struct
atm_vcc
*
vcc
,
int
timeout
)
static
int
clip_mkip
(
struct
atm_vcc
*
vcc
,
int
timeout
)
{
{
struct
sk_buff_head
*
rq
,
queue
;
struct
clip_vcc
*
clip_vcc
;
struct
clip_vcc
*
clip_vcc
;
struct
sk_buff
*
skb
;
struct
sk_buff
*
skb
,
*
tmp
;
struct
sk_buff_head
*
rq
;
unsigned
long
flags
;
unsigned
long
flags
;
if
(
!
vcc
->
push
)
if
(
!
vcc
->
push
)
...
@@ -469,39 +469,28 @@ static int clip_mkip(struct atm_vcc *vcc, int timeout)
...
@@ -469,39 +469,28 @@ static int clip_mkip(struct atm_vcc *vcc, int timeout)
vcc
->
push
=
clip_push
;
vcc
->
push
=
clip_push
;
vcc
->
pop
=
clip_pop
;
vcc
->
pop
=
clip_pop
;
__skb_queue_head_init
(
&
queue
);
rq
=
&
sk_atm
(
vcc
)
->
sk_receive_queue
;
rq
=
&
sk_atm
(
vcc
)
->
sk_receive_queue
;
spin_lock_irqsave
(
&
rq
->
lock
,
flags
);
spin_lock_irqsave
(
&
rq
->
lock
,
flags
);
if
(
skb_queue_empty
(
rq
))
{
skb_queue_splice_init
(
rq
,
&
queue
);
skb
=
NULL
;
}
else
{
/* NULL terminate the list. */
rq
->
prev
->
next
=
NULL
;
skb
=
rq
->
next
;
}
rq
->
prev
=
rq
->
next
=
(
struct
sk_buff
*
)
rq
;
rq
->
qlen
=
0
;
spin_unlock_irqrestore
(
&
rq
->
lock
,
flags
);
spin_unlock_irqrestore
(
&
rq
->
lock
,
flags
);
/* re-process everything received between connection setup and MKIP */
/* re-process everything received between connection setup and MKIP */
while
(
skb
)
{
skb_queue_walk_safe
(
&
queue
,
skb
,
tmp
)
{
struct
sk_buff
*
next
=
skb
->
next
;
skb
->
next
=
skb
->
prev
=
NULL
;
if
(
!
clip_devs
)
{
if
(
!
clip_devs
)
{
atm_return
(
vcc
,
skb
->
truesize
);
atm_return
(
vcc
,
skb
->
truesize
);
kfree_skb
(
skb
);
kfree_skb
(
skb
);
}
else
{
}
else
{
struct
net_device
*
dev
=
skb
->
dev
;
unsigned
int
len
=
skb
->
len
;
unsigned
int
len
=
skb
->
len
;
skb_get
(
skb
);
skb_get
(
skb
);
clip_push
(
vcc
,
skb
);
clip_push
(
vcc
,
skb
);
skb
->
dev
->
stats
.
rx_packets
--
;
dev
->
stats
.
rx_packets
--
;
skb
->
dev
->
stats
.
rx_bytes
-=
len
;
dev
->
stats
.
rx_bytes
-=
len
;
kfree_skb
(
skb
);
kfree_skb
(
skb
);
}
}
skb
=
next
;
}
}
return
0
;
return
0
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录