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 5B0F4A328D for ; 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 ; Wed, 23 Oct 2019 06:57:13 +0200 (CEST) Received: by mail-io1-f65.google.com with SMTP id i26so14014388iog.9 for ; 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 Date: Wed, 23 Oct 2019 10:26:56 +0530 Message-ID: To: Joyce Kong Cc: dpdk-dev , nd , Thomas Monjalon , Jerin Jacob , Stephen Hemminger , mb@smartsharesystems.com, Honnappa Nagarahalli , Gavin Hu , ravi1.kumar@amd.com, Rasesh Mody , Shahed Shaikh , Ziyang Xuan , Xiaoyun Wang , Guoyang Zhou 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Wed, Oct 23, 2019 at 8:25 AM Joyce Kong 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 > Reviewed-by: Gavin Hu > --- > 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); > +} > +