eth: fbnic: Add validation for MTU changes
authorDimitri Daskalakis <dimitri.daskalakis1@gmail.com>
Sat, 14 Feb 2026 17:19:49 +0000 (09:19 -0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 18 Feb 2026 06:09:31 +0000 (06:09 +0000)
commitccd8e87748ad083047d6c8544c5809b7f96cc8df
tree1d472ede3fd58de8ce684307bb2f4d516bdb4ed3
parentbe054cc66f739a9ba615dba9012a07fab8e7dd6f
eth: fbnic: Add validation for MTU changes

Increasing the MTU beyond the HDS threshold causes the hardware to
fragment packets across multiple buffers. If a single-buffer XDP program
is attached, the driver will drop all multi-frag frames. While we can't
prevent a remote sender from sending non-TCP packets larger than the MTU,
this will prevent users from inadvertently breaking new TCP streams.

Traditionally, drivers supported XDP with MTU less than 4Kb
(packet per page). Fbnic currently prevents attaching XDP when MTU is too high.
But it does not prevent increasing MTU after XDP is attached.

Fixes: 1b0a3950dbd4 ("eth: fbnic: Add XDP pass, drop, abort support")
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Dimitri Daskalakis <dimitri.daskalakis1@gmail.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/meta/fbnic/fbnic_netdev.c