[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1bce5227-faf9-d063-edb4-95f02a8e60c5@denx.de>
Date: Fri, 14 Dec 2018 17:36:40 +0100
From: Marek Vasut <marex@...x.de>
To: netdev@...r.kernel.org
Cc: f.fainelli@...il.com, vivien.didelot@...oirfairelinux.com,
andrew@...n.ch, Woojung.Huh@...rochip.com,
UNGLinuxDriver@...rochip.com,
"David S . Miller" <davem@...emloft.net>,
Tristram Ha <Tristram.Ha@...rochip.com>
Subject: Re: [PATCH] net: dsa: ksz: Increase the tag alignment
On 12/07/2018 06:43 PM, Marek Vasut wrote:
> Make sure to cater even for network packets with VLAN tags in them,
> increase the minimal packets size to account for those.
>
> Signed-off-by: Marek Vasut <marex@...x.de>
> Cc: Vivien Didelot <vivien.didelot@...oirfairelinux.com>
> Cc: Woojung Huh <woojung.huh@...rochip.com>
> Cc: David S. Miller <davem@...emloft.net>
> Cc: Tristram Ha <Tristram.Ha@...rochip.com>
> ---
> net/dsa/tag_ksz.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/dsa/tag_ksz.c b/net/dsa/tag_ksz.c
> index 96411f70ab9f4..cad4406d9d4c2 100644
> --- a/net/dsa/tag_ksz.c
> +++ b/net/dsa/tag_ksz.c
> @@ -39,7 +39,7 @@ static struct sk_buff *ksz_xmit(struct sk_buff *skb, struct net_device *dev)
> int padlen;
> u8 *tag;
>
> - padlen = (skb->len >= ETH_ZLEN) ? 0 : ETH_ZLEN - skb->len;
> + padlen = (skb->len >= VLAN_ETH_ZLEN) ? 0 : VLAN_ETH_ZLEN - skb->len;
>
> if (skb_tailroom(skb) >= padlen + KSZ_INGRESS_TAG_LEN) {
> /* Let dsa_slave_xmit() free skb */
>
I was looking at this function again after some suggestions by Florian
on IRC to use MIN_MTU+VLAN_HLEN , and I wonder , cannot this whole
ksz_xmit() function be replaced by skb_padto(skb, skb->len + length of
the tag) instead of all this complex code ?
--
Best regards,
Marek Vasut
Powered by blists - more mailing lists