ibmvnic currently only keeps an MTU of 1500 or 9000. Any other in-range value is accepted by ip(8) and then silently reverted: the vnicserver answers REQ_MTU with PARTIALSUCCESS and the size the backing device settled on, and the driver treats that as rejection and falls back.
Customers want flexible in-range MTUs (for example 1414, or values in the 2000..8000 range) rather than being forced onto the 1500/9000 buckets. Today those requests either snap back quietly or, in the mid-range case, can fail pool allocation and leave the interface down. This series makes those requests stick, hardens the reset path an MTU change goes through, and (patch 6) skips the reset when the backing device and current buffers already cover the new MTU. Posted as a single net-next series so the flexible-MTU change and the reset-path hardening can be reviewed together. Patches 1-5 address user-visible bugs and carry Fixes: tags; patch 6 is the follow-on optimization. Happy to resplit 1-5 to net and leave 6 for net-next if that is preferred. Patch 2 is the functional fix: keep the requested MTU when PARTIALSUCCESS covers it, and converge on the device size when it does not. Patch 1 is a prerequisite. Once req_mtu may sit below the backing buffer size, the existing pool-entry guard (which budgets with req_mtu) overshoots and mid-range MTU changes can fail allocation. It must not be backported without patch 2, or separated from it. Patches 3-5 clean up side effects of the MTU reset: skip unmaps for buffers the VIOS already forgot across a CRQ reconnect, and allocate new pools / long term buffers before releasing the old ones so a failed realloc refuses the MTU change instead of stranding the interface. Patch 6 records the covering backing size and skips wait_for_reset() when the new MTU fits in both that size and the current buffers. Tested on PowerVM ibmvnic with MTU sweeps including 1414 and the 2000..9000 range that previously failed to allocate. Mingming Cao (6): ibmvnic: cap rx pool entries against the real buffer size ibmvnic: honour the requested mtu instead of reverting to a fallback ibmvnic: do not unmap long term buffers across a crq reconnect ibmvnic: allocate new buffer pools before releasing the old ones ibmvnic: allocate a new long term buffer before freeing the old one ibmvnic: change the mtu without a reset where the buffers allow it drivers/net/ethernet/ibm/ibmvnic.c | 188 ++++++++++++++++++++--------- drivers/net/ethernet/ibm/ibmvnic.h | 3 + 2 files changed, 133 insertions(+), 58 deletions(-) -- 2.50.1 (Apple Git-155)
