diff options
| author | Florian Fainelli <f.fainelli@gmail.com> | 2018-01-04 01:13:00 -0500 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2018-01-05 11:21:31 -0500 |
| commit | bf08c34086d159edde5c54902dfa2caa4d9fbd8c (patch) | |
| tree | d5cc59182650577d384f016233bc7d117dd6f57f /net/dsa | |
| parent | 33c30a8b68cf837b2be3e885ae0a329b880d7666 (diff) | |
net: dsa: Move padding into Broadcom tagger
Instead of having the different master network device drivers
potentially used by DSA/Broadcom tags, move the padding necessary for
the switches to accept short packets where it makes most sense: within
tag_brcm.c. This avoids multiplying the number of similar commits to
e.g: bgmac, bcmsysport, etc.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dsa')
| -rw-r--r-- | net/dsa/tag_brcm.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/net/dsa/tag_brcm.c b/net/dsa/tag_brcm.c index e6e0b7b6025c..2b06bb91318b 100644 --- a/net/dsa/tag_brcm.c +++ b/net/dsa/tag_brcm.c | |||
| @@ -70,6 +70,18 @@ static struct sk_buff *brcm_tag_xmit_ll(struct sk_buff *skb, | |||
| 70 | if (skb_cow_head(skb, BRCM_TAG_LEN) < 0) | 70 | if (skb_cow_head(skb, BRCM_TAG_LEN) < 0) |
| 71 | return NULL; | 71 | return NULL; |
| 72 | 72 | ||
| 73 | /* The Ethernet switch we are interfaced with needs packets to be at | ||
| 74 | * least 64 bytes (including FCS) otherwise they will be discarded when | ||
| 75 | * they enter the switch port logic. When Broadcom tags are enabled, we | ||
| 76 | * need to make sure that packets are at least 68 bytes | ||
| 77 | * (including FCS and tag) because the length verification is done after | ||
| 78 | * the Broadcom tag is stripped off the ingress packet. | ||
| 79 | * | ||
| 80 | * Let dsa_slave_xmit() free the SKB | ||
| 81 | */ | ||
| 82 | if (__skb_put_padto(skb, ETH_ZLEN + BRCM_TAG_LEN, false)) | ||
| 83 | return NULL; | ||
| 84 | |||
| 73 | skb_push(skb, BRCM_TAG_LEN); | 85 | skb_push(skb, BRCM_TAG_LEN); |
| 74 | 86 | ||
| 75 | if (offset) | 87 | if (offset) |
