get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 3702,
    "url": "http://patches.dpdk.org/api/patches/3702/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1424837389-56276-4-git-send-email-rsanford2@gmail.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": "<1424837389-56276-4-git-send-email-rsanford2@gmail.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1424837389-56276-4-git-send-email-rsanford2@gmail.com",
    "date": "2015-02-25T04:09:49",
    "name": "[dpdk-dev,v2,3/3] timer: fix rte_timer_reset return value",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "6e01e0054079a7b86d3db009a6cc25a8c4f310fe",
    "submitter": {
        "id": 7,
        "url": "http://patches.dpdk.org/api/people/7/?format=api",
        "name": "Robert Sanford",
        "email": "rsanford2@gmail.com"
    },
    "delegate": null,
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1424837389-56276-4-git-send-email-rsanford2@gmail.com/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/3702/comments/",
    "check": "pending",
    "checks": "http://patches.dpdk.org/api/patches/3702/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 [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id B2F44AD8D;\n\tWed, 25 Feb 2015 05:10:20 +0100 (CET)",
            "from mail-ie0-f178.google.com (mail-ie0-f178.google.com\n\t[209.85.223.178]) by dpdk.org (Postfix) with ESMTP id 8F7A3AD7F\n\tfor <dev@dpdk.org>; Wed, 25 Feb 2015 05:10:16 +0100 (CET)",
            "by iebtr6 with SMTP id tr6so1822157ieb.7\n\tfor <dev@dpdk.org>; Tue, 24 Feb 2015 20:10:16 -0800 (PST)",
            "from localhost.localdomain\n\t(adsl-065-013-043-223.sip.mia.bellsouth.net. [65.13.43.223])\n\tby mx.google.com with ESMTPSA id\n\tm38sm25067554ioi.39.2015.02.24.20.10.14\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tTue, 24 Feb 2015 20:10:15 -0800 (PST)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references;\n\tbh=b4GDi2Am925x6UTawG5U4pxQaPbE1uAD/oAHhuGpSE4=;\n\tb=NeFL+TzwwGNFCKuIakXX3Q9MDLZkQMT6J4+cMsrFv/WSFVp/7FOOt9vgFAj+A8F6hZ\n\treVHwNZCadQuJi3YVavv1mLOlghpbn+Dmnsj/y95cOO5IlO3zueNRm0rpOzGTN3NLYu8\n\t0dfEMzBkf8om6bL0rvlM/VLxRLUuo7k22Oz0ip1wB8Pch6N+ae9aWOAXG3I2N9eVTucf\n\tH7g5GA3iKGK7F/ONDg/kRZeLgXOxDcijKDBlby5bmtsKbLt3qHuolPehfQzY/GhW607U\n\tbZTrdpbPOh4F+pN4+EEr+2LktmNy02fQFbpy9VUDPU+DW1szom139+M8Ptsy3hcgGvX4\n\trbRg==",
        "X-Received": "by 10.50.124.73 with SMTP id mg9mr2164581igb.38.1424837416163;\n\tTue, 24 Feb 2015 20:10:16 -0800 (PST)",
        "From": "Robert Sanford <rsanford2@gmail.com>",
        "To": "dev@dpdk.org",
        "Date": "Tue, 24 Feb 2015 23:09:49 -0500",
        "Message-Id": "<1424837389-56276-4-git-send-email-rsanford2@gmail.com>",
        "X-Mailer": "git-send-email 1.7.1",
        "In-Reply-To": "<1422996127-64370-1-git-send-email-rsanford2@gmail.com>",
        "References": "<1422996127-64370-1-git-send-email-rsanford2@gmail.com>",
        "Subject": "[dpdk-dev] [PATCH v2 3/3] timer: fix rte_timer_reset return value",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "patches and discussions about DPDK <dev.dpdk.org>",
        "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "- API rte_timer_reset() should return -1 when the timer is in the\nRUNNING or CONFIG state. Instead, it ignores the return value of\ninternal function __rte_timer_reset() and always returns 0.\nWe change rte_timer_reset() to return the value returned by\n__rte_timer_reset().\n\n- Enhance timer stress test 2 to report how many timer reset\ncollisions occur, i.e., how many times rte_timer_reset() fails\ndue to a timer being in the CONFIG state.\n\nSigned-off-by: Robert Sanford <rsanford2@gmail.com>\n\n---\napp/test/test_timer.c        |   19 ++++++++++++++++---\nlib/librte_timer/rte_timer.c |    4 +---\n2 files changed, 17 insertions(+), 6 deletions(-)",
    "diff": "diff --git a/app/test/test_timer.c b/app/test/test_timer.c\nindex 070437a..79fa955 100644\n--- a/app/test/test_timer.c\n+++ b/app/test/test_timer.c\n@@ -247,10 +247,12 @@ static int\n timer_stress2_main_loop(__attribute__((unused)) void *arg)\n {\n \tstatic struct rte_timer *timers;\n-\tint i;\n+\tint i, ret;\n \tstatic volatile int ready = 0;\n \tuint64_t delay = rte_get_timer_hz() / 4;\n \tunsigned lcore_id = rte_lcore_id();\n+\tint32_t my_collisions = 0;\n+\tstatic rte_atomic32_t collisions = RTE_ATOMIC32_INIT(0);\n \n \tif (lcore_id == rte_get_master_lcore()) {\n \t\tcb_count = 0;\n@@ -269,15 +271,25 @@ timer_stress2_main_loop(__attribute__((unused)) void *arg)\n \t}\n \n \t/* have all cores schedule all timers on master lcore */\n-\tfor (i = 0; i < NB_STRESS2_TIMERS; i++)\n-\t\trte_timer_reset(&timers[i], delay, SINGLE, rte_get_master_lcore(),\n+\tfor (i = 0; i < NB_STRESS2_TIMERS; i++) {\n+\t\tret = rte_timer_reset(&timers[i], delay, SINGLE, rte_get_master_lcore(),\n \t\t\t\ttimer_stress2_cb, NULL);\n+\t\t/* there will be collisions when multiple cores simultaneously\n+\t\t * configure the same timers */\n+\t\tif (ret != 0)\n+\t\t\tmy_collisions++;\n+\t}\n+\tif (my_collisions != 0)\n+\t\trte_atomic32_add(&collisions, my_collisions);\n \n \tready = 0;\n \trte_delay_ms(500);\n \n \t/* now check that we get the right number of callbacks */\n \tif (lcore_id == rte_get_master_lcore()) {\n+\t\tmy_collisions = rte_atomic32_read(&collisions);\n+\t\tif (my_collisions != 0)\n+\t\t\tprintf(\"- %d timer reset collisions (OK)\\n\", my_collisions);\n \t\trte_timer_manage();\n \t\tif (cb_count != NB_STRESS2_TIMERS) {\n \t\t\tprintf(\"Test Failed\\n\");\n@@ -317,6 +329,7 @@ timer_stress2_main_loop(__attribute__((unused)) void *arg)\n \t\trte_free(timers);\n \t\ttimers = NULL;\n \t\tready = 0;\n+\t\trte_atomic32_set(&collisions, 0);\n \n \t\tif (cb_count != NB_STRESS2_TIMERS) {\n \t\t\tprintf(\"Test Failed\\n\");\ndiff --git a/lib/librte_timer/rte_timer.c b/lib/librte_timer/rte_timer.c\nindex dae76cc..d18abf5 100644\n--- a/lib/librte_timer/rte_timer.c\n+++ b/lib/librte_timer/rte_timer.c\n@@ -424,10 +424,8 @@ rte_timer_reset(struct rte_timer *tim, uint64_t ticks,\n \telse\n \t\tperiod = 0;\n \n-\t__rte_timer_reset(tim,  cur_time + ticks, period, tim_lcore,\n+\treturn __rte_timer_reset(tim,  cur_time + ticks, period, tim_lcore,\n \t\t\t  fct, arg, 0);\n-\n-\treturn 0;\n }\n \n /* loop until rte_timer_reset() succeed */\n",
    "prefixes": [
        "dpdk-dev",
        "v2",
        "3/3"
    ]
}