mirror of
https://github.com/torvalds/linux.git
synced 2026-03-08 01:04:41 +01:00
iavf: fix netdev->max_mtu to respect actual hardware limit
iavf sets LIBIE_MAX_MTU as netdev->max_mtu, ignoring vf_res->max_mtu
from PF [1]. This allows setting an MTU beyond the actual hardware
limit, causing TX queue timeouts [2].
Set correct netdev->max_mtu using vf_res->max_mtu from the PF.
Note that currently PF drivers such as ice/i40e set the frame size in
vf_res->max_mtu, not MTU. Convert vf_res->max_mtu to MTU before setting
netdev->max_mtu.
[1]
# ip -j -d link show $DEV | jq '.[0].max_mtu'
16356
[2]
iavf 0000:00:05.0 enp0s5: NETDEV WATCHDOG: CPU: 1: transmit queue 0 timed out 5692 ms
iavf 0000:00:05.0 enp0s5: NIC Link is Up Speed is 10 Gbps Full Duplex
iavf 0000:00:05.0 enp0s5: NETDEV WATCHDOG: CPU: 6: transmit queue 3 timed out 5312 ms
iavf 0000:00:05.0 enp0s5: NIC Link is Up Speed is 10 Gbps Full Duplex
...
Fixes: 5fa4caff59 ("iavf: switch to Page Pool")
Signed-off-by: Kohei Enju <kohei@enjuk.jp>
Reviewed-by: Alexander Lobakin <aleksander.lobakin@intel.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Tested-by: Rafal Romanowski <rafal.romanowski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
This commit is contained in:
parent
636cc3bd12
commit
b848521701
1 changed files with 16 additions and 1 deletions
|
|
@ -2793,7 +2793,22 @@ static void iavf_init_config_adapter(struct iavf_adapter *adapter)
|
|||
netdev->watchdog_timeo = 5 * HZ;
|
||||
|
||||
netdev->min_mtu = ETH_MIN_MTU;
|
||||
netdev->max_mtu = LIBIE_MAX_MTU;
|
||||
|
||||
/* PF/VF API: vf_res->max_mtu is max frame size (not MTU).
|
||||
* Convert to MTU.
|
||||
*/
|
||||
if (!adapter->vf_res->max_mtu) {
|
||||
netdev->max_mtu = LIBIE_MAX_MTU;
|
||||
} else if (adapter->vf_res->max_mtu < LIBETH_RX_LL_LEN + ETH_MIN_MTU ||
|
||||
adapter->vf_res->max_mtu >
|
||||
LIBETH_RX_LL_LEN + LIBIE_MAX_MTU) {
|
||||
netdev_warn_once(adapter->netdev,
|
||||
"invalid max frame size %d from PF, using default MTU %d",
|
||||
adapter->vf_res->max_mtu, LIBIE_MAX_MTU);
|
||||
netdev->max_mtu = LIBIE_MAX_MTU;
|
||||
} else {
|
||||
netdev->max_mtu = adapter->vf_res->max_mtu - LIBETH_RX_LL_LEN;
|
||||
}
|
||||
|
||||
if (!is_valid_ether_addr(adapter->hw.mac.addr)) {
|
||||
dev_info(&pdev->dev, "Invalid MAC address %pM, using random\n",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue