[PATCH v2 4/4] net/hns3: use stdatomic API

Ferruh Yigit ferruh.yigit at amd.com
Fri Dec 8 10:54:12 CET 2023


On 12/8/2023 7:24 AM, Jie Hai wrote:
> On 2023/12/8 1:42, Ferruh Yigit wrote:
>> On 12/7/2023 1:57 PM, Ferruh Yigit wrote:
>>> On 12/7/2023 1:42 AM, Jie Hai wrote:
>>>> Replace the use of gcc builtin __atomic_xxx intrinsics with
>>>> corresponding rte_atomic_xxx optional stdatomic API.
>>>>
>>>> Signed-off-by: Jie Hai <haijie1 at huawei.com>
>>>>
>>>
>>> <...>
>>>
>>>>   static void
>>>> @@ -643,8 +643,8 @@ hns3vf_get_push_lsc_cap(struct hns3_hw *hw)
>>>>       uint16_t exp = HNS3_PF_PUSH_LSC_CAP_UNKNOWN;
>>>>       struct hns3_vf *vf = HNS3_DEV_HW_TO_VF(hw);
>>>>   -    __atomic_store_n(&vf->pf_push_lsc_cap,
>>>> HNS3_PF_PUSH_LSC_CAP_UNKNOWN,
>>>> -             __ATOMIC_RELEASE);
>>>> +    rte_atomic_load_explicit(&vf->pf_push_lsc_cap,
>>>> +        HNS3_PF_PUSH_LSC_CAP_UNKNOWN, rte_memory_order_release);
>>>>   
>>>
>>> I guess intension here is to use 'rte_atomic_store_explicit()', current
>>> code cause a build error [1].
>>>
>>> [1]
>>> https://mails.dpdk.org/archives/test-report/2023-December/525759.html
>>>
>>>
>> Another build error is when stdatomic enabled [2].
>>
>> [2]
>> meson setup --werror -Denable_stdatomic=true build && ninja -C build
>>
>>
> Hi,Ferruh,
> 
> Thanks, and I will fix it.
> 
> Since both the following two patches[1][2](in different patchsets) uses
> __atomic_XXX,
> I will keep using __atomic_XX in the patches first.
> After the two patches are accepted, resend the fixed patch[3]
> and change all __atomic_XX to rte_atomic_XXX.
> 

ack

> [1][PATCH] net/hns3: fix VF multiple count on one reset
> [2][PATCH] net/hns3: refactor handle mailbox function
> [3][PATCH] net/hns3: use stdatomic API
> 
> Best regards,
> Jie Hai



More information about the dev mailing list