From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 5B0F4A328D
	for <public@inbox.dpdk.org>; Wed, 23 Oct 2019 06:57:16 +0200 (CEST)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id 985771BF46;
	Wed, 23 Oct 2019 06:57:15 +0200 (CEST)
Received: from mail-io1-f65.google.com (mail-io1-f65.google.com
 [209.85.166.65]) by dpdk.org (Postfix) with ESMTP id A92501BF3E
 for <dev@dpdk.org>; Wed, 23 Oct 2019 06:57:13 +0200 (CEST)
Received: by mail-io1-f65.google.com with SMTP id i26so14014388iog.9
 for <dev@dpdk.org>; Tue, 22 Oct 2019 21:57:13 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=e0ipKtzpX3iNcw+8Fr8jaNCjl0GjRcVU6tLIAoixzdA=;
 b=gsPKkA4Oe45WjfhRxAp9lBpCdKgY21nhvaS7nqNJit9fZXkzDmBUwJ5IbwQ5b8Oec5
 ACfywEDU/pI2V/TrZEWXxFCmaGgDVlrsXF8m+2aakehOtU/Xluv0xHG1u3hAT4WSkzUb
 POjmv5q9Q7wA5aYMFN5+ovBOm7ojLL/3JHlgQ//eprl8JGi+8kfvKdnpvta4cA0heZmU
 hzMSIXUZ1VyBeXsVS5wX87V9bmaMoWMtuudDWuCAOqPf2Z1xIQ3h3PVN0IB7QWHlDxtR
 g1gjdAjEAtX330rEyzadk91b1CupLfD+XKi3ehdi7AQ2hOmcWYnddSwBG3WMFmVR0nCA
 A3mQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=e0ipKtzpX3iNcw+8Fr8jaNCjl0GjRcVU6tLIAoixzdA=;
 b=WObXU2JTdSomBfETbhcrEBhrNWAi7UFGWGT7lffVYO7uQOM6sQkXY44UOZkbxUDik+
 s3p6XPxVHBNPCac1RxmlzqnoET0POiN8SGjpX/Oso//bu/gpGLgt8Ro+p2/1ocF/D8Ov
 cQOU5skMejCbcp1Ea6I+P28vDGGYAq+WtvdM/Z60hQmKE2SDcSovhlprwLnpxP0zL2T4
 vJtTcqaoPeN6KjUAojKhmKUdTOcEd5kH0ydDfoqtaaWyIkq3kBz/HgosI93z9juonort
 qLUg3eMRAgjFf3iI2zRck3A7mvCh+kpJbKCtBVtomlmyTLh4B/puB7VdEbPQj5E+MCh4
 COdg==
X-Gm-Message-State: APjAAAV6xBWQ3Rlz1+sP6NljFetYRYMXBg7TcIipu8FySnYI2crdDkbf
 BYsKxAenQIAarOGrJDPGdqIWZ/szZXHTra0BYMQ=
X-Google-Smtp-Source: APXvYqyi8EUWtug3x0Klhcq1t43tWwiGGgCYh49CeVDQh0/u2S6/AwCZ8ofFbeFJw5rLgoykkOCZbh8cKibiZS/R87k=
X-Received: by 2002:a02:c6c4:: with SMTP id r4mr7543226jan.60.1571806632890;
 Tue, 22 Oct 2019 21:57:12 -0700 (PDT)
MIME-Version: 1.0
References: <1571125801-45773-1-git-send-email-joyce.kong@arm.com>
 <1571799298-18873-1-git-send-email-joyce.kong@arm.com>
 <1571799298-18873-2-git-send-email-joyce.kong@arm.com>
In-Reply-To: <1571799298-18873-2-git-send-email-joyce.kong@arm.com>
From: Jerin Jacob <jerinjacobk@gmail.com>
Date: Wed, 23 Oct 2019 10:26:56 +0530
Message-ID: <CALBAE1Mnr_znhNJnxLQCmUtVnkugswSHNdxAi3AEKq5Yc+X4qw@mail.gmail.com>
To: Joyce Kong <joyce.kong@arm.com>
Cc: dpdk-dev <dev@dpdk.org>, nd <nd@arm.com>,
 Thomas Monjalon <thomas@monjalon.net>, Jerin Jacob <jerinj@marvell.com>,
 Stephen Hemminger <stephen@networkplumber.org>, 
 mb@smartsharesystems.com, Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>, 
 Gavin Hu <gavin.hu@arm.com>, ravi1.kumar@amd.com,
 Rasesh Mody <rmody@marvell.com>, 
 Shahed Shaikh <shshaikh@marvell.com>, Ziyang Xuan <xuanziyang2@huawei.com>, 
 Xiaoyun Wang <cloud.wangxiaoyun@huawei.com>,
 Guoyang Zhou <zhouguoyang@huawei.com>
Content-Type: text/plain; charset="UTF-8"
Subject: Re: [dpdk-dev] [PATCH v2 1/6] lib/eal: implement the family of rte
 bit operation APIs
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>

On Wed, Oct 23, 2019 at 8:25 AM Joyce Kong <joyce.kong@arm.com> wrote:
>
> There are a lot functions of bit operations scattered and
> duplicated in PMDs, consolidating them into a common API
> family is necessary. Furthermore, the bit operation is
> mostly applied to the IO devices, so use __ATOMIC_ACQ_REL
> to ensure the ordering.
>
> Signed-off-by: Joyce Kong <joyce.kong@arm.com>
> Reviewed-by: Gavin Hu <gavin.hu@arm.com>
> ---
>  lib/librte_eal/common/Makefile                |   1 +
>  lib/librte_eal/common/include/rte_io_bitops.h | 112 ++++++++++++++++++++++++++
>  lib/librte_eal/common/meson.build             |   1 +


Missing doc/api/doxy-api-index.md update

>  3 files changed, 114 insertions(+)
>  create mode 100644 lib/librte_eal/common/include/rte_io_bitops.h
>

> +
> +/**
> + * Get a bit.
> + *
> + * @param nr
> + *   The bit to get.
> + * @param addr
> + *   The address to count from.
> + * @return
> + *   The value of the bit.
> + */
> +static inline int32_t

Missing __rte_experimental

> +rte_io_get_bit(uint32_t nr, uint64_t *addr)
> +{
> +       return __atomic_load_n(addr, __ATOMIC_ACQUIRE) & (1UL << nr);
> +}
> +