Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
970565bb
K
Kernel
项目概览
openeuler
/
Kernel
大约 1 年 前同步成功
通知
6
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
970565bb
编写于
7月 08, 2008
作者:
D
David S. Miller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
netdev: Move gso_skb into netdev_queue.
Signed-off-by:
N
David S. Miller
<
davem@davemloft.net
>
上级
c2aa2885
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
24 addition
and
22 deletion
+24
-22
include/linux/netdevice.h
include/linux/netdevice.h
+1
-3
net/sched/sch_generic.c
net/sched/sch_generic.c
+23
-19
未找到文件。
include/linux/netdevice.h
浏览文件 @
970565bb
...
...
@@ -452,6 +452,7 @@ struct netdev_queue {
spinlock_t
lock
;
struct
net_device
*
dev
;
struct
Qdisc
*
qdisc
;
struct
sk_buff
*
gso_skb
;
struct
Qdisc
*
qdisc_sleeping
;
struct
list_head
qdisc_list
;
struct
netdev_queue
*
next_sched
;
...
...
@@ -635,9 +636,6 @@ struct net_device
struct
netdev_queue
tx_queue
____cacheline_aligned_in_smp
;
unsigned
long
tx_queue_len
;
/* Max frames per queue allowed */
/* Partially transmitted GSO packet. */
struct
sk_buff
*
gso_skb
;
/*
* One part is mostly used on xmit path (device)
*/
...
...
net/sched/sch_generic.c
浏览文件 @
970565bb
...
...
@@ -63,10 +63,11 @@ static inline int qdisc_qlen(struct Qdisc *q)
}
static
inline
int
dev_requeue_skb
(
struct
sk_buff
*
skb
,
struct
net_device
*
dev
,
struct
netdev_queue
*
dev_queue
,
struct
Qdisc
*
q
)
{
if
(
unlikely
(
skb
->
next
))
dev
->
gso_skb
=
skb
;
dev
_queue
->
gso_skb
=
skb
;
else
q
->
ops
->
requeue
(
skb
,
q
);
...
...
@@ -75,12 +76,13 @@ static inline int dev_requeue_skb(struct sk_buff *skb, struct net_device *dev,
}
static
inline
struct
sk_buff
*
dev_dequeue_skb
(
struct
net_device
*
dev
,
struct
netdev_queue
*
dev_queue
,
struct
Qdisc
*
q
)
{
struct
sk_buff
*
skb
;
if
((
skb
=
dev
->
gso_skb
))
dev
->
gso_skb
=
NULL
;
if
((
skb
=
dev
_queue
->
gso_skb
))
dev
_queue
->
gso_skb
=
NULL
;
else
skb
=
q
->
dequeue
(
q
);
...
...
@@ -89,6 +91,7 @@ static inline struct sk_buff *dev_dequeue_skb(struct net_device *dev,
static
inline
int
handle_dev_cpu_collision
(
struct
sk_buff
*
skb
,
struct
net_device
*
dev
,
struct
netdev_queue
*
dev_queue
,
struct
Qdisc
*
q
)
{
int
ret
;
...
...
@@ -111,7 +114,7 @@ static inline int handle_dev_cpu_collision(struct sk_buff *skb,
* some time.
*/
__get_cpu_var
(
netdev_rx_stat
).
cpu_collision
++
;
ret
=
dev_requeue_skb
(
skb
,
dev
,
q
);
ret
=
dev_requeue_skb
(
skb
,
dev
,
dev_queue
,
q
);
}
return
ret
;
...
...
@@ -144,7 +147,7 @@ static inline int qdisc_restart(struct net_device *dev)
int
ret
=
NETDEV_TX_BUSY
;
/* Dequeue packet */
if
(
unlikely
((
skb
=
dev_dequeue_skb
(
dev
,
q
))
==
NULL
))
if
(
unlikely
((
skb
=
dev_dequeue_skb
(
dev
,
txq
,
q
))
==
NULL
))
return
0
;
...
...
@@ -167,7 +170,7 @@ static inline int qdisc_restart(struct net_device *dev)
case
NETDEV_TX_LOCKED
:
/* Driver try lock failed */
ret
=
handle_dev_cpu_collision
(
skb
,
dev
,
q
);
ret
=
handle_dev_cpu_collision
(
skb
,
dev
,
txq
,
q
);
break
;
default:
...
...
@@ -176,7 +179,7 @@ static inline int qdisc_restart(struct net_device *dev)
printk
(
KERN_WARNING
"BUG %s code %d qlen %d
\n
"
,
dev
->
name
,
ret
,
q
->
q
.
qlen
);
ret
=
dev_requeue_skb
(
skb
,
dev
,
q
);
ret
=
dev_requeue_skb
(
skb
,
dev
,
txq
,
q
);
break
;
}
...
...
@@ -578,31 +581,32 @@ void dev_activate(struct net_device *dev)
spin_unlock_bh
(
&
txq
->
lock
);
}
static
void
dev_deactivate_queue
(
struct
net_device
*
dev
,
struct
netdev_queue
*
dev_queue
,
static
void
dev_deactivate_queue
(
struct
netdev_queue
*
dev_queue
,
struct
Qdisc
*
qdisc_default
)
{
struct
Qdisc
*
qdisc
=
dev_queue
->
qdisc
;
struct
Qdisc
*
qdisc
;
struct
sk_buff
*
skb
;
spin_lock_bh
(
&
dev_queue
->
lock
);
qdisc
=
dev_queue
->
qdisc
;
if
(
qdisc
)
{
dev_queue
->
qdisc
=
qdisc_default
;
qdisc_reset
(
qdisc
);
}
skb
=
dev_queue
->
gso_skb
;
dev_queue
->
gso_skb
=
NULL
;
spin_unlock_bh
(
&
dev_queue
->
lock
);
kfree_skb
(
skb
);
}
void
dev_deactivate
(
struct
net_device
*
dev
)
{
struct
sk_buff
*
skb
;
int
running
;
spin_lock_bh
(
&
dev
->
tx_queue
.
lock
);
dev_deactivate_queue
(
dev
,
&
dev
->
tx_queue
,
&
noop_qdisc
);
skb
=
dev
->
gso_skb
;
dev
->
gso_skb
=
NULL
;
spin_unlock_bh
(
&
dev
->
tx_queue
.
lock
);
kfree_skb
(
skb
);
dev_deactivate_queue
(
&
dev
->
tx_queue
,
&
noop_qdisc
);
dev_watchdog_down
(
dev
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录