Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
8188258c
Commit
8188258c
authored
Sep 18, 2002
by
David S. Miller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[TIGON3]: TSO fixes, but still disabled because the performance is dreadful.
parent
1bad36a7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
51 additions
and
11 deletions
+51
-11
drivers/net/tg3.c
drivers/net/tg3.c
+51
-11
No files found.
drivers/net/tg3.c
View file @
8188258c
...
@@ -23,6 +23,8 @@
...
@@ -23,6 +23,8 @@
#include <linux/ethtool.h>
#include <linux/ethtool.h>
#include <linux/mii.h>
#include <linux/mii.h>
#include <linux/if_vlan.h>
#include <linux/if_vlan.h>
#include <linux/ip.h>
#include <linux/tcp.h>
#include <asm/system.h>
#include <asm/system.h>
#include <asm/io.h>
#include <asm/io.h>
...
@@ -49,7 +51,9 @@
...
@@ -49,7 +51,9 @@
#endif
#endif
#ifdef NETIF_F_TSO
#ifdef NETIF_F_TSO
/* XXX some bug in tso firmware hangs tx cpu, disabled until fixed */
/* XXX Works but still disabled, decreases TCP performance to 7MB/sec even
* XXX over gigabit.
*/
#define TG3_DO_TSO 0
#define TG3_DO_TSO 0
#else
#else
#define TG3_DO_TSO 0
#define TG3_DO_TSO 0
...
@@ -2390,9 +2394,20 @@ static int tg3_start_xmit_4gbug(struct sk_buff *skb, struct net_device *dev)
...
@@ -2390,9 +2394,20 @@ static int tg3_start_xmit_4gbug(struct sk_buff *skb, struct net_device *dev)
if
(
skb
->
ip_summed
==
CHECKSUM_HW
)
if
(
skb
->
ip_summed
==
CHECKSUM_HW
)
base_flags
|=
TXD_FLAG_TCPUDP_CSUM
;
base_flags
|=
TXD_FLAG_TCPUDP_CSUM
;
#if TG3_DO_TSO != 0
#if TG3_DO_TSO != 0
if
((
mss
=
skb_shinfo
(
skb
)
->
tso_size
)
!=
0
)
if
((
mss
=
skb_shinfo
(
skb
)
->
tso_size
)
!=
0
)
{
static
int
times
=
0
;
mss
+=
((
skb
->
h
.
th
->
doff
*
4
)
-
20
);
base_flags
|=
(
TXD_FLAG_CPU_PRE_DMA
|
base_flags
|=
(
TXD_FLAG_CPU_PRE_DMA
|
TXD_FLAG_CPU_POST_DMA
);
TXD_FLAG_CPU_POST_DMA
);
if
(
times
++
<
5
)
{
printk
(
"tg3_xmit: tso_size[%u] tso_segs[%u] len[%u]
\n
"
,
(
unsigned
int
)
skb_shinfo
(
skb
)
->
tso_size
,
(
unsigned
int
)
skb_shinfo
(
skb
)
->
tso_segs
,
skb
->
len
);
}
}
#else
#else
mss
=
0
;
mss
=
0
;
#endif
#endif
...
@@ -2443,7 +2458,7 @@ static int tg3_start_xmit_4gbug(struct sk_buff *skb, struct net_device *dev)
...
@@ -2443,7 +2458,7 @@ static int tg3_start_xmit_4gbug(struct sk_buff *skb, struct net_device *dev)
}
}
tg3_set_txd
(
tp
,
entry
,
mapping
,
len
,
tg3_set_txd
(
tp
,
entry
,
mapping
,
len
,
base_flags
,
(
i
==
last
)
|
(
mss
<<
1
)
);
base_flags
,
(
i
==
last
));
entry
=
NEXT_TX
(
entry
);
entry
=
NEXT_TX
(
entry
);
}
}
...
@@ -2555,9 +2570,24 @@ static int tg3_start_xmit(struct sk_buff *skb, struct net_device *dev)
...
@@ -2555,9 +2570,24 @@ static int tg3_start_xmit(struct sk_buff *skb, struct net_device *dev)
if
(
skb
->
ip_summed
==
CHECKSUM_HW
)
if
(
skb
->
ip_summed
==
CHECKSUM_HW
)
base_flags
|=
TXD_FLAG_TCPUDP_CSUM
;
base_flags
|=
TXD_FLAG_TCPUDP_CSUM
;
#if TG3_DO_TSO != 0
#if TG3_DO_TSO != 0
if
((
mss
=
skb_shinfo
(
skb
)
->
tso_size
)
!=
0
)
if
((
mss
=
skb_shinfo
(
skb
)
->
tso_size
)
!=
0
)
{
static
int
times
=
0
;
/* TSO firmware wants TCP options included in
* tx descriptor MSS value.
*/
mss
+=
((
skb
->
h
.
th
->
doff
*
4
)
-
20
);
base_flags
|=
(
TXD_FLAG_CPU_PRE_DMA
|
base_flags
|=
(
TXD_FLAG_CPU_PRE_DMA
|
TXD_FLAG_CPU_POST_DMA
);
TXD_FLAG_CPU_POST_DMA
);
if
(
times
++
<
5
)
{
printk
(
"tg3_xmit: tso_size[%u] tso_segs[%u] len[%u]
\n
"
,
(
unsigned
int
)
skb_shinfo
(
skb
)
->
tso_size
,
(
unsigned
int
)
skb_shinfo
(
skb
)
->
tso_segs
,
skb
->
len
);
}
}
#else
#else
mss
=
0
;
mss
=
0
;
#endif
#endif
...
@@ -2597,7 +2627,7 @@ static int tg3_start_xmit(struct sk_buff *skb, struct net_device *dev)
...
@@ -2597,7 +2627,7 @@ static int tg3_start_xmit(struct sk_buff *skb, struct net_device *dev)
pci_unmap_addr_set
(
&
tp
->
tx_buffers
[
entry
],
mapping
,
mapping
);
pci_unmap_addr_set
(
&
tp
->
tx_buffers
[
entry
],
mapping
,
mapping
);
tg3_set_txd
(
tp
,
entry
,
mapping
,
len
,
tg3_set_txd
(
tp
,
entry
,
mapping
,
len
,
base_flags
,
(
i
==
last
)
|
(
mss
<<
1
)
);
base_flags
,
(
i
==
last
));
entry
=
NEXT_TX
(
entry
);
entry
=
NEXT_TX
(
entry
);
}
}
...
@@ -4329,9 +4359,11 @@ static int tg3_reset_hw(struct tg3 *tp)
...
@@ -4329,9 +4359,11 @@ static int tg3_reset_hw(struct tg3 *tp)
}
}
#if TG3_DO_TSO != 0
#if TG3_DO_TSO != 0
err
=
tg3_load_tso_firmware
(
tp
);
if
(
tp
->
dev
->
features
&
NETIF_F_TSO
)
{
if
(
err
)
err
=
tg3_load_tso_firmware
(
tp
);
return
err
;
if
(
err
)
return
err
;
}
#endif
#endif
tp
->
tx_mode
=
TX_MODE_ENABLE
;
tp
->
tx_mode
=
TX_MODE_ENABLE
;
...
@@ -6752,9 +6784,6 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
...
@@ -6752,9 +6784,6 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
dev
->
vlan_rx_register
=
tg3_vlan_rx_register
;
dev
->
vlan_rx_register
=
tg3_vlan_rx_register
;
dev
->
vlan_rx_kill_vid
=
tg3_vlan_rx_kill_vid
;
dev
->
vlan_rx_kill_vid
=
tg3_vlan_rx_kill_vid
;
#endif
#endif
#if TG3_DO_TSO != 0
dev
->
features
|=
NETIF_F_TSO
;
#endif
tp
=
dev
->
priv
;
tp
=
dev
->
priv
;
tp
->
pdev
=
pdev
;
tp
->
pdev
=
pdev
;
...
@@ -6855,6 +6884,17 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
...
@@ -6855,6 +6884,17 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
}
else
}
else
tp
->
tg3_flags
&=
~
TG3_FLAG_RX_CHECKSUMS
;
tp
->
tg3_flags
&=
~
TG3_FLAG_RX_CHECKSUMS
;
#if TG3_DO_TSO != 0
if
(
GET_ASIC_REV
(
tp
->
pci_chip_rev_id
)
==
ASIC_REV_5700
||
(
GET_ASIC_REV
(
tp
->
pci_chip_rev_id
)
==
ASIC_REV_5701
&&
tp
->
pci_chip_rev_id
<=
CHIPREV_ID_5701_B2
))
{
/* Not TSO capable. */
dev
->
features
&=
~
NETIF_F_TSO
;
}
else
{
dev
->
features
|=
NETIF_F_TSO
;
}
#endif
err
=
register_netdev
(
dev
);
err
=
register_netdev
(
dev
);
if
(
err
)
{
if
(
err
)
{
printk
(
KERN_ERR
PFX
"Cannot register net device, "
printk
(
KERN_ERR
PFX
"Cannot register net device, "
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment