From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id B44B1A04B5; Tue, 27 Oct 2020 16:29:40 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 817A3AA1F; Tue, 27 Oct 2020 16:28:41 +0100 (CET) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id B2B406CAC for ; Tue, 27 Oct 2020 16:28:33 +0100 (CET) Received: from Internal Mail-Server by MTLPINE1 (envelope-from akozyrev@nvidia.com) with SMTP; 27 Oct 2020 17:28:29 +0200 Received: from nvidia.com (pegasus02.mtr.labs.mlnx [10.210.16.122]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 09RFSSec029461; Tue, 27 Oct 2020 17:28:28 +0200 From: Alexander Kozyrev To: dev@dpdk.org Cc: rasland@nvidia.com, matan@nvidia.com, viacheslavo@nvidia.com Date: Tue, 27 Oct 2020 15:28:22 +0000 Message-Id: <20201027152824.15232-3-akozyrev@nvidia.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20201027152824.15232-1-akozyrev@nvidia.com> References: <20201027152824.15232-1-akozyrev@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH 2/4] common/mlx5: use C11 atomics for netlink sequence X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The rte_atomic API is deprecated and needs to be replaced with C11 atomic builtins. Use __atomic_add_fetch instead of rte_atomic32_add_return to generate a Netlink sequence number. Signed-off-by: Alexander Kozyrev Acked-by: Viacheslav Ovsiienko --- drivers/common/mlx5/linux/mlx5_nl.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/common/mlx5/linux/mlx5_nl.c b/drivers/common/mlx5/linux/mlx5_nl.c index 0ecd9c7014..40d8620300 100644 --- a/drivers/common/mlx5/linux/mlx5_nl.c +++ b/drivers/common/mlx5/linux/mlx5_nl.c @@ -18,7 +18,6 @@ #include #include -#include #include "mlx5_nl.h" #include "mlx5_common_utils.h" @@ -169,10 +168,10 @@ struct mlx5_nl_ifindex_data { uint32_t portnum; /**< IB device max port number (out). */ }; -rte_atomic32_t atomic_sn = RTE_ATOMIC32_INIT(0); +uint32_t atomic_sn; /* Generate Netlink sequence number. */ -#define MLX5_NL_SN_GENERATE ((uint32_t)rte_atomic32_add_return(&atomic_sn, 1)) +#define MLX5_NL_SN_GENERATE __atomic_add_fetch(&atomic_sn, 1, __ATOMIC_RELAXED) /** * Opens a Netlink socket. -- 2.24.1