get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/63160/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 63160,
    "url": "http://patches.dpdk.org/api/patches/63160/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1574244727-6003-7-git-send-email-joyce.kong@arm.com/",
    "project": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<1574244727-6003-7-git-send-email-joyce.kong@arm.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1574244727-6003-7-git-send-email-joyce.kong@arm.com",
    "date": "2019-11-20T10:12:07",
    "name": "[v4,6/6] net/hinic: use common rte bit operation APIs instead",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "0ce30b640c387942747b7551632687bf59d9e60b",
    "submitter": {
        "id": 970,
        "url": "http://patches.dpdk.org/api/people/970/?format=api",
        "name": "Joyce Kong",
        "email": "joyce.kong@arm.com"
    },
    "delegate": {
        "id": 24651,
        "url": "http://patches.dpdk.org/api/users/24651/?format=api",
        "username": "dmarchand",
        "first_name": "David",
        "last_name": "Marchand",
        "email": "david.marchand@redhat.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1574244727-6003-7-git-send-email-joyce.kong@arm.com/mbox/",
    "series": [
        {
            "id": 7544,
            "url": "http://patches.dpdk.org/api/series/7544/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=7544",
            "date": "2019-11-20T10:12:01",
            "name": "implement common rte bit operation APIs in PMDs",
            "version": 4,
            "mbox": "http://patches.dpdk.org/series/7544/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/63160/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/63160/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 5B193A04C1;\n\tWed, 20 Nov 2019 11:13:22 +0100 (CET)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 124901BEA4;\n\tWed, 20 Nov 2019 11:12:53 +0100 (CET)",
            "from foss.arm.com (foss.arm.com [217.140.110.172])\n by dpdk.org (Postfix) with ESMTP id 0932F1BE95\n for <dev@dpdk.org>; Wed, 20 Nov 2019 11:12:51 +0100 (CET)",
            "from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14])\n by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 87B491045;\n Wed, 20 Nov 2019 02:12:50 -0800 (PST)",
            "from net-arm-thunderx2-01.test.ast.arm.com\n (net-arm-thunderx2-01.shanghai.arm.com [10.169.40.40])\n by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id CC3143F52E;\n Wed, 20 Nov 2019 02:12:46 -0800 (PST)"
        ],
        "From": "Joyce Kong <joyce.kong@arm.com>",
        "To": "dev@dpdk.org",
        "Cc": "nd@arm.com, thomas@monjalon.net, jerinj@marvell.com,\n stephen@networkplumber.org, mb@smartsharesystems.com,\n david.marchand@redhat.com, honnappa.nagarahalli@arm.com, gavin.hu@arm.com,\n ravi1.kumar@amd.com, rmody@marvell.com, shshaikh@marvell.com,\n xuanziyang2@huawei.com, cloud.wangxiaoyun@huawei.com,\n zhouguoyang@huawei.com",
        "Date": "Wed, 20 Nov 2019 18:12:07 +0800",
        "Message-Id": "<1574244727-6003-7-git-send-email-joyce.kong@arm.com>",
        "X-Mailer": "git-send-email 2.7.4",
        "In-Reply-To": [
            "<1574244727-6003-1-git-send-email-joyce.kong@arm.com>",
            "<1571125801-45773-1-git-send-email-joyce.kong@arm.com>"
        ],
        "References": [
            "<1574244727-6003-1-git-send-email-joyce.kong@arm.com>",
            "<1571125801-45773-1-git-send-email-joyce.kong@arm.com>"
        ],
        "Subject": "[dpdk-dev] [PATCH v4 6/6] net/hinic: use common rte bit operation\n\tAPIs instead",
        "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>,\n <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>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Remove its own bit operation APIs and use the common one,\nthis can reduce the code duplication largely.\n\nSigned-off-by: Joyce Kong <joyce.kong@arm.com>\nReviewed-by: Gavin Hu <gavin.hu@arm.com>\n---\n drivers/net/hinic/Makefile            |  1 +\n drivers/net/hinic/base/hinic_compat.h | 33 +--------------------------------\n drivers/net/hinic/hinic_pmd_ethdev.c  | 16 ++++++++--------\n drivers/net/hinic/meson.build         |  2 ++\n 4 files changed, 12 insertions(+), 40 deletions(-)",
    "diff": "diff --git a/drivers/net/hinic/Makefile b/drivers/net/hinic/Makefile\nindex b78fd8d..97f4298 100644\n--- a/drivers/net/hinic/Makefile\n+++ b/drivers/net/hinic/Makefile\n@@ -9,6 +9,7 @@ include $(RTE_SDK)/mk/rte.vars.mk\n LIB = librte_pmd_hinic.a\n \n CFLAGS += -O3\n+CFLAGS += -DALLOW_EXPERIMENTAL_API\n CFLAGS += $(WERROR_FLAGS)\n \n ifeq ($(CONFIG_RTE_ARCH_ARM64),y)\ndiff --git a/drivers/net/hinic/base/hinic_compat.h b/drivers/net/hinic/base/hinic_compat.h\nindex e4a7f12..c0a0b3e 100644\n--- a/drivers/net/hinic/base/hinic_compat.h\n+++ b/drivers/net/hinic/base/hinic_compat.h\n@@ -11,6 +11,7 @@\n #include <pthread.h>\n #include <rte_common.h>\n #include <rte_byteorder.h>\n+#include <rte_bitops.h>\n #include <rte_memzone.h>\n #include <rte_memcpy.h>\n #include <rte_malloc.h>\n@@ -117,38 +118,6 @@ extern int hinic_logtype;\n \n #define HINIC_PAGE_SIZE_DPDK\t6\n \n-static inline int hinic_test_bit(int nr, volatile unsigned long *addr)\n-{\n-\tint res;\n-\n-\tres = ((*addr) & (1UL << nr)) != 0;\n-\treturn res;\n-}\n-\n-static inline void hinic_set_bit(unsigned int nr, volatile unsigned long *addr)\n-{\n-\t__sync_fetch_and_or(addr, (1UL << nr));\n-}\n-\n-static inline void hinic_clear_bit(int nr, volatile unsigned long *addr)\n-{\n-\t__sync_fetch_and_and(addr, ~(1UL << nr));\n-}\n-\n-static inline int hinic_test_and_clear_bit(int nr, volatile unsigned long *addr)\n-{\n-\tunsigned long mask = (1UL << nr);\n-\n-\treturn __sync_fetch_and_and(addr, ~mask) & mask;\n-}\n-\n-static inline int hinic_test_and_set_bit(int nr, volatile unsigned long *addr)\n-{\n-\tunsigned long mask = (1UL << nr);\n-\n-\treturn __sync_fetch_and_or(addr, mask) & mask;\n-}\n-\n void *dma_zalloc_coherent(void *dev, size_t size, dma_addr_t *dma_handle,\n \t\t\t  gfp_t flag);\n void *dma_zalloc_coherent_aligned(void *dev, size_t size,\ndiff --git a/drivers/net/hinic/hinic_pmd_ethdev.c b/drivers/net/hinic/hinic_pmd_ethdev.c\nindex 072fec3..8181564 100644\n--- a/drivers/net/hinic/hinic_pmd_ethdev.c\n+++ b/drivers/net/hinic/hinic_pmd_ethdev.c\n@@ -269,7 +269,7 @@ static void hinic_dev_interrupt_handler(void *param)\n \tstruct rte_eth_dev *dev = param;\n \tstruct hinic_nic_dev *nic_dev = HINIC_ETH_DEV_TO_PRIVATE_NIC_DEV(dev);\n \n-\tif (!hinic_test_bit(HINIC_DEV_INTR_EN, &nic_dev->dev_status)) {\n+\tif (!rte_get_bit64(HINIC_DEV_INTR_EN, &nic_dev->dev_status)) {\n \t\tPMD_DRV_LOG(WARNING, \"Device's interrupt is disabled, ignore interrupt event, dev_name: %s, port_id: %d\",\n \t\t\t    nic_dev->proc_dev_name, dev->data->port_id);\n \t\treturn;\n@@ -1075,7 +1075,7 @@ static int hinic_dev_start(struct rte_eth_dev *dev)\n \tif (dev->data->dev_conf.intr_conf.lsc != 0)\n \t\t(void)hinic_link_update(dev, 0);\n \n-\thinic_set_bit(HINIC_DEV_START, &nic_dev->dev_status);\n+\trte_set_bit64(HINIC_DEV_START, &nic_dev->dev_status);\n \n \treturn 0;\n \n@@ -1200,7 +1200,7 @@ static void hinic_dev_stop(struct rte_eth_dev *dev)\n \tname = dev->data->name;\n \tport_id = dev->data->port_id;\n \n-\tif (!hinic_test_and_clear_bit(HINIC_DEV_START, &nic_dev->dev_status)) {\n+\tif (!rte_test_and_clear_bit64(HINIC_DEV_START, &nic_dev->dev_status)) {\n \t\tPMD_DRV_LOG(INFO, \"Device %s already stopped\", name);\n \t\treturn;\n \t}\n@@ -1245,7 +1245,7 @@ static void hinic_disable_interrupt(struct rte_eth_dev *dev)\n \tstruct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);\n \tint ret, retries = 0;\n \n-\thinic_clear_bit(HINIC_DEV_INTR_EN, &nic_dev->dev_status);\n+\trte_clear_bit64(HINIC_DEV_INTR_EN, &nic_dev->dev_status);\n \n \t/* disable msix interrupt in hardware */\n \thinic_set_msix_state(nic_dev->hwdev, 0, HINIC_MSIX_DISABLE);\n@@ -2844,7 +2844,7 @@ static void hinic_dev_close(struct rte_eth_dev *dev)\n {\n \tstruct hinic_nic_dev *nic_dev = HINIC_ETH_DEV_TO_PRIVATE_NIC_DEV(dev);\n \n-\tif (hinic_test_and_set_bit(HINIC_DEV_CLOSE, &nic_dev->dev_status)) {\n+\tif (rte_test_and_set_bit64(HINIC_DEV_CLOSE, &nic_dev->dev_status)) {\n \t\tPMD_DRV_LOG(WARNING, \"Device %s already closed\",\n \t\t\t    dev->data->name);\n \t\treturn;\n@@ -3045,7 +3045,7 @@ static int hinic_func_init(struct rte_eth_dev *eth_dev)\n \t\t\t    eth_dev->data->name);\n \t\tgoto enable_intr_fail;\n \t}\n-\thinic_set_bit(HINIC_DEV_INTR_EN, &nic_dev->dev_status);\n+\trte_set_bit64(HINIC_DEV_INTR_EN, &nic_dev->dev_status);\n \n \t/* initialize filter info */\n \tfilter_info = &nic_dev->filter;\n@@ -3057,7 +3057,7 @@ static int hinic_func_init(struct rte_eth_dev *eth_dev)\n \tTAILQ_INIT(&nic_dev->filter_fdir_rule_list);\n \tTAILQ_INIT(&nic_dev->hinic_flow_list);\n \n-\thinic_set_bit(HINIC_DEV_INIT, &nic_dev->dev_status);\n+\trte_set_bit64(HINIC_DEV_INIT, &nic_dev->dev_status);\n \tPMD_DRV_LOG(INFO, \"Initialize %s in primary successfully\",\n \t\t    eth_dev->data->name);\n \n@@ -3113,7 +3113,7 @@ static int hinic_dev_uninit(struct rte_eth_dev *dev)\n \tstruct hinic_nic_dev *nic_dev;\n \n \tnic_dev = HINIC_ETH_DEV_TO_PRIVATE_NIC_DEV(dev);\n-\thinic_clear_bit(HINIC_DEV_INIT, &nic_dev->dev_status);\n+\trte_clear_bit64(HINIC_DEV_INIT, &nic_dev->dev_status);\n \n \tif (rte_eal_process_type() != RTE_PROC_PRIMARY)\n \t\treturn 0;\ndiff --git a/drivers/net/hinic/meson.build b/drivers/net/hinic/meson.build\nindex bc7e246..8c7ee9d 100644\n--- a/drivers/net/hinic/meson.build\n+++ b/drivers/net/hinic/meson.build\n@@ -1,6 +1,8 @@\n # SPDX-License-Identifier: BSD-3-Clause\n # Copyright(c) 2017 Huawei Technologies Co., Ltd\n \n+allow_experimental_apis = true\n+\n subdir('base')\n objs = [base_objs]\n \n",
    "prefixes": [
        "v4",
        "6/6"
    ]
}