mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-28 11:00:09 +01:00
platform: detect EINVAL as failure to set the MTU
Some drivers will reject an invalid MTU size with EINVAL. Quote from [1]: While investigating, I did notice that do_change_link in nm-linux-platform.c really ought to count -EINVAL as an MTU out-of-range error and not just -ERANGE. Even if the hardware supports a large MTU, if the transmit FIFO is set too small, stmmac_change_mtu [2] will return -EINVAL. For example, on my device, the maxmtu is 9000 but in practice I can't set an MTU larger than 4096 unless I first run ethtool --set-channels eno1 tx 3. [1] https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1198#note_1738311 [2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c?h=v6.1#n5577
This commit is contained in:
parent
fce8e572d0
commit
621b41ebfa
1 changed files with 2 additions and 1 deletions
|
|
@ -8217,7 +8217,8 @@ retry:
|
|||
} else if (NM_IN_SET(seq_result, -ESRCH, -ENOENT)) {
|
||||
log_detail = ", firmware not found";
|
||||
result = -NME_PL_NO_FIRMWARE;
|
||||
} else if (NM_IN_SET(seq_result, -ERANGE) && change_link_type == CHANGE_LINK_TYPE_SET_MTU) {
|
||||
} else if (NM_IN_SET(seq_result, -ERANGE, -EINVAL)
|
||||
&& change_link_type == CHANGE_LINK_TYPE_SET_MTU) {
|
||||
log_detail = ", setting MTU to requested size is not possible";
|
||||
result = -NME_PL_CANT_SET_MTU;
|
||||
} else if (NM_IN_SET(seq_result, -ENFILE) && change_link_type == CHANGE_LINK_TYPE_SET_ADDRESS
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue