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 <ma...@denx.de>
> Cc: Vivien Didelot <vivien.dide...@savoirfairelinux.com>
> Cc: Woojung Huh <woojung....@microchip.com>
> Cc: David S. Miller <da...@davemloft.net>
> Cc: Tristram Ha <tristram...@microchip.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

Reply via email to