linux-stable/drivers/infiniband
Jack Wang 0bccc44a54 RDMA/mlx4: Do not fail the registration on port stats
[ Upstream commit 378c67413d ]

If the FW doesn't support MLX4_DEV_CAP_FLAG2_DIAG_PER_PORT, mlx4 driver
will fail the ib_setup_port_attrs, which is called from
ib_register_device()/enable_device_and_get(), in the end leads to device
not detected[1][2]

To fix it, add a new mlx4_ib_hw_stats_ops1, w/o alloc_hw_port_stats if FW
does not support MLX4_DEV_CAP_FLAG2_DIAG_PER_PORT.

[1] https://bugzilla.redhat.com/show_bug.cgi?id=2014094
[2] https://lore.kernel.org/linux-rdma/CAMGffEn2wvEnmzc0xe=xYiCLqpphiHDBxCxqAELrBofbUAMQxw@mail.gmail.com

Fixes: 4b5f4d3fb4 ("RDMA: Split the alloc_hw_stats() ops to port and device variants")
Link: https://lore.kernel.org/r/20211115101519.27210-1-jinpu.wang@ionos.com
Signed-off-by: Jack Wang <jinpu.wang@ionos.com>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-11-25 09:48:39 +01:00
..
core RDMA/core: Set send and receive CQ before forwarding to the driver 2021-11-25 09:48:37 +01:00
hw RDMA/mlx4: Do not fail the registration on port stats 2021-11-25 09:48:39 +01:00
sw RDMA/rxe: Separate HW and SW l/rkeys 2021-11-25 09:48:26 +01:00
ulp SCSI misc on 20210902 2021-09-02 15:09:46 -07:00
Kconfig RDMA/irdma: Add irdma Kconfig/Makefile and remove i40iw 2021-06-02 20:06:36 -03:00
Makefile