aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/ethernet/broadcom/bcmsysport.c12
-rw-r--r--drivers/net/ethernet/broadcom/bgmac.c15
-rw-r--r--net/dsa/tag_brcm.c12
3 files changed, 12 insertions, 27 deletions
diff --git a/drivers/net/ethernet/broadcom/bcmsysport.c b/drivers/net/ethernet/broadcom/bcmsysport.c
index 087f01b4dc3a..f15a8fc6dfc9 100644
--- a/drivers/net/ethernet/broadcom/bcmsysport.c
+++ b/drivers/net/ethernet/broadcom/bcmsysport.c
@@ -1216,18 +1216,6 @@ static netdev_tx_t bcm_sysport_xmit(struct sk_buff *skb,
1216 goto out; 1216 goto out;
1217 } 1217 }
1218 1218
1219 /* The Ethernet switch we are interfaced with needs packets to be at
1220 * least 64 bytes (including FCS) otherwise they will be discarded when
1221 * they enter the switch port logic. When Broadcom tags are enabled, we
1222 * need to make sure that packets are at least 68 bytes
1223 * (including FCS and tag) because the length verification is done after
1224 * the Broadcom tag is stripped off the ingress packet.
1225 */
1226 if (skb_put_padto(skb, ETH_ZLEN + ENET_BRCM_TAG_LEN)) {
1227 ret = NETDEV_TX_OK;
1228 goto out;
1229 }
1230
1231 /* Insert TSB and checksum infos */ 1219 /* Insert TSB and checksum infos */
1232 if (priv->tsb_en) { 1220 if (priv->tsb_en) {
1233 skb = bcm_sysport_insert_tsb(skb, dev); 1221 skb = bcm_sysport_insert_tsb(skb, dev);
diff --git a/drivers/net/ethernet/broadcom/bgmac.c b/drivers/net/ethernet/broadcom/bgmac.c
index 1d96cd594ade..8eef9fb6b1fe 100644
--- a/drivers/net/ethernet/broadcom/bgmac.c
+++ b/drivers/net/ethernet/broadcom/bgmac.c
@@ -128,8 +128,6 @@ bgmac_dma_tx_add_buf(struct bgmac *bgmac, struct bgmac_dma_ring *ring,
128 dma_desc->ctl1 = cpu_to_le32(ctl1); 128 dma_desc->ctl1 = cpu_to_le32(ctl1);
129} 129}
130 130
131#define ENET_BRCM_TAG_LEN 4
132
133static netdev_tx_t bgmac_dma_tx_add(struct bgmac *bgmac, 131static netdev_tx_t bgmac_dma_tx_add(struct bgmac *bgmac,
134 struct bgmac_dma_ring *ring, 132 struct bgmac_dma_ring *ring,
135 struct sk_buff *skb) 133 struct sk_buff *skb)
@@ -142,18 +140,6 @@ static netdev_tx_t bgmac_dma_tx_add(struct bgmac *bgmac,
142 u32 flags; 140 u32 flags;
143 int i; 141 int i;
144 142
145 /* The Ethernet switch we are interfaced with needs packets to be at
146 * least 64 bytes (including FCS) otherwise they will be discarded when
147 * they enter the switch port logic. When Broadcom tags are enabled, we
148 * need to make sure that packets are at least 68 bytes
149 * (including FCS and tag) because the length verification is done after
150 * the Broadcom tag is stripped off the ingress packet.
151 */
152 if (netdev_uses_dsa(net_dev)) {
153 if (skb_put_padto(skb, ETH_ZLEN + ENET_BRCM_TAG_LEN))
154 goto err_stats;
155 }
156
157 if (skb->len > BGMAC_DESC_CTL1_LEN) { 143 if (skb->len > BGMAC_DESC_CTL1_LEN) {
158 netdev_err(bgmac->net_dev, "Too long skb (%d)\n", skb->len); 144 netdev_err(bgmac->net_dev, "Too long skb (%d)\n", skb->len);
159 goto err_drop; 145 goto err_drop;
@@ -240,7 +226,6 @@ err_dma_head:
240 226
241err_drop: 227err_drop:
242 dev_kfree_skb(skb); 228 dev_kfree_skb(skb);
243err_stats:
244 net_dev->stats.tx_dropped++; 229 net_dev->stats.tx_dropped++;
245 net_dev->stats.tx_errors++; 230 net_dev->stats.tx_errors++;
246 return NETDEV_TX_OK; 231 return NETDEV_TX_OK;
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)