Skip to content

Commit

Permalink
lan743x: trim all 4 bytes of the FCS; not just 2
Browse files Browse the repository at this point in the history
Trim all 4 bytes of the received FCS; not just 2 of them. Leaving 2
bytes of the FCS on the frame breaks DSA tailing tag drivers.

Fixes: a8db76d ("lan743x: boost performance on cpu archs w/o dma cache snooping")
Signed-off-by: George McCollister <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
gmccollister authored and davem330 committed Mar 5, 2021
1 parent d8861ba commit 3e21a10
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/microchip/lan743x_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2040,7 +2040,7 @@ lan743x_rx_trim_skb(struct sk_buff *skb, int frame_length)
dev_kfree_skb_irq(skb);
return NULL;
}
frame_length = max_t(int, 0, frame_length - RX_HEAD_PADDING - 2);
frame_length = max_t(int, 0, frame_length - RX_HEAD_PADDING - 4);
if (skb->len > frame_length) {
skb->tail -= skb->len - frame_length;
skb->len = frame_length;
Expand Down

0 comments on commit 3e21a10

Please sign in to comment.