Subject: Re: e100 + VLANs?

From: Michael Tokarev <[email-masked]>
Date: Tue, 11 Oct 2011 15:59:06 +0400

11.10.2011 15:25, Eric Dumazet wrote:
>> So, is that a hardware limitation?
> 
> Its a driver bug
> 
> This comes from fact that sizeof(struct rfd) = 16
> 
> and VLAN_ETH_FRAME_LEN is 1518
> 
> driver mixes VLAN_ETH_FRAME_LEN and 1500+4+sizeof(struct rfd)   (1520, not 1518)
> 
> It therefore misses 2 bytes for large frames (VLAN tagged)
> 
> Fix is to remove VLAN_ETH_FRAME_LEN references for good...
> 
> diff --git a/drivers/net/e100.c b/drivers/net/e100.c
> index c1352c6..3287d31 100644

Hmm.  This does not _exactly_ work.

I applied it on top of 2.6.32, patch applied but with some fuzz - I checked
manually and it appears to be ok.

Now, with this patch applied, I see on the e100 side:

00:1f:c6:ef:e5:1b > 00:90:27:30:6d:1c, ethertype 802.1Q (0x8100), length 1504: vlan 6, p 0, ethertype IPv4, truncated-ip - 1 bytes missing! (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto ICMP (1), length 1487)
    10.48.6.1 > 10.48.6.2: ICMP echo request, id 27613, seq 6, length 1467

when pinging it with -s 1459 (1487 total size).

I added extra +40 for RFD_BUF_LEN define and recompiled
(this resulted in RFD_BUF_LEN=1560, - I've added a printk
just to be sure).

Now I see the same effect as before the patch:  maximum
packet size that goes and can be seen on the e100 side
is 1468(1496) (ping), which results in this on e100 side:

15:54:44.830941 00:1f:c6:ef:e5:1b > 00:90:27:30:6d:1c, ethertype 802.1Q (0x8100), length 1514: vlan 6, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto ICMP (1), length 1496)
    10.48.6.1 > 10.48.6.2: ICMP echo request, id 28735, seq 4, length 1476
15:54:44.831025 00:90:27:30:6d:1c > 00:1f:c6:ef:e5:1b, ethertype 802.1Q (0x8100), length 1514: vlan 6, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 12010, offset 0, flags [none], proto ICMP (1), length 1496)
    10.48.6.2 > 10.48.6.1: ICMP echo reply, id 28735, seq 4, length 1476

(and it works).  With -s 1469, no ICMP packets can be seen
on e100 side.

So it still may be the hardware... :)

Thank you!

/mjt