Skip to content

Commit dacc73e

Browse files
bwh-ctdavem330
authored andcommitted
sh_eth: Really fix padding of short frames on TX
My previous fix to clear padding of short frames used skb->len as the DMA length, assuming that skb_padto() extended skb->len to include the padding. That isn't the case; we need to use skb_put_padto() instead. (This wasn't immediately obvious because software padding isn't actually needed on the R-Car H2. We could make it conditional on which chip is being driven, but it's probably not worth the effort.) Reported-by: "Violeta Menéndez González" <[email protected]> Fixes: 612a17a54b50 ("sh_eth: Fix padding of short frames on TX") Signed-off-by: Ben Hutchings <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 9b4a636 commit dacc73e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/ethernet/renesas/sh_eth.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2181,7 +2181,7 @@ static int sh_eth_start_xmit(struct sk_buff *skb, struct net_device *ndev)
21812181
}
21822182
spin_unlock_irqrestore(&mdp->lock, flags);
21832183

2184-
if (skb_padto(skb, ETH_ZLEN))
2184+
if (skb_put_padto(skb, ETH_ZLEN))
21852185
return NETDEV_TX_OK;
21862186

21872187
entry = mdp->cur_tx % mdp->num_tx_ring;

0 commit comments

Comments
 (0)