Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
fcec3456
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看板
提交
fcec3456
编写于
5月 12, 2005
作者:
J
Jeff Garzik
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[netdrvr 8139cp] TSO support
上级
88d7bd8c
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
33 addition
and
17 deletion
+33
-17
drivers/net/8139cp.c
drivers/net/8139cp.c
+33
-17
未找到文件。
drivers/net/8139cp.c
浏览文件 @
fcec3456
...
...
@@ -186,6 +186,9 @@ enum {
RingEnd
=
(
1
<<
30
),
/* End of descriptor ring */
FirstFrag
=
(
1
<<
29
),
/* First segment of a packet */
LastFrag
=
(
1
<<
28
),
/* Final segment of a packet */
LargeSend
=
(
1
<<
27
),
/* TCP Large Send Offload (TSO) */
MSSShift
=
16
,
/* MSS value position */
MSSMask
=
0xfff
,
/* MSS value: 11 bits */
TxError
=
(
1
<<
23
),
/* Tx error summary */
RxError
=
(
1
<<
20
),
/* Rx error summary */
IPCS
=
(
1
<<
18
),
/* Calculate IP checksum */
...
...
@@ -749,10 +752,11 @@ static int cp_start_xmit (struct sk_buff *skb, struct net_device *dev)
{
struct
cp_private
*
cp
=
netdev_priv
(
dev
);
unsigned
entry
;
u32
eor
;
u32
eor
,
flags
;
#if CP_VLAN_TAG_USED
u32
vlan_tag
=
0
;
#endif
int
mss
=
0
;
spin_lock_irq
(
&
cp
->
lock
);
...
...
@@ -772,6 +776,9 @@ static int cp_start_xmit (struct sk_buff *skb, struct net_device *dev)
entry
=
cp
->
tx_head
;
eor
=
(
entry
==
(
CP_TX_RING_SIZE
-
1
))
?
RingEnd
:
0
;
if
(
dev
->
features
&
NETIF_F_TSO
)
mss
=
skb_shinfo
(
skb
)
->
tso_size
;
if
(
skb_shinfo
(
skb
)
->
nr_frags
==
0
)
{
struct
cp_desc
*
txd
=
&
cp
->
tx_ring
[
entry
];
u32
len
;
...
...
@@ -783,21 +790,21 @@ static int cp_start_xmit (struct sk_buff *skb, struct net_device *dev)
txd
->
addr
=
cpu_to_le64
(
mapping
);
wmb
();
if
(
skb
->
ip_summed
==
CHECKSUM_HW
)
{
flags
=
eor
|
len
|
DescOwn
|
FirstFrag
|
LastFrag
;
if
(
mss
)
flags
|=
LargeSend
|
((
mss
&
MSSMask
)
<<
MSSShift
);
else
if
(
skb
->
ip_summed
==
CHECKSUM_HW
)
{
const
struct
iphdr
*
ip
=
skb
->
nh
.
iph
;
if
(
ip
->
protocol
==
IPPROTO_TCP
)
txd
->
opts1
=
cpu_to_le32
(
eor
|
len
|
DescOwn
|
FirstFrag
|
LastFrag
|
IPCS
|
TCPCS
);
flags
|=
IPCS
|
TCPCS
;
else
if
(
ip
->
protocol
==
IPPROTO_UDP
)
txd
->
opts1
=
cpu_to_le32
(
eor
|
len
|
DescOwn
|
FirstFrag
|
LastFrag
|
IPCS
|
UDPCS
);
flags
|=
IPCS
|
UDPCS
;
else
BUG
();
}
else
txd
->
opts1
=
cpu_to_le32
(
eor
|
len
|
DescOwn
|
FirstFrag
|
LastFrag
);
}
txd
->
opts1
=
cpu_to_le32
(
flags
);
wmb
();
cp
->
tx_skb
[
entry
].
skb
=
skb
;
...
...
@@ -836,16 +843,19 @@ static int cp_start_xmit (struct sk_buff *skb, struct net_device *dev)
len
,
PCI_DMA_TODEVICE
);
eor
=
(
entry
==
(
CP_TX_RING_SIZE
-
1
))
?
RingEnd
:
0
;
if
(
skb
->
ip_summed
==
CHECKSUM_HW
)
{
ctrl
=
eor
|
len
|
DescOwn
|
IPCS
;
ctrl
=
eor
|
len
|
DescOwn
;
if
(
mss
)
ctrl
|=
LargeSend
|
((
mss
&
MSSMask
)
<<
MSSShift
);
else
if
(
skb
->
ip_summed
==
CHECKSUM_HW
)
{
if
(
ip
->
protocol
==
IPPROTO_TCP
)
ctrl
|=
TCPCS
;
ctrl
|=
IPCS
|
TCPCS
;
else
if
(
ip
->
protocol
==
IPPROTO_UDP
)
ctrl
|=
UDPCS
;
ctrl
|=
IPCS
|
UDPCS
;
else
BUG
();
}
else
ctrl
=
eor
|
len
|
DescOwn
;
}
if
(
frag
==
skb_shinfo
(
skb
)
->
nr_frags
-
1
)
ctrl
|=
LastFrag
;
...
...
@@ -1538,6 +1548,8 @@ static struct ethtool_ops cp_ethtool_ops = {
.
set_tx_csum
=
ethtool_op_set_tx_csum
,
/* local! */
.
get_sg
=
ethtool_op_get_sg
,
.
set_sg
=
ethtool_op_set_sg
,
.
get_tso
=
ethtool_op_get_tso
,
.
set_tso
=
ethtool_op_set_tso
,
.
get_regs
=
cp_get_regs
,
.
get_wol
=
cp_get_wol
,
.
set_wol
=
cp_set_wol
,
...
...
@@ -1768,6 +1780,10 @@ static int cp_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
if
(
pci_using_dac
)
dev
->
features
|=
NETIF_F_HIGHDMA
;
#if 0 /* disabled by default until verified */
dev->features |= NETIF_F_TSO;
#endif
dev
->
irq
=
pdev
->
irq
;
rc
=
register_netdev
(
dev
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录