Bug 10693
Summary: | sky2: driver-specific VLAN support is broken with "Marvell 88E8053 PCI-E Gigabit Ethernet Controller (rev 22)" | ||
---|---|---|---|
Product: | Drivers | Reporter: | Aurélien Géron (aurelien.geron.spam) |
Component: | Network | Assignee: | Stephen Hemminger (stephen) |
Status: | RESOLVED DUPLICATE | ||
Severity: | high | ||
Priority: | P1 | ||
Hardware: | All | ||
OS: | Linux | ||
Kernel Version: | 2.6.24.4 | Subsystem: | |
Regression: | --- | Bisected commit-id: |
Description
Aurélien Géron
2008-05-14 01:50:59 UTC
Hi, I tried to find the bug in the source code, and I think I may have found the answer, but I do not know how to fix the problem, yet. Basically, it seems that everything is properly initialized, including VLAN tags associated to each interface. But if for some reason the sky2 watchdog detects a hang, it restarts the interface, but it forgets to set the VLANs again. From then on, all packets received are rejected because they are tagged and the sky2 driver excepts untagged packets (hence the "rx length" error message). Therefore, after any hang, the watchdog does not restart the interface properly when VLAN tagging is used. In sky2.c (line 2195), the error message "%s: rx length error: status %#x length %d\n" is displayed only if (line 2177) length != count (actual length different than expected length). The VLAN ID bytes are taken into account (on line 2151) like this: #ifdef SKY2_VLAN_TAG_USED /* Account for vlan tag */ if (sky2->vlgrp && (status & GMR_FS_VLAN)) count -= VLAN_HLEN; #endif In my error messages, I can read that the status is equal to 0x402300 or 0x522100, for example (see above), and therefore I known that (status & GMR_FS_VLAN) is TRUE (GMR_FS_VLAN is equal to 1<<13). Since I get rx length errors, I believe that the count does not take into account the VLAN header bytes, and I think that the only possibility for this to happen is if sky2->vlgrp is NULL. Apparently, sky2->vlgrp gets set properly upon driver initialization, but it gets unset when the sky2 watchdog restarts the device. sky2->vlgrp seems to be set only in function sky2_vlan_rx_register (on line 1155). And function sky2_vlan_rx_register gets called only in sky2_init_netdev (on line 4011): #ifdef SKY2_VLAN_TAG_USED /* The workaround for FE+ status conflicts with VLAN tag detection. */ if (!(sky2->hw->chip_id == CHIP_ID_YUKON_FE_P && sky2->hw->chip_rev == CHIP_REV_YU_FE2_A0)) { dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX; dev->vlan_rx_register = sky2_vlan_rx_register; } #endif So the solution might be to cut and paste this code from sky2_init_netdev (which does not seem to be called when the sky2 watchdog restarts the device) into sky2_start (which is called both upon initialization of the device, and when the watchdog restarts the device) ? Unfortunately, I cannot test this right now because my server is a remote server and I cannot risk to loose the connection to it. I will try to get a similar server up and running for testing soon. Does this seem like a reasonable explanation for this bug? Sorry for the typos. I meant "the sky2 driver *expects* untagged packets" (not "excepts") and "sky2_up" rather than "sky2_start". |