get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 69221,
    "url": "http://patchwork.dpdk.org/api/patches/69221/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20200424032159.992-4-joyce.kong@arm.com/",
    "project": {
        "id": 1,
        "url": "http://patchwork.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": "<20200424032159.992-4-joyce.kong@arm.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200424032159.992-4-joyce.kong@arm.com",
    "date": "2020-04-24T03:21:56",
    "name": "[v9,3/6] net/axgbe: use common rte bit operation APIs instead",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "93f496475b24dc78c37adb87a39dafd0dddb2ef3",
    "submitter": {
        "id": 970,
        "url": "http://patchwork.dpdk.org/api/people/970/?format=api",
        "name": "Joyce Kong",
        "email": "joyce.kong@arm.com"
    },
    "delegate": {
        "id": 24651,
        "url": "http://patchwork.dpdk.org/api/users/24651/?format=api",
        "username": "dmarchand",
        "first_name": "David",
        "last_name": "Marchand",
        "email": "david.marchand@redhat.com"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20200424032159.992-4-joyce.kong@arm.com/mbox/",
    "series": [
        {
            "id": 9606,
            "url": "http://patchwork.dpdk.org/api/series/9606/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=9606",
            "date": "2020-04-24T03:21:53",
            "name": "implement common bit operation APIs",
            "version": 9,
            "mbox": "http://patchwork.dpdk.org/series/9606/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/69221/comments/",
    "check": "success",
    "checks": "http://patchwork.dpdk.org/api/patches/69221/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 03452A00C4;\n\tFri, 24 Apr 2020 05:22:57 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 345281C10B;\n\tFri, 24 Apr 2020 05:22:54 +0200 (CEST)",
            "from foss.arm.com (foss.arm.com [217.140.110.172])\n by dpdk.org (Postfix) with ESMTP id 0492D1C0DB\n for <dev@dpdk.org>; Fri, 24 Apr 2020 05:22:52 +0200 (CEST)",
            "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 8D54731B;\n Thu, 23 Apr 2020 20:22:51 -0700 (PDT)",
            "from net-arm-thunderx2-03.shanghai.arm.com\n (net-arm-thunderx2-03.shanghai.arm.com [10.169.41.185])\n by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 5840E3F68F;\n Thu, 23 Apr 2020 20:22:46 -0700 (PDT)"
        ],
        "From": "Joyce Kong <joyce.kong@arm.com>",
        "To": "thomas@monjalon.net, stephen@networkplumber.org,\n david.marchand@redhat.com,\n mb@smartsharesystems.com, jerinj@marvell.com, bruce.richardson@intel.com,\n ravi1.kumar@amd.com, rmody@marvell.com, shshaikh@marvell.com,\n xuanziyang2@huawei.com, cloud.wangxiaoyun@huawei.com,\n zhouguoyang@huawei.com, honnappa.nagarahalli@arm.com, gavin.hu@arm.com,\n phil.yang@arm.com",
        "Cc": "nd@arm.com,\n\tdev@dpdk.org",
        "Date": "Fri, 24 Apr 2020 11:21:56 +0800",
        "Message-Id": "<20200424032159.992-4-joyce.kong@arm.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": [
            "<20200424032159.992-1-joyce.kong@arm.com>",
            "<1571125801-45773-1-git-send-email-joyce.kong@arm.com>"
        ],
        "References": [
            "<20200424032159.992-1-joyce.kong@arm.com>",
            "<1571125801-45773-1-git-send-email-joyce.kong@arm.com>"
        ],
        "Subject": "[dpdk-dev] [PATCH v9 3/6] net/axgbe: 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/axgbe/axgbe_common.h | 29 +----------------------------\n drivers/net/axgbe/axgbe_ethdev.c | 14 +++++++-------\n drivers/net/axgbe/axgbe_ethdev.h |  2 +-\n drivers/net/axgbe/axgbe_mdio.c   | 15 ++++++++-------\n 4 files changed, 17 insertions(+), 43 deletions(-)",
    "diff": "diff --git a/drivers/net/axgbe/axgbe_common.h b/drivers/net/axgbe/axgbe_common.h\nindex f48117180..d53b48ce6 100644\n--- a/drivers/net/axgbe/axgbe_common.h\n+++ b/drivers/net/axgbe/axgbe_common.h\n@@ -21,6 +21,7 @@\n #include <inttypes.h>\n #include <pthread.h>\n \n+#include <rte_bitops.h>\n #include <rte_byteorder.h>\n #include <rte_memory.h>\n #include <rte_malloc.h>\n@@ -1700,34 +1701,6 @@ do {\t\t\t\t\t\t\t\t\t\\\n #define time_after_eq(a, b)     ((long)((a) - (b)) >= 0)\n #define time_before_eq(a, b)\ttime_after_eq(b, a)\n \n-/*---bitmap support apis---*/\n-static inline int axgbe_test_bit(int nr, volatile unsigned long *addr)\n-{\n-\tint res;\n-\n-\trte_mb();\n-\tres = ((*addr) & (1UL << nr)) != 0;\n-\trte_mb();\n-\treturn res;\n-}\n-\n-static inline void axgbe_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 axgbe_clear_bit(int nr, volatile unsigned long *addr)\n-{\n-\t__sync_fetch_and_and(addr, ~(1UL << nr));\n-}\n-\n-static inline int axgbe_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 unsigned long msecs_to_timer_cycles(unsigned int m)\n {\n \treturn rte_get_timer_hz() * (m / 1000);\ndiff --git a/drivers/net/axgbe/axgbe_ethdev.c b/drivers/net/axgbe/axgbe_ethdev.c\nindex 867058845..b83c14144 100644\n--- a/drivers/net/axgbe/axgbe_ethdev.c\n+++ b/drivers/net/axgbe/axgbe_ethdev.c\n@@ -327,8 +327,8 @@ axgbe_dev_start(struct rte_eth_dev *dev)\n \taxgbe_dev_enable_tx(dev);\n \taxgbe_dev_enable_rx(dev);\n \n-\taxgbe_clear_bit(AXGBE_STOPPED, &pdata->dev_state);\n-\taxgbe_clear_bit(AXGBE_DOWN, &pdata->dev_state);\n+\trte_clear_bit32_relaxed(AXGBE_STOPPED, &pdata->dev_state);\n+\trte_clear_bit32_relaxed(AXGBE_DOWN, &pdata->dev_state);\n \tif ((dev_data->dev_conf.rxmode.offloads & DEV_RX_OFFLOAD_SCATTER) ||\n \t\t\t\tmax_pkt_len > pdata->rx_buf_size)\n \t\tdev_data->scattered_rx = 1;\n@@ -352,17 +352,17 @@ axgbe_dev_stop(struct rte_eth_dev *dev)\n \n \trte_intr_disable(&pdata->pci_dev->intr_handle);\n \n-\tif (axgbe_test_bit(AXGBE_STOPPED, &pdata->dev_state))\n+\tif (rte_get_bit32_relaxed(AXGBE_STOPPED, &pdata->dev_state))\n \t\treturn;\n \n-\taxgbe_set_bit(AXGBE_STOPPED, &pdata->dev_state);\n+\trte_set_bit32_relaxed(AXGBE_STOPPED, &pdata->dev_state);\n \taxgbe_dev_disable_tx(dev);\n \taxgbe_dev_disable_rx(dev);\n \n \tpdata->phy_if.phy_stop(pdata);\n \tpdata->hw_if.exit(pdata);\n \tmemset(&dev->data->dev_link, 0, sizeof(struct rte_eth_link));\n-\taxgbe_set_bit(AXGBE_DOWN, &pdata->dev_state);\n+\trte_set_bit32_relaxed(AXGBE_DOWN, &pdata->dev_state);\n }\n \n /* Clear all resources like TX/RX queues. */\n@@ -1470,8 +1470,8 @@ eth_axgbe_dev_init(struct rte_eth_dev *eth_dev)\n \n \tpdata = eth_dev->data->dev_private;\n \t/* initial state */\n-\taxgbe_set_bit(AXGBE_DOWN, &pdata->dev_state);\n-\taxgbe_set_bit(AXGBE_STOPPED, &pdata->dev_state);\n+\trte_set_bit32_relaxed(AXGBE_DOWN, &pdata->dev_state);\n+\trte_set_bit32_relaxed(AXGBE_STOPPED, &pdata->dev_state);\n \tpdata->eth_dev = eth_dev;\n \n \tpci_dev = RTE_DEV_TO_PCI(eth_dev->device);\ndiff --git a/drivers/net/axgbe/axgbe_ethdev.h b/drivers/net/axgbe/axgbe_ethdev.h\nindex f10ec4a40..1898e9eb9 100644\n--- a/drivers/net/axgbe/axgbe_ethdev.h\n+++ b/drivers/net/axgbe/axgbe_ethdev.h\n@@ -522,7 +522,7 @@ struct axgbe_port {\n \tunsigned int xpcs_window_mask;\n \n \t/* Flags representing axgbe_state */\n-\tunsigned long dev_state;\n+\tuint32_t dev_state;\n \n \tstruct axgbe_hw_if hw_if;\n \tstruct axgbe_phy_if phy_if;\ndiff --git a/drivers/net/axgbe/axgbe_mdio.c b/drivers/net/axgbe/axgbe_mdio.c\nindex 0f226c3f2..d1196d308 100644\n--- a/drivers/net/axgbe/axgbe_mdio.c\n+++ b/drivers/net/axgbe/axgbe_mdio.c\n@@ -916,7 +916,7 @@ static int __axgbe_phy_config_aneg(struct axgbe_port *pdata)\n {\n \tint ret;\n \n-\taxgbe_set_bit(AXGBE_LINK_INIT, &pdata->dev_state);\n+\trte_set_bit32_relaxed(AXGBE_LINK_INIT, &pdata->dev_state);\n \tpdata->link_check = rte_get_timer_cycles();\n \n \tret = pdata->phy_if.phy_impl.an_config(pdata);\n@@ -981,9 +981,9 @@ static int axgbe_phy_config_aneg(struct axgbe_port *pdata)\n \n \tret = __axgbe_phy_config_aneg(pdata);\n \tif (ret)\n-\t\taxgbe_set_bit(AXGBE_LINK_ERR, &pdata->dev_state);\n+\t\trte_set_bit32_relaxed(AXGBE_LINK_ERR, &pdata->dev_state);\n \telse\n-\t\taxgbe_clear_bit(AXGBE_LINK_ERR, &pdata->dev_state);\n+\t\trte_clear_bit32_relaxed(AXGBE_LINK_ERR, &pdata->dev_state);\n \n \tpthread_mutex_unlock(&pdata->an_mutex);\n \n@@ -1072,7 +1072,7 @@ static void axgbe_phy_status(struct axgbe_port *pdata)\n \tunsigned int reg = 0;\n \tunsigned long autoneg_start_time;\n \n-\tif (axgbe_test_bit(AXGBE_LINK_ERR, &pdata->dev_state)) {\n+\tif (rte_get_bit32_relaxed(AXGBE_LINK_ERR, &pdata->dev_state)) {\n \t\tpdata->phy.link = 0;\n \t\tgoto adjust_link;\n \t}\n@@ -1116,10 +1116,11 @@ static void axgbe_phy_status(struct axgbe_port *pdata)\n \t\t\t}\n \t\t}\n \t\taxgbe_phy_status_result(pdata);\n-\t\tif (axgbe_test_bit(AXGBE_LINK_INIT, &pdata->dev_state))\n-\t\t\taxgbe_clear_bit(AXGBE_LINK_INIT, &pdata->dev_state);\n+\t\tif (rte_get_bit32_relaxed(AXGBE_LINK_INIT, &pdata->dev_state))\n+\t\t\trte_clear_bit32_relaxed(AXGBE_LINK_INIT,\n+\t\t\t\t\t\t&pdata->dev_state);\n \t} else {\n-\t\tif (axgbe_test_bit(AXGBE_LINK_INIT, &pdata->dev_state)) {\n+\t\tif (rte_get_bit32_relaxed(AXGBE_LINK_INIT, &pdata->dev_state)) {\n \t\t\taxgbe_check_link_timeout(pdata);\n \n \t\t\tif (link_aneg)\n",
    "prefixes": [
        "v9",
        "3/6"
    ]
}