mirror of
https://github.com/torvalds/linux.git
synced 2026-05-30 18:13:41 +02:00
IB/core: Updating cache for subnet_prefix in config_non_roce_gid_cache()
Currently, cache for subnet_prefix was getting updated by reading port attributes via ib_query_port. ib_query_port() calls ops.query_gid() to get subnet_prefix and returns it via port_attr. In ib_cache_update(), config_non_roce_gid_cache() obtains GIDs by calling ops.query_gid(). We utilize this to store subnet_prefix in cache. Link: https://lore.kernel.org/r/20210712122625.1147-2-anand.a.khoje@oracle.com Suggested-by: Jason Gunthorpe <jgg@nvidia.com> Suggested-by: Aru Kolappan <aru.kolappan@oracle.com> Signed-off-by: Anand Khoje <anand.a.khoje@oracle.com> Signed-off-by: Haakon Bugge <haakon.bugge@oracle.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
This commit is contained in:
parent
8c1b4316c3
commit
0bc0602ae8
|
|
@ -1429,7 +1429,7 @@ int rdma_read_gid_l2_fields(const struct ib_gid_attr *attr,
|
|||
EXPORT_SYMBOL(rdma_read_gid_l2_fields);
|
||||
|
||||
static int config_non_roce_gid_cache(struct ib_device *device,
|
||||
u32 port, int gid_tbl_len)
|
||||
u32 port, struct ib_port_attr *tprops)
|
||||
{
|
||||
struct ib_gid_attr gid_attr = {};
|
||||
struct ib_gid_table *table;
|
||||
|
|
@ -1441,7 +1441,7 @@ static int config_non_roce_gid_cache(struct ib_device *device,
|
|||
table = rdma_gid_table(device, port);
|
||||
|
||||
mutex_lock(&table->lock);
|
||||
for (i = 0; i < gid_tbl_len; ++i) {
|
||||
for (i = 0; i < tprops->gid_tbl_len; ++i) {
|
||||
if (!device->ops.query_gid)
|
||||
continue;
|
||||
ret = device->ops.query_gid(device, port, i, &gid_attr.gid);
|
||||
|
|
@ -1452,6 +1452,8 @@ static int config_non_roce_gid_cache(struct ib_device *device,
|
|||
goto err;
|
||||
}
|
||||
gid_attr.index = i;
|
||||
tprops->subnet_prefix =
|
||||
be64_to_cpu(gid_attr.gid.global.subnet_prefix);
|
||||
add_modify_gid(table, &gid_attr);
|
||||
}
|
||||
err:
|
||||
|
|
@ -1484,7 +1486,7 @@ ib_cache_update(struct ib_device *device, u32 port, bool update_gids,
|
|||
|
||||
if (!rdma_protocol_roce(device, port) && update_gids) {
|
||||
ret = config_non_roce_gid_cache(device, port,
|
||||
tprops->gid_tbl_len);
|
||||
tprops);
|
||||
if (ret)
|
||||
goto err;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user