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 DF393A04C1; Wed, 20 Nov 2019 11:12:26 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6DFFF2C36; Wed, 20 Nov 2019 11:12:26 +0100 (CET) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by dpdk.org (Postfix) with ESMTP id D59D42BA3 for ; Wed, 20 Nov 2019 11:12:24 +0100 (CET) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 3FB3F1FB; Wed, 20 Nov 2019 02:12:24 -0800 (PST) Received: from net-arm-thunderx2-01.test.ast.arm.com (net-arm-thunderx2-01.shanghai.arm.com [10.169.40.40]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 8CBFE3F52E; Wed, 20 Nov 2019 02:12:20 -0800 (PST) From: Joyce Kong To: dev@dpdk.org Cc: nd@arm.com, thomas@monjalon.net, jerinj@marvell.com, stephen@networkplumber.org, mb@smartsharesystems.com, david.marchand@redhat.com, honnappa.nagarahalli@arm.com, gavin.hu@arm.com, ravi1.kumar@amd.com, rmody@marvell.com, shshaikh@marvell.com, xuanziyang2@huawei.com, cloud.wangxiaoyun@huawei.com, zhouguoyang@huawei.com Date: Wed, 20 Nov 2019 18:12:01 +0800 Message-Id: <1574244727-6003-1-git-send-email-joyce.kong@arm.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 In-Reply-To: <1571125801-45773-1-git-send-email-joyce.kong@arm.com> References: <1571125801-45773-1-git-send-email-joyce.kong@arm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v4 0/6] implement common rte bit operation APIs in PMDs 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" There are a lot functions of bit operations scattered in PMDs, consolidate them into a common API family and applied in different PMDs to reduce code duplication. v4: Introduce uint32_t/uint64_t *addr when definiting bit operation APIs(suggested by Morten Brørup). v3: 1. Change the API's head file back to rte_bitops.h, then implement both 32-bit and 64-bit operations with and without C11 atomic memory ordering. 2. Add multi-core test case for bit operations which implemented with memory ordering. 3. Modify the doc of both APIs and test cases. v2: 1. Add doxygen comments for the rte bit operation API(suggested by Stephen Hemminger). 2. Add test cases for common rte bit operation API(suggested by Stephen Hemminger). 3. Change the header file to rte_io_bitops.h and the operation to rte_io_set_bit()etc., as the API uses barriers inside and the barriers are only needed for IO operations (suggested by Jerin Jacob). 4. Use an well defined uint_NN_t type(suggested by Morten Brørup). Joyce Kong (6): lib/eal: implement the family of rte bit operation APIs test/bitops: add bit operation test case net/axgbe: use common rte bit operation APIs instead net/bnx2x: use common rte bit operation APIs instead net/qede: use common rte bit operation APIs instead net/hinic: use common rte bit operation APIs instead MAINTAINERS | 5 + app/test/Makefile | 1 + app/test/autotest_data.py | 6 + app/test/meson.build | 2 + app/test/test_bitops.c | 305 +++++++++++++++++++ doc/api/doxy-api-index.md | 5 +- drivers/net/axgbe/axgbe_common.h | 29 +- drivers/net/axgbe/axgbe_ethdev.c | 14 +- drivers/net/axgbe/axgbe_mdio.c | 14 +- drivers/net/bnx2x/bnx2x.c | 209 ++++++------- drivers/net/bnx2x/bnx2x.h | 4 - drivers/net/bnx2x/ecore_sp.h | 9 +- drivers/net/hinic/Makefile | 1 + drivers/net/hinic/base/hinic_compat.h | 33 +- drivers/net/hinic/hinic_pmd_ethdev.c | 16 +- drivers/net/hinic/meson.build | 2 + drivers/net/qede/base/bcm_osal.c | 20 -- drivers/net/qede/base/bcm_osal.h | 10 +- lib/librte_eal/common/Makefile | 1 + lib/librte_eal/common/include/rte_bitops.h | 474 +++++++++++++++++++++++++++++ lib/librte_eal/common/meson.build | 3 +- 21 files changed, 928 insertions(+), 235 deletions(-) create mode 100644 app/test/test_bitops.c create mode 100644 lib/librte_eal/common/include/rte_bitops.h -- 2.7.4