net/mlx5: Enable host PF HCA after eswitch is initialized
authorParav Pandit <parav@nvidia.com>
Fri, 20 Nov 2020 23:03:38 +0000 (15:03 -0800)
committerSaeed Mahameed <saeedm@nvidia.com>
Fri, 27 Nov 2020 02:45:03 +0000 (18:45 -0800)
commit5bef709d76a28a50a5beaac9f1af1facf66af7f3
tree63c5876f65a4fed42594928255721920ae4f57b3
parent8a90f2fc67826a3876df1cb72e42d4a9a135f4fa
net/mlx5: Enable host PF HCA after eswitch is initialized

Currently ECPF enables external host PF too early in the initialization
sequence for Ethernet links when ECPF is eswitch manager.

Due to this, when external host PF driver is loaded, host PF's HCA CAP has
inner_ip_version supported by NIC RX flow table.
This capability is later updated by firmware after ECPF driver enables
ENCAP/DECAP as eswitch manager.

This results into a timing race condition, where CREATE_TIR command
fails with a below syndrome on host PF.

mlx5_cmd_check:775:(pid 510): CREATE_TIR(0x900) op_mod(0x0) failed,
status bad parameter(0x3), syndrome (0x562b00)

Hence, enable the external host PF after necessary eswitch and per vport
initialization is completed.
Continue to enable host PF when eswitch manager capability is off for a
ECPF.

Signed-off-by: Parav Pandit <parav@nvidia.com>
Reviewed-by: Bodong Wang <bodong@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/ecpf.c
drivers/net/ethernet/mellanox/mlx5/core/ecpf.h
drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
drivers/net/ethernet/mellanox/mlx5/core/main.c