Re: [PATCH v5 for-next 3/3] IB/core: Obtain subnet_prefix from cache in IB devices

From: Jason Gunthorpe
Date: Mon Jun 21 2021 - 19:49:19 EST


On Wed, Jun 16, 2021 at 09:15:09PM +0530, Anand Khoje wrote:
>
> @@ -1523,13 +1524,21 @@ static int config_non_roce_gid_cache(struct ib_device *device,
> device->port_data[port].cache.lmc = tprops->lmc;
> device->port_data[port].cache.port_state = tprops->state;
>
> - device->port_data[port].cache.subnet_prefix = tprops->subnet_prefix;
> + ret = rdma_query_gid(device, port, 0, &gid);
> + if (ret) {

This is quite a bit different than just calling ops.query_gid() - why
are you changing it? I'm not sure all the additional tests will pass,
the 0 gid entry is not required to be valid..

> @@ -1629,6 +1638,7 @@ int ib_cache_setup_one(struct ib_device *device)
> err = ib_cache_update(device, p, true, true, true);
> if (err)
> return err;
> + device->port_data[p].cache_is_initialized = 1;
> }

And I would much prefer things be re-organized so the cache can be
valid sooner to adding this variable. What is the earlier call that is
motivating this?

Jason