On 3/13/23 16:19, Ilya Maximets wrote:
> On 3/13/23 15:55, Dumitru Ceara wrote:
>> CC: Ilya (I had messed up his email address initially by accident)
>>
>> On 3/13/23 15:53, Dumitru Ceara wrote:
>>> ATOMIC_VAR_INIT has been removed in OVS since
>>> https://github.com/openvswitch/ovs/commit/71ca8393b700 because it has a
>>> trivial definition and was deprecated (to be removed) in newer
>>> standards.
>>>
>>> Stop using it in OVN too.
>>>
>>> Reported-at: 
>>> https://github.com/ovn-org/ovn/actions/runs/4394882419/jobs/7696233921#step:13:3361
>>> Signed-off-by: Dumitru Ceara <[email protected]>
>>> ---
>>>  lib/ovn-parallel-hmap.c | 4 ++--
>>>  northd/northd.c         | 4 ++--
>>>  2 files changed, 4 insertions(+), 4 deletions(-)
>>>
>>> diff --git a/lib/ovn-parallel-hmap.c b/lib/ovn-parallel-hmap.c
>>> index 828e5a0e2f..a2326740af 100644
>>> --- a/lib/ovn-parallel-hmap.c
>>> +++ b/lib/ovn-parallel-hmap.c
>>> @@ -41,7 +41,7 @@ VLOG_DEFINE_THIS_MODULE(ovn_parallel_hmap);
>>>  #define WORKER_SEM_NAME "%x-%p-%"PRIxSIZE
>>>  #define MAIN_SEM_NAME "%x-%p-main"
>>>  
>>> -static atomic_bool initial_pool_setup = ATOMIC_VAR_INIT(false);
>>> +static atomic_bool initial_pool_setup = false;
>>>  
>>>  /* This is set only in the process of exit and the set is
>>>   * accompanied by a fence. It does not need to be atomic or be
>>> @@ -156,7 +156,7 @@ init_controls(struct worker_pool *pool)
>>>          new_control->pool = pool;
>>>          new_control->worker = 0;
>>>          ovs_mutex_init(&new_control->mutex);
>>> -        new_control->finished = ATOMIC_VAR_INIT(false);
>>> +        new_control->finished = false;
> 
> Please, use the atomic_init() instead.  It's not really a point of definition
> (test code in OVS is using this type of initialization, but I don't think
> it is actually correct).
> 

Good point, thanks for the review.  I posted v2.

>>>          sprintf(sem_name, WORKER_SEM_NAME, sembase, pool, i);
>>>          new_control->fire = sem_open(sem_name, O_CREAT, S_IRWXU, 0);
>>>          if (new_control->fire == SEM_FAILED) {
>>> diff --git a/northd/northd.c b/northd/northd.c
>>> index fda02c3240..83c092787f 100644
>>> --- a/northd/northd.c
>>> +++ b/northd/northd.c
>>> @@ -1069,8 +1069,8 @@ init_mcast_flow_count(struct ovn_datapath *od)
>>>      }
>>>  
>>>      struct mcast_switch_info *mcast_sw_info = &od->mcast_info.sw;
>>> -    mcast_sw_info->active_v4_flows = ATOMIC_VAR_INIT(0);
>>> -    mcast_sw_info->active_v6_flows = ATOMIC_VAR_INIT(0);
>>> +    mcast_sw_info->active_v4_flows = 0;
>>> +    mcast_sw_info->active_v6_flows = 0;
> 
> Same here.
> 
>>>  }
>>>  
>>>  static void
>>
> 

Thanks,
Dumitru

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to