Skip to content

Commit 9421c90

Browse files
grygoriySdavem330
authored andcommitted
net: ethernet: ti: cpsw: fix min eth packet size
Now CPSW driver configures min eth packet size to 60 octets (ETH_ZLEN) which works in most of cases, but when port VLAN is configured on some switch port, it also can be configured to force all egress packets to be VLAN untagged. And in this case, CPSW driver will pad small packets to 60 octets, but final packet size on port egress can became less than 60 octets due to VLAN tag removal and packet will be dropped. Hence, fix it by accounting VLAN header in CPSW min eth packet size. While here, use proper defines for CPSW_MAX_PACKET_SIZE also, instead of open coding. Signed-off-by: Grygorii Strashko <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 6ab6a0d commit 9421c90

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/net/ethernet/ti/cpsw.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@ do { \
119119
#define CPDMA_RXCP 0x60
120120

121121
#define CPSW_POLL_WEIGHT 64
122-
#define CPSW_MIN_PACKET_SIZE 60
123-
#define CPSW_MAX_PACKET_SIZE (1500 + 14 + 4 + 4)
122+
#define CPSW_MIN_PACKET_SIZE (VLAN_ETH_ZLEN)
123+
#define CPSW_MAX_PACKET_SIZE (VLAN_ETH_FRAME_LEN + ETH_FCS_LEN)
124124

125125
#define RX_PRIORITY_MAPPING 0x76543210
126126
#define TX_PRIORITY_MAPPING 0x33221100

0 commit comments

Comments
 (0)