Skip to content

Commit b95f6fb

Browse files
madalinbucurdavem330
authored andcommitted
fsl/fman: fix parser reporting bad checksum on short frames
The FMan hardware parser needs to be configured to remove the short frame padding from the checksum calculation, otherwise short UDP and TCP frames are likely to be marked as having a bad checksum. Signed-off-by: Madalin Bucur <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 484c016 commit b95f6fb

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

drivers/net/ethernet/freescale/fman/fman_port.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,10 @@ struct fman_port_qmi_regs {
324324
#define HWP_HXS_PHE_REPORT 0x00000800
325325
#define HWP_HXS_PCAC_PSTAT 0x00000100
326326
#define HWP_HXS_PCAC_PSTOP 0x00000001
327+
#define HWP_HXS_TCP_OFFSET 0xA
328+
#define HWP_HXS_UDP_OFFSET 0xB
329+
#define HWP_HXS_SH_PAD_REM 0x80000000
330+
327331
struct fman_port_hwp_regs {
328332
struct {
329333
u32 ssa; /* Soft Sequence Attachment */
@@ -728,6 +732,10 @@ static void init_hwp(struct fman_port *port)
728732
iowrite32be(0xffffffff, &regs->pmda[i].lcv);
729733
}
730734

735+
/* Short packet padding removal from checksum calculation */
736+
iowrite32be(HWP_HXS_SH_PAD_REM, &regs->pmda[HWP_HXS_TCP_OFFSET].ssa);
737+
iowrite32be(HWP_HXS_SH_PAD_REM, &regs->pmda[HWP_HXS_UDP_OFFSET].ssa);
738+
731739
start_port_hwp(port);
732740
}
733741

0 commit comments

Comments
 (0)