get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 63983,
    "url": "http://patches.dpdk.org/api/patches/63983/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1576648808-24765-4-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": "<1576648808-24765-4-git-send-email-joyce.kong@arm.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1576648808-24765-4-git-send-email-joyce.kong@arm.com",
    "date": "2019-12-18T06:00:05",
    "name": "[v6,3/6] net/axgbe: use common rte bit operation APIs instead",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "cf51d67f175c247e16d9ccf39d5a82b29374cb23",
    "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/1576648808-24765-4-git-send-email-joyce.kong@arm.com/mbox/",
    "series": [
        {
            "id": 7882,
            "url": "http://patches.dpdk.org/api/series/7882/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=7882",
            "date": "2019-12-18T06:00:02",
            "name": "implement common rte bit operation APIs in PMDs",
            "version": 6,
            "mbox": "http://patches.dpdk.org/series/7882/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/63983/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/63983/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 E0599A050F;\n\tWed, 18 Dec 2019 07:01:09 +0100 (CET)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 015D7330;\n\tWed, 18 Dec 2019 07:00:55 +0100 (CET)",
            "from foss.arm.com (foss.arm.com [217.140.110.172])\n by dpdk.org (Postfix) with ESMTP id 65A451BF70\n for <dev@dpdk.org>; Wed, 18 Dec 2019 07:00:53 +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 C35E3113E;\n Tue, 17 Dec 2019 22:00:52 -0800 (PST)",
            "from net-arm-thunderx2-01.test.ast.arm.com\n (net-arm-thunderx2-01.shanghai.arm.com [10.169.40.68])\n by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 9BEFD3F718;\n Tue, 17 Dec 2019 22:00:47 -0800 (PST)"
        ],
        "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, phil.yang@arm.com,\n gavin.hu@arm.com",
        "Cc": "nd@arm.com,\n\tdev@dpdk.org",
        "Date": "Wed, 18 Dec 2019 14:00:05 +0800",
        "Message-Id": "<1576648808-24765-4-git-send-email-joyce.kong@arm.com>",
        "X-Mailer": "git-send-email 2.7.4",
        "In-Reply-To": [
            "<1576648808-24765-1-git-send-email-joyce.kong@arm.com>",
            "<1571125801-45773-1-git-send-email-joyce.kong@arm.com>"
        ],
        "References": [
            "<1576648808-24765-1-git-send-email-joyce.kong@arm.com>",
            "<1571125801-45773-1-git-send-email-joyce.kong@arm.com>"
        ],
        "Subject": "[dpdk-dev] [PATCH v6 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   | 14 +++++++-------\n 4 files changed, 16 insertions(+), 43 deletions(-)",
    "diff": "diff --git a/drivers/net/axgbe/axgbe_common.h b/drivers/net/axgbe/axgbe_common.h\nindex 34f60f1..9cabda8 100644\n--- a/drivers/net/axgbe/axgbe_common.h\n+++ b/drivers/net/axgbe/axgbe_common.h\n@@ -22,6 +22,7 @@\n #include <pthread.h>\n \n #include <rte_byteorder.h>\n+#include <rte_bitops.h>\n #include <rte_memory.h>\n #include <rte_malloc.h>\n #include <rte_hexdump.h>\n@@ -1674,34 +1675,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 d1f160e..c3744bb 100644\n--- a/drivers/net/axgbe/axgbe_ethdev.c\n+++ b/drivers/net/axgbe/axgbe_ethdev.c\n@@ -201,8 +201,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(AXGBE_STOPPED, &pdata->dev_state);\n+\trte_clear_bit32(AXGBE_DOWN, &pdata->dev_state);\n \treturn 0;\n }\n \n@@ -216,17 +216,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(AXGBE_STOPPED, &pdata->dev_state))\n \t\treturn;\n \n-\taxgbe_set_bit(AXGBE_STOPPED, &pdata->dev_state);\n+\trte_set_bit32(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(AXGBE_DOWN, &pdata->dev_state);\n }\n \n /* Clear all resources like TX/RX queues. */\n@@ -598,8 +598,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(AXGBE_DOWN, &pdata->dev_state);\n+\trte_set_bit32(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 e3cfaf3..5e2c7e4 100644\n--- a/drivers/net/axgbe/axgbe_ethdev.h\n+++ b/drivers/net/axgbe/axgbe_ethdev.h\n@@ -464,7 +464,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 2721e5c..af7a1ec 100644\n--- a/drivers/net/axgbe/axgbe_mdio.c\n+++ b/drivers/net/axgbe/axgbe_mdio.c\n@@ -743,7 +743,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(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@@ -807,9 +807,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(AXGBE_LINK_ERR, &pdata->dev_state);\n \telse\n-\t\taxgbe_clear_bit(AXGBE_LINK_ERR, &pdata->dev_state);\n+\t\trte_clear_bit32(AXGBE_LINK_ERR, &pdata->dev_state);\n \n \tpthread_mutex_unlock(&pdata->an_mutex);\n \n@@ -880,7 +880,7 @@ static void axgbe_phy_status(struct axgbe_port *pdata)\n \tunsigned int link_aneg;\n \tint an_restart;\n \n-\tif (axgbe_test_bit(AXGBE_LINK_ERR, &pdata->dev_state)) {\n+\tif (rte_get_bit32(AXGBE_LINK_ERR, &pdata->dev_state)) {\n \t\tpdata->phy.link = 0;\n \t\tgoto adjust_link;\n \t}\n@@ -900,10 +900,10 @@ static void axgbe_phy_status(struct axgbe_port *pdata)\n \t\t\treturn;\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(AXGBE_LINK_INIT, &pdata->dev_state))\n+\t\t\trte_clear_bit32(AXGBE_LINK_INIT, &pdata->dev_state);\n \t} else {\n-\t\tif (axgbe_test_bit(AXGBE_LINK_INIT, &pdata->dev_state)) {\n+\t\tif (rte_get_bit32(AXGBE_LINK_INIT, &pdata->dev_state)) {\n \t\t\taxgbe_check_link_timeout(pdata);\n \n \t\t\tif (link_aneg)\n",
    "prefixes": [
        "v6",
        "3/6"
    ]
}