get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 13839,
    "url": "http://patches.dpdk.org/api/patches/13839/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1466004351-18512-2-git-send-email-remy.horton@intel.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": "<1466004351-18512-2-git-send-email-remy.horton@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1466004351-18512-2-git-send-email-remy.horton@intel.com",
    "date": "2016-06-15T15:25:49",
    "name": "[dpdk-dev,v4,1/3] eal: export keepalive state enumerations",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "b824c11e11728bb7270a2b3c5f281d7efbbd5a44",
    "submitter": {
        "id": 326,
        "url": "http://patches.dpdk.org/api/people/326/?format=api",
        "name": "Remy Horton",
        "email": "remy.horton@intel.com"
    },
    "delegate": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1466004351-18512-2-git-send-email-remy.horton@intel.com/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/13839/comments/",
    "check": "pending",
    "checks": "http://patches.dpdk.org/api/patches/13839/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 32C36C674;\n\tWed, 15 Jun 2016 17:25:57 +0200 (CEST)",
            "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n\tby dpdk.org (Postfix) with ESMTP id 67A2AC432\n\tfor <dev@dpdk.org>; Wed, 15 Jun 2016 17:25:54 +0200 (CEST)",
            "from fmsmga002.fm.intel.com ([10.253.24.26])\n\tby fmsmga102.fm.intel.com with ESMTP; 15 Jun 2016 08:25:53 -0700",
            "from rhorton-mobl.ger.corp.intel.com (HELO VM.ir.intel.com)\n\t([163.33.228.155])\n\tby fmsmga002.fm.intel.com with ESMTP; 15 Jun 2016 08:25:54 -0700"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos; i=\"5.26,476,1459839600\"; d=\"scan'208\";\n\ta=\"1002558547\"",
        "From": "Remy Horton <remy.horton@intel.com>",
        "To": "thomas.monjalon@6wind.com",
        "Cc": "dev@dpdk.org",
        "Date": "Wed, 15 Jun 2016 16:25:49 +0100",
        "Message-Id": "<1466004351-18512-2-git-send-email-remy.horton@intel.com>",
        "X-Mailer": "git-send-email 2.5.5",
        "In-Reply-To": "<1466004351-18512-1-git-send-email-remy.horton@intel.com>",
        "References": "<1466004351-18512-1-git-send-email-remy.horton@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v4 1/3] eal: export keepalive state enumerations",
        "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": "Changes the keepalive state from an anonymous enum to a declared one\nwhich is externally visible, so that keepalive enum values can be\nused by applications.\n\nSigned-off-by: Remy Horton <remy.horton@intel.com>\n---\n lib/librte_eal/common/include/rte_keepalive.h | 12 +++++++++-\n lib/librte_eal/common/rte_keepalive.c         | 34 +++++++++++++++------------\n 2 files changed, 30 insertions(+), 16 deletions(-)",
    "diff": "diff --git a/lib/librte_eal/common/include/rte_keepalive.h b/lib/librte_eal/common/include/rte_keepalive.h\nindex 10dac2e..d01a654 100644\n--- a/lib/librte_eal/common/include/rte_keepalive.h\n+++ b/lib/librte_eal/common/include/rte_keepalive.h\n@@ -1,7 +1,7 @@\n /*-\n  *   BSD LICENSE\n  *\n- *   Copyright 2015 Intel Shannon Ltd. All rights reserved.\n+ *   Copyright 2015-2016 Intel Shannon Ltd. All rights reserved.\n  *\n  *   Redistribution and use in source and binary forms, with or without\n  *   modification, are permitted provided that the following conditions\n@@ -48,6 +48,16 @@\n #define RTE_KEEPALIVE_MAXCORES RTE_MAX_LCORE\n #endif\n \n+enum rte_keepalive_state {\n+\tRTE_KA_STATE_UNUSED = 0,\n+\tRTE_KA_STATE_ALIVE = 1,\n+\tRTE_KA_STATE_MISSING = 4,\n+\tRTE_KA_STATE_DEAD = 2,\n+\tRTE_KA_STATE_GONE = 3,\n+\tRTE_KA_STATE_DOZING = 5,\n+\tRTE_KA_STATE_SLEEP = 6\n+};\n+\n /**\n  * Keepalive failure callback.\n  *\ndiff --git a/lib/librte_eal/common/rte_keepalive.c b/lib/librte_eal/common/rte_keepalive.c\nindex 23363ec..8b14370 100644\n--- a/lib/librte_eal/common/rte_keepalive.c\n+++ b/lib/librte_eal/common/rte_keepalive.c\n@@ -42,12 +42,8 @@\n \n struct rte_keepalive {\n \t/** Core Liveness. */\n-\tenum rte_keepalive_state {\n-\t\tALIVE = 1,\n-\t\tMISSING = 0,\n-\t\tDEAD = 2,\n-\t\tGONE = 3\n-\t} __rte_cache_aligned state_flags[RTE_KEEPALIVE_MAXCORES];\n+\tenum rte_keepalive_state __rte_cache_aligned state_flags[\n+\t\tRTE_KEEPALIVE_MAXCORES];\n \n \t/** Last-seen-alive timestamps */\n \tuint64_t last_alive[RTE_KEEPALIVE_MAXCORES];\n@@ -92,16 +88,18 @@ rte_keepalive_dispatch_pings(__rte_unused void *ptr_timer,\n \t\t\tcontinue;\n \n \t\tswitch (keepcfg->state_flags[idx_core]) {\n-\t\tcase ALIVE: /* Alive */\n-\t\t\tkeepcfg->state_flags[idx_core] = MISSING;\n+\t\tcase RTE_KA_STATE_UNUSED:\n+\t\t\tbreak;\n+\t\tcase RTE_KA_STATE_ALIVE: /* Alive */\n+\t\t\tkeepcfg->state_flags[idx_core] = RTE_KA_STATE_MISSING;\n \t\t\tkeepcfg->last_alive[idx_core] = rte_rdtsc();\n \t\t\tbreak;\n-\t\tcase MISSING: /* MIA */\n+\t\tcase RTE_KA_STATE_MISSING: /* MIA */\n \t\t\tprint_trace(\"Core MIA. \", keepcfg, idx_core);\n-\t\t\tkeepcfg->state_flags[idx_core] = DEAD;\n+\t\t\tkeepcfg->state_flags[idx_core] = RTE_KA_STATE_DEAD;\n \t\t\tbreak;\n-\t\tcase DEAD: /* Dead */\n-\t\t\tkeepcfg->state_flags[idx_core] = GONE;\n+\t\tcase RTE_KA_STATE_DEAD: /* Dead */\n+\t\t\tkeepcfg->state_flags[idx_core] = RTE_KA_STATE_GONE;\n \t\t\tprint_trace(\"Core died. \", keepcfg, idx_core);\n \t\t\tif (keepcfg->callback)\n \t\t\t\tkeepcfg->callback(\n@@ -109,7 +107,13 @@ rte_keepalive_dispatch_pings(__rte_unused void *ptr_timer,\n \t\t\t\t\tidx_core\n \t\t\t\t\t);\n \t\t\tbreak;\n-\t\tcase GONE: /* Buried */\n+\t\tcase RTE_KA_STATE_GONE: /* Buried */\n+\t\t\tbreak;\n+\t\tcase RTE_KA_STATE_DOZING: /* Core going idle */\n+\t\t\tkeepcfg->state_flags[idx_core] = RTE_KA_STATE_SLEEP;\n+\t\t\tkeepcfg->last_alive[idx_core] = rte_rdtsc();\n+\t\t\tbreak;\n+\t\tcase RTE_KA_STATE_SLEEP: /* Idled core */\n \t\t\tbreak;\n \t\t}\n \t}\n@@ -137,7 +141,7 @@ void\n rte_keepalive_register_core(struct rte_keepalive *keepcfg, const int id_core)\n {\n \tif (id_core < RTE_KEEPALIVE_MAXCORES) {\n-\t\tkeepcfg->active_cores[id_core] = 1;\n+\t\tkeepcfg->active_cores[id_core] = RTE_KA_STATE_ALIVE;\n \t\tkeepcfg->last_alive[id_core] = rte_rdtsc();\n \t}\n }\n@@ -145,5 +149,5 @@ rte_keepalive_register_core(struct rte_keepalive *keepcfg, const int id_core)\n void\n rte_keepalive_mark_alive(struct rte_keepalive *keepcfg)\n {\n-\tkeepcfg->state_flags[rte_lcore_id()] = ALIVE;\n+\tkeepcfg->state_flags[rte_lcore_id()] = RTE_KA_STATE_ALIVE;\n }\n",
    "prefixes": [
        "dpdk-dev",
        "v4",
        "1/3"
    ]
}