diff options
author | Junxian Huang <huangjunxian6@hisilicon.com> | 2023-10-17 14:52:39 +0200 |
---|---|---|
committer | Leon Romanovsky <leon@kernel.org> | 2023-10-19 08:49:40 +0200 |
commit | 07f06e0e5cd99555c861e874716d9e2627655fd5 (patch) | |
tree | f0943c513b4c90abfff3b54761644a1475ada443 /include | |
parent | RDMA/hns: Fix unnecessary port_num transition in HW stats allocation (diff) | |
download | linux-07f06e0e5cd99555c861e874716d9e2627655fd5.tar.xz linux-07f06e0e5cd99555c861e874716d9e2627655fd5.zip |
RDMA/hns: Fix init failure of RoCE VF and HIP08
During device init, a struct for HW stats will be allocated. As HW
stats are not supported for VF and HIP08, currently
hns_roce_alloc_hw_port_stats() returns NULL in this case. However,
ib-core considers the returned NULL pointer as memory allocation
failure and returns ENOMEM, eventually leading to the failure of VF
and HIP08 init.
In the case where the driver does not support the .alloc_hw_port_stats()
ops, ib-core will return EOPNOTSUPP and ignore this error code in the
upper layer function. So for VF and HIP08, just don't set the HW stats
ops to ib-core.
Fixes: 5a87279591a1 ("RDMA/hns: Support hns HW stats")
Signed-off-by: Junxian Huang <huangjunxian6@hisilicon.com>
Link: https://lore.kernel.org/r/20231017125239.164455-8-huangjunxian6@hisilicon.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions