aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/core/cache.c
diff options
context:
space:
mode:
authorParav Pandit <parav@mellanox.com>2018-03-25 13:40:23 +0300
committerJason Gunthorpe <jgg@mellanox.com>2018-03-27 16:22:12 -0600
commit190fb9c4d130f23b64d73e9921afb9a502340455 (patch)
tree851b93f4055ca8a6ebbeea57ffd73b6da3db3057 /drivers/infiniband/core/cache.c
parentIB/core: Search GID only for IB link layer (diff)
downloadlinux-dev-190fb9c4d130f23b64d73e9921afb9a502340455.tar.xz
linux-dev-190fb9c4d130f23b64d73e9921afb9a502340455.zip
IB/core: Refer to RoCE port property to decide building cache
IB core maintains the GID cache entries for the GID table. This cache table has to be maintained regardless of HCA's support of GID table. For IB and iWarp ports, cache is created by querying the HCA. For RoCE cache is created based on netdev events. Therefore just refer to the RoCE port property of the {device, port} to decide whether to build cache by querying HCA or from netdev events. There is no need to check if HCA support GID table or not. ib_cache_update() referred to RoCE attribute before validating port. Though in all current callers port is valid, it is incorrect to query RoCE port property before validating the port. Therefore, rdma_protocol_roce() check is done after rdma_is_port_valid() verifies that port is valid. Fixes: 115b68aa6ea4 ("IB/ocrdma: Removed GID add/del null routines") Reviewed-by: Daniel Jurgens <danielj@mellanox.com> Signed-off-by: Parav Pandit <parav@mellanox.com> Signed-off-by: Leon Romanovsky <leonro@mellanox.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'drivers/infiniband/core/cache.c')
-rw-r--r--drivers/infiniband/core/cache.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/infiniband/core/cache.c b/drivers/infiniband/core/cache.c
index b94f8d1b262f..552f3c8dc246 100644
--- a/drivers/infiniband/core/cache.c
+++ b/drivers/infiniband/core/cache.c
@@ -1070,12 +1070,12 @@ static void ib_cache_update(struct ib_device *device,
int i;
int ret;
struct ib_gid_table *table;
- bool use_roce_gid_table =
- rdma_cap_roce_gid_table(device, port);
+ bool use_roce_gid_table;
if (!rdma_is_port_valid(device, port))
return;
+ use_roce_gid_table = rdma_protocol_roce(device, port);
table = device->cache.ports[port - rdma_start_port(device)].gid;
tprops = kmalloc(sizeof *tprops, GFP_KERNEL);