]> git.baikalelectronics.ru Git - kernel.git/commit
net: ethernet: ti: cpsw: fix min eth packet size
authorGrygorii Strashko <grygorii.strashko@ti.com>
Wed, 15 Nov 2017 15:46:35 +0000 (09:46 -0600)
committerDavid S. Miller <davem@davemloft.net>
Thu, 16 Nov 2017 01:49:00 +0000 (10:49 +0900)
commitbefab25b9573518c967b34168a36e183c71ac380
tree43de83ada741d5f5acdd5bffe66d51669373fd62
parent5f5ad2d27414b3abb94fe0d67615011fdf98d1fe
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 <grygorii.strashko@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/ti/cpsw.c