Skip to content

Commit e584f2f

Browse files
aCinalkuba-moo
authored andcommitted
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: 1c1008c ("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>
1 parent d5a1391 commit e584f2f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/net/ethernet/broadcom/genet/bcmgenet.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2132,8 +2132,10 @@ static netdev_tx_t bcmgenet_xmit(struct sk_buff *skb, struct net_device *dev)
21322132
/* Note: if we ever change from DMA_TX_APPEND_CRC below we
21332133
* will need to restore software padding of "runt" packets
21342134
*/
2135+
len_stat |= DMA_TX_APPEND_CRC;
2136+
21352137
if (!i) {
2136-
len_stat |= DMA_TX_APPEND_CRC | DMA_SOP;
2138+
len_stat |= DMA_SOP;
21372139
if (skb->ip_summed == CHECKSUM_PARTIAL)
21382140
len_stat |= DMA_TX_DO_CSUM;
21392141
}

0 commit comments

Comments
 (0)