net/ixgbe: fix port initialization if MTU config fails
authorTudor Cornea <tudor.cornea@gmail.com>
Wed, 20 Oct 2021 18:13:46 +0000 (21:13 +0300)
committerQi Zhang <qi.z.zhang@intel.com>
Thu, 21 Oct 2021 02:56:06 +0000 (04:56 +0200)
commit2108930be123ab83c837e7dd6eb3078ec3482ad4
treec9579a708ca00040c30b2242e25b116de09ca3d8
parenta89f6433aa5cb33fc40ab30b92a911f547f21bcb
net/ixgbe: fix port initialization if MTU config fails

On a VMware ESXi 6.0 setup with an Intel 82599 NIC the ports don't
seem to initialize anymore, while running testpmd.

Configuring Port 0 (socket 0)
ixgbevf_dev_rx_init(): Set max packet length to 1518 failed.
ixgbevf_dev_start(): Unable to initialize RX hardware (-22)
Fail to start port 0: Invalid argument
Configuring Port 1 (socket 0)
ixgbevf_dev_rx_init(): Set max packet length to 1518 failed.
ixgbevf_dev_start(): Unable to initialize RX hardware (-22)
Fail to start port 1: Invalid argument
Please stop the ports first

If the call to ixgbevf_rlpml_set_vf fails and we return prematurely,
we will not be able to initialize the ports correctly.

The behavior seems to have changed since the following commit:

Fixes: c77866a16904 ("net/ixgbe: detect failed VF MTU set")
Cc: stable@dpdk.org
We can make this particular use case work correctly if we don't
return an error, which seems to be consistent with the overall
kernel ixgbevf implementation.

[1]
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c?h=v5.14#n2015

Signed-off-by: Tudor Cornea <tudor.cornea@gmail.com>
Acked-by: Haiyue Wang <haiyue.wang@intel.com>
drivers/net/ixgbe/ixgbe_rxtx.c