Hi,

> -----Original Message-----
> From: Tyler Retzlaff <[email protected]>
> Sent: Tuesday, May 7, 2024 1:58 AM
> To: [email protected]
> Cc: Mattias Rönnblom <[email protected]>; Morten Brørup
> <[email protected]>; Sevincer, Abdullah
> <[email protected]>; Ajit Khaparde
> <[email protected]>; Alok Prasad <[email protected]>;
> Burakov, Anatoly <[email protected]>; Andrew Rybchenko
> <[email protected]>; Anoob Joseph <[email protected]>;
> Richardson, Bruce <[email protected]>; Marohn, Byron
> <[email protected]>; Chenbo Xia <[email protected]>;
> Chengwen Feng <[email protected]>; Loftus, Ciara
> <[email protected]>; Power, Ciara <[email protected]>; Dariusz
> Sosnowski <[email protected]>; Hunt, David <[email protected]>;
> Devendra Singh Rawat <[email protected]>; Carrillo, Erik G
> <[email protected]>; Guoyang Zhou <[email protected]>;
> Harman Kalra <[email protected]>; Van Haaren, Harry
> <[email protected]>; Nagarahalli, Honnappa
> <[email protected]>; Jakub Grajciar <[email protected]>;
> Jerin Jacob <[email protected]>; Jeroen de Borst <[email protected]>;
> Jian Wang <[email protected]>; Jiawen Wu
> <[email protected]>; Jie Hai <[email protected]>; Wu, Jingjing
> <[email protected]>; Joshua Washington <[email protected]>;
> Joyce Kong <[email protected]>; Guo, Junfeng
> <[email protected]>; Laatz, Kevin <[email protected]>; Konstantin
> Ananyev <[email protected]>; Liang Ma
> <[email protected]>; Long Li <[email protected]>; Maciej Czekaj
> <[email protected]>; Matan Azrad <[email protected]>; Maxime
> Coquelin <[email protected]>; Chautru, Nicolas
> <[email protected]>; Ori Kam <[email protected]>; Pavan Nikhilesh
> <[email protected]>; Mccarthy, Peter
> <[email protected]>; Rahul Lakkireddy
> <[email protected]>; Pattan, Reshma
> <[email protected]>; Xu, Rosen <[email protected]>; Ruifeng
> Wang <[email protected]>; Rushil Gupta <[email protected]>;
> Gobriel, Sameh <[email protected]>; Sivaprasad Tummala
> <[email protected]>; Somnath Kotur
> <[email protected]>; Stephen Hemminger
> <[email protected]>; Suanming Mou
> <[email protected]>; Sunil Kumar Kori <[email protected]>; Sunil
> Uttarwar <[email protected]>; Tetsuya Mukawa
> <[email protected]>; Vamsi Attunuru <[email protected]>;
> Viacheslav Ovsiienko <[email protected]>; Medvedkin, Vladimir
> <[email protected]>; Xiaoyun Wang
> <[email protected]>; Wang, Yipeng1
> <[email protected]>; Yisen Zhuang <[email protected]>;
> Ziyang Xuan <[email protected]>; Tyler Retzlaff
> <[email protected]>
> Subject: [PATCH v5 22/45] raw/ifpga: use rte stdatomic API
> 
> Replace the use of gcc builtin __atomic_xxx intrinsics with corresponding
> rte_atomic_xxx optional rte stdatomic API.
> 
> Signed-off-by: Tyler Retzlaff <[email protected]>
> Acked-by: Stephen Hemminger <[email protected]>
> ---
>  drivers/raw/ifpga/ifpga_rawdev.c | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/raw/ifpga/ifpga_rawdev.c
> b/drivers/raw/ifpga/ifpga_rawdev.c
> index f89bd3f..78d3c88 100644
> --- a/drivers/raw/ifpga/ifpga_rawdev.c
> +++ b/drivers/raw/ifpga/ifpga_rawdev.c
> @@ -73,7 +73,7 @@
> 
>  static struct ifpga_rawdev ifpga_rawdevices[IFPGA_RAWDEV_NUM];
> 
> -static int ifpga_monitor_refcnt;
> +static RTE_ATOMIC(int) ifpga_monitor_refcnt;
>  static rte_thread_t ifpga_monitor_start_thread;
> 
>  static struct ifpga_rawdev *
> @@ -512,7 +512,7 @@ static int set_surprise_link_check_aer(
>       int gsd_enable, ret;
>  #define MS 1000
> 
> -     while (__atomic_load_n(&ifpga_monitor_refcnt,
> __ATOMIC_RELAXED)) {
> +     while (rte_atomic_load_explicit(&ifpga_monitor_refcnt,
> +rte_memory_order_relaxed)) {
>               gsd_enable = 0;
>               for (i = 0; i < IFPGA_RAWDEV_NUM; i++) {
>                       ifpga_rdev = &ifpga_rawdevices[i];
> @@ -549,7 +549,7 @@ static int set_surprise_link_check_aer(
> 
>       dev->poll_enabled = 1;
> 
> -     if (!__atomic_fetch_add(&ifpga_monitor_refcnt, 1,
> __ATOMIC_RELAXED)) {
> +     if (!rte_atomic_fetch_add_explicit(&ifpga_monitor_refcnt, 1,
> +rte_memory_order_relaxed)) {
>               ret =
> rte_thread_create_internal_control(&ifpga_monitor_start_thread,
>                               "ifpga-mon", ifpga_rawdev_gsd_handle,
> NULL);
>               if (ret != 0) {
> @@ -573,7 +573,8 @@ static int set_surprise_link_check_aer(
> 
>       dev->poll_enabled = 0;
> 
> -     if (!(__atomic_fetch_sub(&ifpga_monitor_refcnt, 1,
> __ATOMIC_RELAXED) - 1) &&
> +     if (!(rte_atomic_fetch_sub_explicit(&ifpga_monitor_refcnt, 1,
> +         rte_memory_order_relaxed) - 1) &&
>               ifpga_monitor_start_thread.opaque_id != 0) {
>               ret =
> pthread_cancel((pthread_t)ifpga_monitor_start_thread.opaque_id);
>               if (ret)
> --
> 1.8.3.1

Reviewed-by: Rosen Xu <[email protected]>

Reply via email to