]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
net: fec: account for VLAN header in frame length calculations
authorClemens Gruber <mail@clemensgruber.at>
Wed, 21 Jan 2026 08:37:51 +0000 (09:37 +0100)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 22 Jan 2026 12:21:19 +0000 (13:21 +0100)
commitca1bb3fedf26a08ed31974131bc0064d4fe33649
tree110161c23ff432cabc16a81b7814aefe3aa72ad3
parentcc4816bdb08639e5cd9acb295a02d6f0f09736b4
net: fec: account for VLAN header in frame length calculations

The MAX_FL (maximum frame length) and related calculations used ETH_HLEN,
which does not account for the 4-byte VLAN tag in tagged frames. This
caused the hardware to reject valid VLAN frames as oversized, resulting
in RX errors and dropped packets.

Use VLAN_ETH_HLEN instead of ETH_HLEN in the MAX_FL register setup,
cut-through mode threshold, buffer allocation, and max_mtu calculation.

Cc: stable@kernel.org # v6.18+
Fixes: 62b5bb7be7bc ("net: fec: update MAX_FL based on the current MTU")
Fixes: d466c16026e9 ("net: fec: enable the Jumbo frame support for i.MX8QM")
Fixes: 59e9bf037d75 ("net: fec: add change_mtu to support dynamic buffer allocation")
Fixes: ec2a1681ed4f ("net: fec: use a member variable for maximum buffer size")
Signed-off-by: Clemens Gruber <mail@clemensgruber.at>
Reviewed-by: Wei Fang <wei.fang@nxp.com>
Link: https://patch.msgid.link/20260121083751.66997-1-mail@clemensgruber.at
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/freescale/fec_main.c