On Sat, 2015-02-28 at 19:22 +0300, Sergey P. Semernin wrote:
> Hello All!
> 
> I'm using Intel D2500 board with Atom processor as home router/media server.
> It has Intel Gigabit Network adapter. This is lspci output:
[...]
> Some time ago, I bought the D-Link DGS-1100-08/A1A with VLAN support. Then, I 
> setup a tagged VLAN ports, one connected to the 82574L network adapter.
> In the operation system I shared eth0 as eth0.1, eth0.2, and eth0.3 VLANs.
> 
> Next time I saw receive errors on tagged port in the DGS-1100 admin interface.
> My investigation resulted in conclusion that some small Ethernet packets with 
> VLAN tag has 64 bytes length. Minimum size for the Ethernet packet is 64 
> byte, 
> and 4 byte is VLAN tag. So, smallest packet must be 68 bytes in my case.
>
> It seems that network adapter adds VLAN tag to the small frame, and then 
> append it to 64 bytes length. It's wrong.

It's right.

> I done simple patch to the e1000e module, and errors gone:
> 
> --- a/drivers/net/ethernet/intel/e1000e/netdev.c        2015-02-20 
> 05:57:03.000000000 +0300
> +++ b/drivers/net/ethernet/intel/e1000e/netdev.c        2015-01-22 
> 21:32:10.657649583 +0300
> @@ -5426,11 +5426,11 @@
>         /* The minimum packet size with TCTL.PSP set is 17 bytes so
>          * pad skb in order to meet this minimum size requirement
>          */
> -       if (unlikely(skb->len < 17)) {
> -               if (skb_pad(skb, 17 - skb->len))
> +       if (unlikely(skb->len < ETH_ZLEN)) {
> +               if (skb_pad(skb, ETH_ZLEN - skb->len))
>                         return NETDEV_TX_OK;
> -               skb->len = 17;
> -               skb_set_tail_pointer(skb, 17);
> +               skb->len = ETH_ZLEN;
> +               skb_set_tail_pointer(skb, ETH_ZLEN);
>         }
> 
>         mss = skb_shinfo(skb)->gso_size;

If the switch is stripping the VLAN tag from a minimum-length frame and
failing to add an extra 4 bytes of padding, that is a bug in the switch.
We will not patch e1000e or any other driver to work around that.

> If any additional information required, please contact me. I have some 
> background in the Linux drivers development.

Maybe you should also read the Ethernet specs; they're free to download:
<http://standards.ieee.org/about/get/>.  It is pretty clear that the
minimum frame length is not affected by the presence of a QTag
(VLAN/priority tag); only the maximum frame length is extended to allow
for the tag.

Ben.

-- 
Ben Hutchings
friends: People who know you well, but like you anyway.

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to