]> git.baikalelectronics.ru Git - kernel.git/commit
RDMA/mlx4: Read pkey table length instead of hardcoded value
authorMark Bloch <markb@mellanox.com>
Mon, 24 Aug 2020 11:02:29 +0000 (14:02 +0300)
committerJason Gunthorpe <jgg@nvidia.com>
Thu, 27 Aug 2020 12:17:05 +0000 (09:17 -0300)
commitb9648394787aa592f0554e29cdae20cc14dc47a6
treea615927882b56af4edbdc29b8f20b9f1d7ecd276
parent64ef175115f90506dcb0232a0c898d96e515105d
RDMA/mlx4: Read pkey table length instead of hardcoded value

If the pkey_table is not available (which is the case when RoCE is not
supported), the cited commit caused a regression where mlx4_devices
without RoCE are not created.

Fix this by returning a pkey table length of zero in procedure
eth_link_query_port() if the pkey-table length reported by the device is
zero.

Link: https://lore.kernel.org/r/20200824110229.1094376-1-leon@kernel.org
Cc: <stable@vger.kernel.org>
Fixes: 9160ddb92c83 ("IB/core: Fix potential NULL pointer dereference in pkey cache")
Fixes: 2624390d9482 ("IB/mlx4: Add support for IBoE")
Signed-off-by: Mark Bloch <markb@mellanox.com>
Reviewed-by: Maor Gottlieb <maorg@nvidia.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/hw/mlx4/main.c