diff options
author | Adrian Cinal <adriancinal@gmail.com> | 2023-12-28 14:56:38 +0100 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2024-01-03 01:19:41 +0100 |
commit | e584f2ff1e6cc9b1d99e8a6b0f3415940d1b3eb3 (patch) | |
tree | 1aba8246abe6aa43b5cc41c0816c6457a1723527 /drivers/net/ethernet/broadcom/genet/bcmgenet.c | |
parent | Merge branch 'mptcp-new-reviewer-and-prevent-a-warning' (diff) | |
download | linux-e584f2ff1e6cc9b1d99e8a6b0f3415940d1b3eb3.tar.xz linux-e584f2ff1e6cc9b1d99e8a6b0f3415940d1b3eb3.zip |
net: bcmgenet: Fix FCS generation for fragmented skbuffs
The flag DMA_TX_APPEND_CRC was only written to the first DMA descriptor
in the TX path, where each descriptor corresponds to a single skbuff
fragment (or the skbuff head). This led to packets with no FCS appearing
on the wire if the kernel allocated the packet in fragments, which would
always happen when using PACKET_MMAP/TPACKET (cf. tpacket_fill_skb() in
net/af_packet.c).
Fixes: 1c1008c793fa ("net: bcmgenet: add main driver file")
Signed-off-by: Adrian Cinal <adriancinal1@gmail.com>
Acked-by: Doug Berger <opendmb@gmail.com>
Acked-by: Florian Fainelli <florian.fainelli@broadcom.com>
Link: https://lore.kernel.org/r/20231228135638.1339245-1-adriancinal1@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to '')
-rw-r--r-- | drivers/net/ethernet/broadcom/genet/bcmgenet.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c index 9282403d1bf6..2d7ae71287b1 100644 --- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c @@ -2132,8 +2132,10 @@ static netdev_tx_t bcmgenet_xmit(struct sk_buff *skb, struct net_device *dev) /* Note: if we ever change from DMA_TX_APPEND_CRC below we * will need to restore software padding of "runt" packets */ + len_stat |= DMA_TX_APPEND_CRC; + if (!i) { - len_stat |= DMA_TX_APPEND_CRC | DMA_SOP; + len_stat |= DMA_SOP; if (skb->ip_summed == CHECKSUM_PARTIAL) len_stat |= DMA_TX_DO_CSUM; } |