net: bcmgenet: Fix FCS generation for fragmented skbuffs
authorAdrian Cinal <adriancinal@gmail.com>
Thu, 28 Dec 2023 13:56:38 +0000 (14:56 +0100)
committerJakub Kicinski <kuba@kernel.org>
Wed, 3 Jan 2024 00:19:41 +0000 (16:19 -0800)
commite584f2ff1e6cc9b1d99e8a6b0f3415940d1b3eb3
tree1aba8246abe6aa43b5cc41c0816c6457a1723527
parentd5a13915ae2f4df738bf4254ec25e19f82e3ff49
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>
drivers/net/ethernet/broadcom/genet/bcmgenet.c