]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: stmmac: Consider Tx VLAN offload tag length for maxSDU
authorRohan G Thomas <rohan.g.thomas@altera.com>
Tue, 28 Oct 2025 03:18:44 +0000 (11:18 +0800)
committerJakub Kicinski <kuba@kernel.org>
Thu, 30 Oct 2025 01:49:24 +0000 (18:49 -0700)
commitded9813d17d3dd50a08e7a2ca1495769ef9c6673
tree6fa100b750339254e37f13f0c04aee7cf21a1241
parentc657f86106c8729240e1f50a62c6606b578ecf20
net: stmmac: Consider Tx VLAN offload tag length for maxSDU

Queue maxSDU requirement of 802.1 Qbv standard requires mac to drop
packets that exceeds maxSDU length and maxSDU doesn't include
preamble, destination and source address, or FCS but includes
ethernet type and VLAN header.

On hardware with Tx VLAN offload enabled, VLAN header length is not
included in the skb->len, when Tx VLAN offload is requested. This
leads to incorrect length checks and allows transmission of
oversized packets. Add the VLAN_HLEN to the skb->len before checking
the Qbv maxSDU if Tx VLAN offload is requested for the packet.

Fixes: c5c3e1bfc9e0 ("net: stmmac: Offload queueMaxSDU from tc-taprio")
Signed-off-by: Rohan G Thomas <rohan.g.thomas@altera.com>
Reviewed-by: Matthew Gerlach <matthew.gerlach@altera.com>
Link: https://patch.msgid.link/20251028-qbv-fixes-v4-2-26481c7634e3@altera.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c