Octeontx2-vf: Fix max packet length errors
authorHariprasad Kelam <hkelam@marvell.com>
Thu, 21 Aug 2025 06:25:28 +0000 (11:55 +0530)
committerJakub Kicinski <kuba@kernel.org>
Fri, 22 Aug 2025 22:53:04 +0000 (15:53 -0700)
commita64494aafc56939564e3e9e57f99df5c27204e04
tree8efd6af5d192f0cc7af4af20bc3372c26cd47f13
parentabadf0ff63be488dc502ecfc9f622929a21b7117
Octeontx2-vf: Fix max packet length errors

Once driver submits the packets to the hardware, each packet
traverse through multiple transmit levels in the following
order:
SMQ -> TL4 -> TL3 -> TL2 -> TL1

The SMQ supports configurable minimum and maximum packet sizes.
It enters to a hang state, if driver submits packets with
out of bound lengths.

To avoid the same, implement packet length validation before
submitting packets to the hardware. Increment tx_dropped counter
on failure.

Fixes: 3184fb5ba96e ("octeontx2-vf: Virtual function driver support")
Fixes: 22f858796758 ("octeontx2-pf: Add basic net_device_ops")
Fixes: 3ca6c4c882a7 ("octeontx2-pf: Add packet transmission support")
Signed-off-by: Hariprasad Kelam <hkelam@marvell.com>
Link: https://patch.msgid.link/20250821062528.1697992-1-hkelam@marvell.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c
drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h
drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c
drivers/net/ethernet/marvell/octeontx2/nic/otx2_vf.c
drivers/net/ethernet/marvell/octeontx2/nic/rep.c
drivers/net/ethernet/marvell/octeontx2/nic/rep.h