lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <012d6cd2-5167-ed81-80db-444fd2741ea8@oracle.com>
Date:   Wed, 23 Jun 2021 18:33:32 +0530
From:   Anand Khoje <anand.a.khoje@...cle.com>
To:     Jason Gunthorpe <jgg@...dia.com>
Cc:     linux-rdma@...r.kernel.org, linux-kernel@...r.kernel.org,
        dledford@...hat.com, haakon.bugge@...cle.com, leon@...nel.org
Subject: Re: [PATCH v5 for-next 3/3] IB/core: Obtain subnet_prefix from cache
 in IB devices

On 6/22/2021 5:19 AM, Jason Gunthorpe wrote:
> 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..
> 
Hi Jason,

We have opted for rdma_query_gid(), as during ib_cache_update() the code 
calls ops.query_gid() earlier in config_non_roce_gid_cache(), thereby 
updating the value of GID in cache. We utilize this updated value, 
instead of calling ops->query_gid() again.

  	I'm not sure all the additional tests will pass,
  	the 0 gid entry is not required to be valid..

To get subnet_prefix __ib_query_port() does indeed obtain zero index GID.

https://elixir.bootlin.com/linux/v5.13-rc5/source/drivers/infiniband/core/device.c#L2067

>> @@ -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
> 

During device load and when cache is yet to be updated, ib_query_port() 
should have a mechanism to identify if the cache entry is valid or 
invalid (uninitialized), we have added this variable just to ensure the 
validity of cache.

Thanks,
Anand

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ