* For the netdev list
@ 2011-05-06 16:57 Tom Goetz
2011-05-07 18:26 ` Francois Romieu
0 siblings, 1 reply; 3+ messages in thread
From: Tom Goetz @ 2011-05-06 16:57 UTC (permalink / raw)
To: netdev
[-- Attachment #1: Type: text/plain, Size: 569 bytes --]
We recently obtained a new a Lenovo Edge 0578-CTO. The r8169 driver causes instability in the system on this machine. The problem is that in rtl8169_rx_interrupt (status & 0x00001FFF) returns values less than four on this machine. This results in this line:
int pkt_size = (status & 0x00001FFF) - 4;
giving a huge packet size which causes problem when the packet is copied. For a work around we've added a patch to drop packets when we see this condition. I have attached lspci -vvv for this device and a patch for the work around we're using.
-Tom Goetz
[-- Attachment #2: r8168_lspci.log --]
[-- Type: application/octet-stream, Size: 3293 bytes --]
09:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 03)
Subsystem: Lenovo Device 2131
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- DisINTx+
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
Latency: 0, Cache Line Size: 64 bytes
Interrupt: pin A routed to IRQ 299
Region 0: I/O ports at 4000 [size=256]
Region 2: Memory at f0904000 (64-bit, prefetchable) [size=4K]
Region 4: Memory at f0900000 (64-bit, prefetchable) [size=16K]
[virtual] Expansion ROM at f0920000 [disabled] [size=128K]
Capabilities: [40] Power Management version 3
Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=375mA PME(D0+,D1+,D2+,D3hot+,D3cold+)
Status: D0 NoSoftRst+ PME-Enable- DSel=0 DScale=0 PME-
Capabilities: [50] MSI: Enable+ Count=1/1 Maskable- 64bit+
Address: 00000000fee0200c Data: 41c8
Capabilities: [70] Express (v2) Endpoint, MSI 01
DevCap: MaxPayload 256 bytes, PhantFunc 0, Latency L0s <512ns, L1 <64us
ExtTag- AttnBtn- AttnInd- PwrInd- RBE+ FLReset-
DevCtl: Report errors: Correctable- Non-Fatal- Fatal- Unsupported-
RlxdOrd+ ExtTag- PhantFunc- AuxPwr- NoSnoop-
MaxPayload 128 bytes, MaxReadReq 4096 bytes
DevSta: CorrErr- UncorrErr- FatalErr- UnsuppReq- AuxPwr+ TransPend-
LnkCap: Port #0, Speed 2.5GT/s, Width x1, ASPM L0s L1, Latency L0 <512ns, L1 <64us
ClockPM+ Surprise- LLActRep- BwNot-
LnkCtl: ASPM L1 Enabled; RCB 64 bytes Disabled- Retrain- CommClk+
ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
LnkSta: Speed 2.5GT/s, Width x1, TrErr- Train- SlotClk+ DLActive- BWMgmt- ABWMgmt-
DevCap2: Completion Timeout: Not Supported, TimeoutDis+
DevCtl2: Completion Timeout: 50us to 50ms, TimeoutDis-
LnkCtl2: Target Link Speed: 2.5GT/s, EnterCompliance- SpeedDis-, Selectable De-emphasis: -6dB
Transmit Margin: Normal Operating Range, EnterModifiedCompliance- ComplianceSOS-
Compliance De-emphasis: -6dB
LnkSta2: Current De-emphasis Level: -6dB
Capabilities: [ac] MSI-X: Enable- Count=4 Masked-
Vector table: BAR=4 offset=00000000
PBA: BAR=4 offset=00000800
Capabilities: [cc] Vital Product Data
Unknown small resource type 00, will not decode more.
Capabilities: [100 v1] Advanced Error Reporting
UESta: DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
UEMsk: DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
UESvrt: DLP+ SDES+ TLP- FCP+ CmpltTO- CmpltAbrt- UnxCmplt- RxOF+ MalfTLP+ ECRC- UnsupReq- ACSViol-
CESta: RxErr- BadTLP- BadDLLP- Rollover- Timeout- NonFatalErr-
CEMsk: RxErr- BadTLP- BadDLLP- Rollover- Timeout- NonFatalErr+
AERCap: First Error Pointer: 00, GenCap+ CGenEn- ChkCap+ ChkEn-
Capabilities: [140 v1] Virtual Channel
Caps: LPEVC=0 RefClk=100ns PATEntryBits=1
Arb: Fixed- WRR32- WRR64- WRR128-
Ctrl: ArbSelect=Fixed
Status: InProgress-
VC0: Caps: PATOffset=00 MaxTimeSlots=1 RejSnoopTrans-
Arb: Fixed- WRR32- WRR64- WRR128- TWRR128- WRR256-
Ctrl: Enable+ ID=0 ArbSelect=Fixed TC/VC=ff
Status: NegoPending- InProgress-
Capabilities: [160 v1] Device Serial Number d4-00-00-00-68-4c-e0-00
Kernel driver in use: r8169
Kernel modules: r8169
[-- Attachment #3: rtl8169.patch --]
[-- Type: application/octet-stream, Size: 652 bytes --]
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index 7ffdb80..4c8ad2a 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -4579,6 +4579,14 @@ static int rtl8169_rx_interrupt(struct net_device *dev,
dma_addr_t addr = le64_to_cpu(desc->addr);
int pkt_size = (status & 0x00001FFF) - 4;
+ if ((status & 0x00001FFF) < 4) {
+ dev->stats.rx_dropped++;
+ dev->stats.rx_length_errors++;
+ rtl8169_mark_to_asic(desc, rx_buf_sz);
+ printk("%s: bad packet length!\n", __FUNCTION__);
+ continue;
+ }
+
/*
* The driver does not support incoming fragmented
* frames. They are seen as a symptom of over-mtu
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: For the netdev list
2011-05-06 16:57 For the netdev list Tom Goetz
@ 2011-05-07 18:26 ` Francois Romieu
2011-05-09 12:36 ` Tom Goetz
0 siblings, 1 reply; 3+ messages in thread
From: Francois Romieu @ 2011-05-07 18:26 UTC (permalink / raw)
To: Tom Goetz; +Cc: netdev
Tom Goetz <tom.goetz@virtualcomputer.com> :
> We recently obtained a new a Lenovo Edge 0578-CTO. The r8169 driver causes
> instability in the system on this machine. The problem is that in
> rtl8169_rx_interrupt (status & 0x00001FFF) returns values less than four
This is unexpected. :o(
[...]
> For a work around we've added a patch to drop packets when we see this
> condition. I have attached lspci -vvv for this device and a patch for the
> work around we're using.
Thank you for debugging.
Can you grep for the XID of the device in the kernel's dmesg and specify
a bit of context for the problem (MTU ? features enabled through ethtool ?
kernel version ?) ?
--
Ueimor
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: For the netdev list
2011-05-07 18:26 ` Francois Romieu
@ 2011-05-09 12:36 ` Tom Goetz
0 siblings, 0 replies; 3+ messages in thread
From: Tom Goetz @ 2011-05-09 12:36 UTC (permalink / raw)
To: Francois Romieu; +Cc: netdev
On May 7, 2011, at 2:26 PM, Francois Romieu wrote:
> Tom Goetz <tom.goetz@virtualcomputer.com> :
>> We recently obtained a new a Lenovo Edge 0578-CTO. The r8169 driver causes
>> instability in the system on this machine. The problem is that in
>> rtl8169_rx_interrupt (status & 0x00001FFF) returns values less than four
>
> This is unexpected. :o(
>
> [...]
>> For a work around we've added a patch to drop packets when we see this
>> condition. I have attached lspci -vvv for this device and a patch for the
>> work around we're using.
>
> Thank you for debugging.
>
> Can you grep for the XID of the device in the kernel's dmesg and specify
> a bit of context for the problem (MTU ? features enabled through ethtool ?
> kernel version ?) ?
This is 2.6.38 PVOPs Dom0 on Xen. The distro is Ubuntu 11.04. We have not had issues with this driver in the past. This is a new issue with the Lenovo Edge.
Here's a log fragment with the XID and output from ifconfig and ethtool:
[ 3.197341] r8169 Gigabit Ethernet driver 2.3LK-NAPI loaded
[ 3.197387] xen: registering gsi 17 triggering 0 polarity 1
[ 3.197394] xen_map_pirq_gsi: returning irq 17 for gsi 17
[ 3.197397] xen: --> irq=17
[ 3.197406] Already setup the GSI :17
[ 3.197412] r8169 0000:09:00.0: PCI INT A -> GSI 17 (level, low) -> IRQ 17
[ 3.197524] r8169 0000:09:00.0: setting latency timer to 64
[ 3.197990] r8169 0000:09:00.0: eth0: RTL8168d/8111d at 0xffffc9001117c000, e8:9a:8f:0c:6c:62, XID 083000c0 IRQ 299
eth0 Link encap:Ethernet HWaddr e8:9a:8f:0c:6c:62
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1138 errors:0 dropped:0 overruns:0 frame:0
TX packets:284 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:183700 (183.7 KB) TX bytes:107686 (107.6 KB)
Interrupt:43 Base address:0xc000
root@edge-11-04:~# ethtool eth0
Settings for eth0:
Supported ports: [ TP MII ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
Supports auto-negotiation: Yes
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
Advertised pause frame use: No
Advertised auto-negotiation: Yes
Link partner advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Link partner advertised pause frame use: No
Link partner advertised auto-negotiation: Yes
Speed: 1000Mb/s
Duplex: Full
Port: MII
PHYAD: 0
Transceiver: internal
Auto-negotiation: on
Supports Wake-on: pumbg
Wake-on: g
Current message level: 0x00000033 (51)
drv probe ifdown ifup
Link detected: yes
-Tom
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-05-09 12:36 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-06 16:57 For the netdev list Tom Goetz
2011-05-07 18:26 ` Francois Romieu
2011-05-09 12:36 ` Tom Goetz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox