From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4D807436A6; Fri, 8 Dec 2023 08:24:23 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3AC3A42F04; Fri, 8 Dec 2023 08:24:23 +0100 (CET) Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by mails.dpdk.org (Postfix) with ESMTP id 3D3E242E8D for ; Fri, 8 Dec 2023 08:24:21 +0100 (CET) Received: from kwepemd100004.china.huawei.com (unknown [172.30.72.55]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4SmjGN5lphzsRSJ; Fri, 8 Dec 2023 15:20:28 +0800 (CST) Received: from [10.67.121.175] (10.67.121.175) by kwepemd100004.china.huawei.com (7.221.188.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.2.1258.28; Fri, 8 Dec 2023 15:24:18 +0800 Message-ID: Date: Fri, 8 Dec 2023 15:24:17 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH v2 4/4] net/hns3: use stdatomic API To: Ferruh Yigit , , Yisen Zhuang CC: , , References: <20231111015915.2776769-1-haijie1@huawei.com> <20231207014205.4002558-1-haijie1@huawei.com> <20231207014205.4002558-5-haijie1@huawei.com> <649e3352-fbb7-4ff9-b03d-52ef39abbc37@amd.com> From: Jie Hai In-Reply-To: <649e3352-fbb7-4ff9-b03d-52ef39abbc37@amd.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.67.121.175] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemd100004.china.huawei.com (7.221.188.31) X-CFilter-Loop: Reflected X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 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 >>> >> >> <...> >> >>> 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. [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