[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c2a9a5c2-e096-7683-f733-a4c5a8610b8e@denx.de>
Date: Mon, 10 Dec 2018 21:33:15 +0100
From: Marek Vasut <marex@...x.de>
To: Tristram.Ha@...rochip.com, f.fainelli@...il.com
Cc: vivien.didelot@...oirfairelinux.com, andrew@...n.ch,
Woojung.Huh@...rochip.com, UNGLinuxDriver@...rochip.com,
davem@...emloft.net, netdev@...r.kernel.org
Subject: Re: [PATCH] net: dsa: ksz: Increase the tag alignment
On 12/10/2018 09:04 PM, Tristram.Ha@...rochip.com wrote:
>>>>>> - padlen = (skb->len >= ETH_ZLEN) ? 0 : ETH_ZLEN - skb->len;
>>>>>> + padlen = (skb->len >= VLAN_ETH_ZLEN) ? 0 : VLAN_ETH_ZLEN - skb-
>>>>>>> len;
>>> Oh so they add the internal VLAN at the end of the frame, not the
>>> beginning? That is quite surprising but that would not be the one single
>>> oddity found with CPSW I am afraid.. The way I would approach this is
>>> with layering where the padding needs to occur:
>>>
>>> - within the tag driver you need to make sure there is enough room to
>>> insert the KSZ tag
>>>
>>> - within the ethernet MAC driver (which comes last in the transmit
>>> path), you need to make sure there is enough room to insert that trailer
>>> VLAN tag to permit internal transmission
>>
>> So you think this is a bug in the CPSW instead ?
>>
>
> I think what causes this problem. In the MAC controller driver cpsw.c
> the buffer is always padded to CPSW_MIN_PACKET_SIZE. Normally that
> size is 60 bytes, but after Linux 4.14 kernel it was changed to VLAN_ETH_ZLEN.
> The original size should work, but I do not know why it was changed. It seems
> there is a new function using the CPSW_RX_VLAN_ENCAP bit.
>
> It is similar to what I experienced with the Atmel MAC driver. The newer kernels
> added some changes that introduced a bug and broke the tail tagging code. I had
> to submit a fix to the MAC driver to correct that.
>
> I do not think this patch should apply generally, but I do not know how to fix the
> MAC driver to work in all cases.
>
> You can try temporarily to change CPSW_MIN_PACKET_SIZE back to 60.
>
> It is only used to assign to min_packet_size. It may be possible to use a different
> size like 60 instead of 64 in the skb_padto function.
I am not looking for a hack-around, I am looking for a proper solution.
--
Best regards,
Marek Vasut
Powered by blists - more mailing lists