[PATCH 20/44] net: mana: Add support for jumbo frame
authorHaiyang Zhang <haiyangz@microsoft.com>
Wed, 12 Apr 2023 21:16:03 +0000 (14:16 -0700)
committerSalvatore Bonaccorso <carnil@debian.org>
Fri, 25 Apr 2025 19:51:43 +0000 (21:51 +0200)
commit43ba8f448e5fa037f48fcd0a9ee3a0d512b1c60c
tree28dc0b0c9cd09bdc5aaf283b299b5c121d800d27
parent19dfdec88ae306abacaa0dd08a3b60203c796dd6
[PATCH 20/44] net: mana: Add support for jumbo frame

During probe, get the hardware-allowed max MTU by querying the device
configuration. Users can select MTU up to the device limit.
When XDP is in use, limit MTU settings so the buffer size is within
one page. And, when MTU is set to a too large value, XDP is not allowed
to run.
Also, to prevent changing MTU fails, and leaves the NIC in a bad state,
pre-allocate all buffers before starting the change. So in low memory
condition, it will return error, without affecting the NIC.

Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Reviewed-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 80f6215b450eb8e92d8b1f117abf5ecf867f963e)
Signed-off-by: Bastian Blank <waldi@debian.org>
Gbp-Pq: Topic features/all/ethernet-microsoft
Gbp-Pq: Name 0020-net-mana-Add-support-for-jumbo-frame.patch
drivers/net/ethernet/microsoft/mana/mana_bpf.c
drivers/net/ethernet/microsoft/mana/mana_en.c
include/net/mana/gdma.h
include/net/mana/mana.h