get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 50981,
    "url": "https://patches.dpdk.org/api/patches/50981/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1552029401-90697-3-git-send-email-gavin.hu@arm.com/",
    "project": {
        "id": 1,
        "url": "https://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": "<1552029401-90697-3-git-send-email-gavin.hu@arm.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1552029401-90697-3-git-send-email-gavin.hu@arm.com",
    "date": "2019-03-08T07:16:40",
    "name": "[v6,2/3] test/spinlock: amortize the cost of getting time",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "1b85c7fbe75ee8524ebeafb0483a005d2a8ab29c",
    "submitter": {
        "id": 1018,
        "url": "https://patches.dpdk.org/api/people/1018/?format=api",
        "name": "Gavin Hu",
        "email": "gavin.hu@arm.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1552029401-90697-3-git-send-email-gavin.hu@arm.com/mbox/",
    "series": [
        {
            "id": 3674,
            "url": "https://patches.dpdk.org/api/series/3674/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=3674",
            "date": "2019-03-08T07:16:38",
            "name": "generic spinlock optimization and test case enhancements",
            "version": 6,
            "mbox": "https://patches.dpdk.org/series/3674/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/50981/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/50981/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id EFCE64C90;\n\tFri,  8 Mar 2019 08:17:02 +0100 (CET)",
            "from foss.arm.com (foss.arm.com [217.140.101.70])\n\tby dpdk.org (Postfix) with ESMTP id BE3B8326C;\n\tFri,  8 Mar 2019 08:17:01 +0100 (CET)",
            "from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249])\n\tby usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 207CE80D;\n\tThu,  7 Mar 2019 23:17:01 -0800 (PST)",
            "from net-arm-thunderx2.shanghai.arm.com\n\t(net-arm-thunderx2.shanghai.arm.com [10.169.40.121])\n\tby usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id\n\t49BB03F71D; Thu,  7 Mar 2019 23:16:59 -0800 (PST)"
        ],
        "From": "Gavin Hu <gavin.hu@arm.com>",
        "To": "dev@dpdk.org",
        "Cc": "nd@arm.com, thomas@monjalon.net, jerinj@marvell.com,\n\themant.agrawal@nxp.com, nipun.gupta@nxp.com,\n\tHonnappa.Nagarahalli@arm.com, \n\tgavin.hu@arm.com, i.maximets@samsung.com, chaozhu@linux.vnet.ibm.com, \n\tstable@dpdk.org",
        "Date": "Fri,  8 Mar 2019 15:16:40 +0800",
        "Message-Id": "<1552029401-90697-3-git-send-email-gavin.hu@arm.com>",
        "X-Mailer": "git-send-email 2.7.4",
        "In-Reply-To": [
            "<1552029401-90697-1-git-send-email-gavin.hu@arm.com>",
            "<20181220104246.5590-1-gavin.hu@arm.com>"
        ],
        "References": [
            "<1552029401-90697-1-git-send-email-gavin.hu@arm.com>",
            "<20181220104246.5590-1-gavin.hu@arm.com>"
        ],
        "Subject": "[dpdk-dev] [PATCH v6 2/3] test/spinlock: amortize the cost of\n\tgetting time",
        "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\t<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\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Instead of getting timestamps per iteration, amortize its overhead\ncan help getting more precise benchmarking results.\n\nFixes: af75078fece3 (\"first public release\")\nCc: stable@dpdk.org\n\nSigned-off-by: Gavin Hu <gavin.hu@arm.com>\nReviewed-by: Joyce Kong <Joyce.Kong@arm.com>\nReviewed-by: ruifeng wang <ruifeng.wang@arm.com>\nReviewed-by: honnappa nagarahalli <honnappa.nagarahalli@arm.com>\n---\n app/test/test_spinlock.c | 29 ++++++++++++++++-------------\n 1 file changed, 16 insertions(+), 13 deletions(-)",
    "diff": "diff --git a/app/test/test_spinlock.c b/app/test/test_spinlock.c\nindex 6795195..6ac7495 100644\n--- a/app/test/test_spinlock.c\n+++ b/app/test/test_spinlock.c\n@@ -96,16 +96,16 @@ test_spinlock_recursive_per_core(__attribute__((unused)) void *arg)\n }\n \n static rte_spinlock_t lk = RTE_SPINLOCK_INITIALIZER;\n-static uint64_t lock_count[RTE_MAX_LCORE] = {0};\n+static uint64_t time_count[RTE_MAX_LCORE] = {0};\n \n-#define TIME_MS 100\n+#define MAX_LOOP 10000\n \n static int\n load_loop_fn(void *func_param)\n {\n \tuint64_t time_diff = 0, begin;\n \tuint64_t hz = rte_get_timer_hz();\n-\tuint64_t lcount = 0;\n+\tvolatile uint64_t lcount = 0;\n \tconst int use_lock = *(int*)func_param;\n \tconst unsigned lcore = rte_lcore_id();\n \n@@ -114,15 +114,15 @@ load_loop_fn(void *func_param)\n \t\twhile (rte_atomic32_read(&synchro) == 0);\n \n \tbegin = rte_get_timer_cycles();\n-\twhile (time_diff < hz * TIME_MS / 1000) {\n+\twhile (lcount < MAX_LOOP) {\n \t\tif (use_lock)\n \t\t\trte_spinlock_lock(&lk);\n \t\tlcount++;\n \t\tif (use_lock)\n \t\t\trte_spinlock_unlock(&lk);\n-\t\ttime_diff = rte_get_timer_cycles() - begin;\n \t}\n-\tlock_count[lcore] = lcount;\n+\ttime_diff = rte_get_timer_cycles() - begin;\n+\ttime_count[lcore] = time_diff * 1000000 / hz;\n \treturn 0;\n }\n \n@@ -136,14 +136,16 @@ test_spinlock_perf(void)\n \n \tprintf(\"\\nTest with no lock on single core...\\n\");\n \tload_loop_fn(&lock);\n-\tprintf(\"Core [%u] count = %\"PRIu64\"\\n\", lcore, lock_count[lcore]);\n-\tmemset(lock_count, 0, sizeof(lock_count));\n+\tprintf(\"Core [%u] Cost Time = %\"PRIu64\" us\\n\", lcore,\n+\t\t\t\t\t\ttime_count[lcore]);\n+\tmemset(time_count, 0, sizeof(time_count));\n \n \tprintf(\"\\nTest with lock on single core...\\n\");\n \tlock = 1;\n \tload_loop_fn(&lock);\n-\tprintf(\"Core [%u] count = %\"PRIu64\"\\n\", lcore, lock_count[lcore]);\n-\tmemset(lock_count, 0, sizeof(lock_count));\n+\tprintf(\"Core [%u] Cost Time = %\"PRIu64\" us\\n\", lcore,\n+\t\t\t\t\t\ttime_count[lcore]);\n+\tmemset(time_count, 0, sizeof(time_count));\n \n \tprintf(\"\\nTest with lock on %u cores...\\n\", rte_lcore_count());\n \n@@ -158,11 +160,12 @@ test_spinlock_perf(void)\n \trte_eal_mp_wait_lcore();\n \n \tRTE_LCORE_FOREACH(i) {\n-\t\tprintf(\"Core [%u] count = %\"PRIu64\"\\n\", i, lock_count[i]);\n-\t\ttotal += lock_count[i];\n+\t\tprintf(\"Core [%u] Cost Time = %\"PRIu64\" us\\n\", i,\n+\t\t\t\t\t\ttime_count[i]);\n+\t\ttotal += time_count[i];\n \t}\n \n-\tprintf(\"Total count = %\"PRIu64\"\\n\", total);\n+\tprintf(\"Total Cost Time = %\"PRIu64\" us\\n\", total);\n \n \treturn 0;\n }\n",
    "prefixes": [
        "v6",
        "2/3"
    ]
}