Subject: Re: [PATCH v2] net: dsa: tag_mtk: add padding for tx packets

From: Andrew Lunn <[email-masked]>
Date: Wed, 11 May 2022 16:32:54 +0200

> Let's see what others have to say. I've been wanting to make the policy
> of whether to call __skb_put_padto() standardized for all tagging protocol
> drivers (similar to what is done in dsa_realloc_skb() and below it).
> We pad for tail taggers, maybe we can always pad and this removes a
> conditional, and simplifies taggers. Side note, I already dislike that
> the comment in tag_brcm.c is out of sync with the code. It says that
> padding up to ETH_ZLEN is necessary, but proceeds to pad up until
> ETH_ZLEN + tag len, only to add the tag len once more below via skb_push().
> It would be nice if we could use the simple eth_skb_pad().

There are some master devices which will perform padding on their own,
in hardware. So for taggers which insert the header at the head,
forcing such padding would be a waste of CPU time.

For tail taggers, padding short packets by default does however make
sense. The master device is probably going to pad in the wrong way if
it does padding.

   Andrew