Re: [PATCH v3 3/3] IB/core: Obtain subnet_prefix from cache in IB devices.

From: Haakon Bugge
Date: Mon Jun 14 2021 - 12:29:18 EST




> On 14 Jun 2021, at 09:25, Leon Romanovsky <leon@xxxxxxxxxx> wrote:
>
> On Mon, Jun 14, 2021 at 03:32:39AM +0000, Haakon Bugge wrote:
>>
>>
>>> On 9 Jun 2021, at 12:40, Leon Romanovsky <leon@xxxxxxxxxx> wrote:
>>>
>>> On Wed, Jun 09, 2021 at 09:26:03AM +0000, Anand Khoje wrote:
>>>> Hi Leon,
>>>
>>> Please don't do top-posting.
>>>
>>>
>>>>
>>>> The set_bit()/clear_bit() and enum ib_port_data_flags has been added as a device that can be used for future enhancements.
>>>> Also, usage of set_bit()/clear_bit() ensures the operations on this bit is atomic.
>>>
>>> The bitfield variables are better suit this use case.
>>> Let's don't overcomplicate code without the reason.
>>
>> The problem is always that people tend to build on what's in there. For example, look at the bitfields in rdma_id_private, tos_set, timeout_set, and min_rnr_timer_set.
>>
>> What do you think will happen when, let's say, rdma_set_service_type() and rdma_set_ack_timeout() are called in close proximity in time? There is no locking, and the RMW will fail intermittently.
>
> We are talking about device initialization flow that shouldn't be
> performed in parallel to another initialization of same device, so the
> comparison to rdma-cm is not valid here.

I can agree to that. And it is probably not worthwhile to fix the bit-fields in rdma_id_private?


Thxs, Håkon