Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 30919 - [2.4] Kernel patches for VLAN usage
Summary: [2.4] Kernel patches for VLAN usage
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: x86 Linux
: High enhancement (vote)
Assignee: Gentoo Kernel Bug Wranglers and Kernel Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-10-11 11:29 UTC by Jeroen Roos
Modified: 2005-02-13 21:57 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
3Com VLAN patch, patched (3c59x-2.6.patch,5.26 KB, patch)
2004-04-09 13:34 UTC, Stefan de Konink
Details | Diff
3c59x vlan patch (3c59x-2.6.patch,6.64 KB, patch)
2004-04-17 07:39 UTC, Stefan de Konink
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jeroen Roos 2003-10-11 11:29:41 UTC
When using 802.1q vlans, there are problems with the ethernet frames being to
big after the 802.1q header has been added. There are kernel patches available
for this problem, which can, AFAIK, be applied to the drivers without negative
effects when not using 802.1q.

I am using gentoo-sources - currently running 2.4.20-gentoo-r7 and the patches
are not applied automatically, Maybe the patches could be added to the
Gentoo-sources?

They can be found (among others) on: http://www.bewley.net/linux/vlan/patches/

Just for clarity: I am not the developper of any of these patches.

Reproducible: Always
Steps to Reproduce:
I have configured VLANs on a 3Com 3c905B card in the server. This card is
connected to a 3Com switch, and the port it is connected to is configured for
VLAN trunking.

I do a ping from another machine (workstation) on the network. This machine is
connected to a 'normal' port on the switch; this port is part of VLAN 1.

So, what happens is: the 'ping' packet is sent by my workstation to the switch;
the switch adds the 802.1q header and forwards it to the server. As long as the
packets stay at or under 1468 bytes ICMP data (=1496 bytes ethernet) this goes
fine, above that, it fails, because the driver of the 3Com card in the server
throws away the packets that are bigger than 1500 bytes.
Actual Results:  
bash-2.05b$ ping -M do -c 1 -s 1467 192.168.1.1
PING 192.168.1.1 (192.168.1.1) 1467(1495) bytes of data.
1475 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=3.94 ms

--- 192.168.1.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 3.942/3.942/3.942/0.000 ms
bash-2.05b$ ping -M do -c 1 -s 1468 192.168.1.1
PING 192.168.1.1 (192.168.1.1) 1468(1496) bytes of data.
1476 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=3.48 ms

--- 192.168.1.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 3.482/3.482/3.482/0.000 ms
bash-2.05b$ ping -M do -c 1 -s 1469 192.168.1.1
PING 192.168.1.1 (192.168.1.1) 1469(1497) bytes of data.

--- 192.168.1.1 ping statistics ---
1 packets transmitted, 0 received, 100% packet loss, time 0ms


Expected Results:  
Accept the packet.

Workarounds:

- Set MTU to 1496 on all machines on the LAN
- Apply patches manually
Comment 1 Jeroen Roos 2003-12-03 14:27:07 UTC
Just an additional comment (I just ran into this problem again after recompiling a kernel and forgetting to add the patches): 

This problem makes a remote nfs-mount hang, which makes it extremely annoying...
Comment 2 Jason Cox (RETIRED) gentoo-dev 2004-03-29 13:21:14 UTC
Anyone take care of this already? (ie. apply necessary patches to gentoo-sources)
Comment 3 Jeroen Roos 2004-03-30 07:28:34 UTC
I just checked the code in 3c59x.c and it does not seem to have this patch installed. I have tried to apply the patch, but it doesn't work anymore. Here's a patch to fix that (this is a patch to the patch, just to make things complicated). I have not tested it yet, because my box takes a couple of hours to compile a kernel... but I have no reason to believe it does not.

--- vlan-3c59x.patch.orig       2004-03-30 17:14:39.000000000 +0200
+++ vlan-3c59x.patch    2004-03-30 17:18:37.000000000 +0200
@@ -41,7 +41,7 @@
        u16 intr_enable;
 @@ -844,6 +849,9 @@
- static int vortex_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
  static void vortex_tx_timeout(struct net_device *dev);
  static void acpi_set_WOL(struct net_device *dev);
+ static struct ethtool_ops vortex_ethtool_ops;
 +#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
 +static void set_8021q_mode(struct net_device *dev, int enable);
Comment 4 Jeroen Roos 2004-03-30 10:38:23 UTC
Oops, forgot to mention in which version I had checked the code: 2.4.25-gentoo
Comment 5 Jason Cox (RETIRED) gentoo-dev 2004-04-08 19:37:54 UTC
Do these patches add functionality that can only be used with the vconfig rpm's that are also located at http://www.bewley.net/linux/vlan/? Do these patches apply against the vanilla kernel? I checked the site, and there doesn't seem ot be much activity.
Comment 6 Jeroen Roos 2004-04-09 04:01:50 UTC
These patches solve a problem with 802.1q VLAN's. The VLAN tag adds a couple of bytes to each frame (4). This means that a frame may grow bigger than the MTU + ethernet header. The ethernet drivers discard these frames, causing a very high packet loss. These patches modify the original kernel drivers so that it checks whether VLAN's are used on the interface, and if it does, it grows the maximum frame size with four bytes. As far as I can understand from the modified code, it should not add any problems for systems that are not using 802.1q VLAN's.

The mentionned vconfig rpm's are also available in portage.

I think the patches can apply to the vanilla kernel, but I use them on the Gentoo kernel. I had to make a small modification to the patch to make it work in 2.4.25-gentoo (because of an added line, see one of my previous comments).

Please let me know if you need more information.
Comment 7 Jeroen Roos 2004-04-09 04:02:26 UTC
linux root # emerge -p vconfig

These are the packages that I would merge, in order:

Calculating dependencies ...done!
[ebuild   R   ] net-misc/vconfig-1.8  
Comment 8 Jason Cox (RETIRED) gentoo-dev 2004-04-09 04:26:05 UTC
The code for these patches looks clean and done properly. livewire, what do you think? I checked the ebuild and it's pulling from your dev.gentoo.org site, so there's nothing really I can do. I have no problem with these patches, after the minor fix of course.
Comment 9 Stefan de Konink 2004-04-09 11:07:02 UTC
I would like to suggest these patches should be applied to the gentoo-dev-sources (too). The patches are now working in production (3c59x). Although it doesn't patch cleanly on the 2.6 series anymore (one of the prototypes, need to be set after reading the .rej file). After emerging the 2.6.5 kernel I will try to make a patch for 2.6.
Comment 10 Stefan de Konink 2004-04-09 13:34:46 UTC
Created attachment 28982 [details, diff]
3Com VLAN patch, patched

The promised patch (Jeroen's patch probably), but done with a manual diff on
the driver and the adapted driver. I didn't test the patch with 2.6.5 yet and I
cannot verify this code works as promised. But from experience (2.6.4) I know
that this solution is much better than changing all clients to a lower MTU :)
Comment 11 Stefan de Konink 2004-04-17 07:39:05 UTC
Created attachment 29492 [details, diff]
3c59x vlan patch

first thing should be ignored, it is the reverse patch
Comment 12 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2004-06-28 01:49:42 UTC
is this going to get applied?
Comment 13 Greg Kroah-Hartman (RETIRED) gentoo-dev 2004-06-29 13:07:35 UTC
for 2.6?  no way.

for 2.4, there is no 2.4 gentoo kernel development happening, so I really doubt
it...
Comment 14 Tim Yamin (RETIRED) gentoo-dev 2004-06-29 13:48:12 UTC
I should be able to put the 2.4 patches into gentoo-sources since they don't seem too intrusive and the code looks good...
Comment 15 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2005-02-13 21:57:37 UTC
I don't think we need this bug anymore...
upstream 2.6 seems to have this VLAN stuff anyway.