get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 51752,
    "url": "http://patches.dpdk.org/api/patches/51752/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20190326192556.19934-1-stephen@networkplumber.org/",
    "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": "<20190326192556.19934-1-stephen@networkplumber.org>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20190326192556.19934-1-stephen@networkplumber.org",
    "date": "2019-03-26T19:25:56",
    "name": "[RFC] eal: rename state values in rte_lcore_state",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "ff894ef1b17320cc9d9016e84d210fa6f3e2b2dd",
    "submitter": {
        "id": 27,
        "url": "http://patches.dpdk.org/api/people/27/?format=api",
        "name": "Stephen Hemminger",
        "email": "stephen@networkplumber.org"
    },
    "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/20190326192556.19934-1-stephen@networkplumber.org/mbox/",
    "series": [
        {
            "id": 3933,
            "url": "http://patches.dpdk.org/api/series/3933/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=3933",
            "date": "2019-03-26T19:25:56",
            "name": "[RFC] eal: rename state values in rte_lcore_state",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/3933/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/51752/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/51752/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 0DAE61B494;\n\tTue, 26 Mar 2019 20:26:03 +0100 (CET)",
            "from mail-pf1-f195.google.com (mail-pf1-f195.google.com\n\t[209.85.210.195]) by dpdk.org (Postfix) with ESMTP id 49E111B490\n\tfor <dev@dpdk.org>; Tue, 26 Mar 2019 20:26:01 +0100 (CET)",
            "by mail-pf1-f195.google.com with SMTP id 188so3082868pfd.8\n\tfor <dev@dpdk.org>; Tue, 26 Mar 2019 12:26:01 -0700 (PDT)",
            "from shemminger-XPS-13-9360.lan (204-195-22-127.wavecable.com.\n\t[204.195.22.127]) by smtp.gmail.com with ESMTPSA id\n\tj28sm1882339pgb.46.2019.03.26.12.25.58\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tTue, 26 Mar 2019 12:25:58 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=networkplumber-org.20150623.gappssmtp.com; s=20150623;\n\th=from:to:cc:subject:date:message-id;\n\tbh=SMFuvzai3O4JHq6NkZAttaXmqrvCQzGbNe0wQwij7c0=;\n\tb=DIREPTD3LvLc0b9zmPH4lunpl1/bwRFwlm6oaPXgoP8TqHrU9yIf7IS1jh5HVbotpu\n\txzzDxItCMzWrrIirN+kKPgopzEPE8eMtLNmlHyyF+bXapNO4QE3oMiftBkKvopQKedk5\n\t6+VLfHmsN9UFBXbhukTyu8ZXaQKpUjL4wZMdqdTwH6kr1iYipKhS34OuTc9G+45i7PbP\n\t08igWWPIl/HatQwgHBXiSnVEsRJCS4zQeGSZ9UIkQx4VzWYY1Z3ihG4zOlb096GGlNum\n\tHK2gThKgWQjPT0B5+VCnXvRmZuqYSl2p01LJ7FAzeyM+OvrdznYzK7w3P16zLik+JyVv\n\tGeyQ==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id;\n\tbh=SMFuvzai3O4JHq6NkZAttaXmqrvCQzGbNe0wQwij7c0=;\n\tb=Uj6tKfv87SiSWbVISeRv/RPaymtRSKNYZauyQZpNEmQHYlwxrig0xKeqHyPYZVnSYL\n\tUB3C4kFsIzvOEfR2+jz8W1hAZr2ElCUvPiqg3vnmJ23cqfJyVvRdCRFBpgm3kbpgF7WX\n\tkSoAKK5S0uP4nZusErrorhRgtlHmXRNGjs93/G2beYZM9tVkPLL05Xqt6XDFGbjn1M0V\n\t8vi9yfsjmGoC4dJCg9Et+tr6j0Do2XFU6Z+8xWnwVsCAYlEaIHEWWGaF5DpHj2tKLKSe\n\tsYLrf1zs9eSB8TV/JyBqEe4r0udXzyaqfvUmL19AC8NBGUZ+4PVNN7sM132QtSdgO/Gx\n\tSZ2w==",
        "X-Gm-Message-State": "APjAAAU/dyw7bCdIvqbJXKXRKGGKntDb7SMigZPWt94L9ZJAA/k6RnBQ\n\tsdnQ38dB3rjVs5QZxs2ck/lLguKy/dH+tw==",
        "X-Google-Smtp-Source": "APXvYqwEwM66siD74m390u5K6j7ZeESb9Uf/4qGbzl5+0bGZzLrum2rXPcAgD/n+aFjd2lnjPDn5ww==",
        "X-Received": "by 2002:a63:f80f:: with SMTP id\n\tn15mr30554410pgh.283.1553628360225; \n\tTue, 26 Mar 2019 12:26:00 -0700 (PDT)",
        "From": "Stephen Hemminger <stephen@networkplumber.org>",
        "To": "dev@dpdk.org",
        "Cc": "Stephen Hemminger <stephen@networkplumber.org>",
        "Date": "Tue, 26 Mar 2019 12:25:56 -0700",
        "Message-Id": "<20190326192556.19934-1-stephen@networkplumber.org>",
        "X-Mailer": "git-send-email 2.17.1",
        "Subject": "[dpdk-dev] [RFC] eal: rename state values in rte_lcore_state",
        "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": "C language does not really treat enum's as first class symbols.\nThe values in an enum live in a global namespace.  That means if\nDPDK defines \"RUNNING\" it can't be used by another enum in an\napplication using DPDK.\n\nTo solve this add a prefix \"LCORE_\" to the enum values, and\nmake them grammatically consistent.\n\nAlso, simplify the inline thread_is_running() which is copied\nin softnic and ip_pipeline.\n\nSigned-off-by: Stephen Hemminger <stephen@networkplumber.org>\n---\n drivers/event/octeontx/ssovf_evdev_selftest.c |  2 +-\n drivers/event/sw/sw_evdev_selftest.c          |  4 ++--\n drivers/net/softnic/rte_eth_softnic_thread.c  |  5 +----\n examples/ip_pipeline/thread.c                 |  5 +----\n examples/l2fwd-keepalive/main.c               |  2 +-\n lib/librte_eal/common/eal_common_launch.c     | 12 ++++++------\n lib/librte_eal/common/include/rte_launch.h    |  6 +++---\n lib/librte_eal/common/rte_service.c           |  2 +-\n lib/librte_eal/freebsd/eal/eal_thread.c       |  6 +++---\n lib/librte_eal/linux/eal/eal.c                |  2 +-\n lib/librte_eal/linux/eal/eal_thread.c         |  8 ++++----\n 11 files changed, 24 insertions(+), 30 deletions(-)",
    "diff": "diff --git a/drivers/event/octeontx/ssovf_evdev_selftest.c b/drivers/event/octeontx/ssovf_evdev_selftest.c\nindex 239362fcf549..55d8ac35c190 100644\n--- a/drivers/event/octeontx/ssovf_evdev_selftest.c\n+++ b/drivers/event/octeontx/ssovf_evdev_selftest.c\n@@ -577,7 +577,7 @@ wait_workers_to_join(int lcore, const rte_atomic32_t *count)\n \tRTE_SET_USED(count);\n \n \tprint_cycles = cycles = rte_get_timer_cycles();\n-\twhile (rte_eal_get_lcore_state(lcore) != FINISHED) {\n+\twhile (rte_eal_get_lcore_state(lcore) != LCORE_FINISHED) {\n \t\tuint64_t new_cycles = rte_get_timer_cycles();\n \n \t\tif (new_cycles - print_cycles > rte_get_timer_hz()) {\ndiff --git a/drivers/event/sw/sw_evdev_selftest.c b/drivers/event/sw/sw_evdev_selftest.c\nindex d00d5de613d7..7deb70918fc4 100644\n--- a/drivers/event/sw/sw_evdev_selftest.c\n+++ b/drivers/event/sw/sw_evdev_selftest.c\n@@ -3116,8 +3116,8 @@ worker_loopback(struct test *t, uint8_t disable_implicit_release)\n \trte_eal_remote_launch(worker_loopback_worker_fn, t, w_lcore);\n \n \tprint_cycles = cycles = rte_get_timer_cycles();\n-\twhile (rte_eal_get_lcore_state(p_lcore) != FINISHED ||\n-\t\t\trte_eal_get_lcore_state(w_lcore) != FINISHED) {\n+\twhile (rte_eal_get_lcore_state(p_lcore) != LCORE_FINISHED ||\n+\t       rte_eal_get_lcore_state(w_lcore) != LCORE_FINISHED) {\n \n \t\trte_service_run_iter_on_app_lcore(t->service_id, 1);\n \ndiff --git a/drivers/net/softnic/rte_eth_softnic_thread.c b/drivers/net/softnic/rte_eth_softnic_thread.c\nindex 57989a5aac54..6a06a19bcd3e 100644\n--- a/drivers/net/softnic/rte_eth_softnic_thread.c\n+++ b/drivers/net/softnic/rte_eth_softnic_thread.c\n@@ -118,10 +118,7 @@ thread_is_valid(struct pmd_internals *softnic, uint32_t thread_id)\n static inline int\n thread_is_running(uint32_t thread_id)\n {\n-\tenum rte_lcore_state_t thread_state;\n-\n-\tthread_state = rte_eal_get_lcore_state(thread_id);\n-\treturn (thread_state == RUNNING)? 1 : 0;\n+\treturn rte_eal_get_lcore_state(thread_id) == LCORE_RUNNING;\n }\n \n static int32_t\ndiff --git a/examples/ip_pipeline/thread.c b/examples/ip_pipeline/thread.c\nindex 272fbbeed1bc..6819dd5323e9 100644\n--- a/examples/ip_pipeline/thread.c\n+++ b/examples/ip_pipeline/thread.c\n@@ -158,10 +158,7 @@ thread_init(void)\n static inline int\n thread_is_running(uint32_t thread_id)\n {\n-\tenum rte_lcore_state_t thread_state;\n-\n-\tthread_state = rte_eal_get_lcore_state(thread_id);\n-\treturn (thread_state == RUNNING) ? 1 : 0;\n+\treturn rte_eal_get_lcore_state(thread_id) == LCORE_RUNNING;\n }\n \n /**\ndiff --git a/examples/l2fwd-keepalive/main.c b/examples/l2fwd-keepalive/main.c\nindex 0bf2b533648a..8c56f4aa5ebf 100644\n--- a/examples/l2fwd-keepalive/main.c\n+++ b/examples/l2fwd-keepalive/main.c\n@@ -502,7 +502,7 @@ dead_core(__rte_unused void *ptr_data, const int id_core)\n \tif (terminate_signal_received)\n \t\treturn;\n \tprintf(\"Dead core %i - restarting..\\n\", id_core);\n-\tif (rte_eal_get_lcore_state(id_core) == FINISHED) {\n+\tif (rte_eal_get_lcore_state(id_core) == LCORE_FINISHED) {\n \t\trte_eal_wait_lcore(id_core);\n \t\trte_eal_remote_launch(l2fwd_launch_one_lcore, NULL, id_core);\n \t} else {\ndiff --git a/lib/librte_eal/common/eal_common_launch.c b/lib/librte_eal/common/eal_common_launch.c\nindex fe0ba3f0d617..febf9c7b0c40 100644\n--- a/lib/librte_eal/common/eal_common_launch.c\n+++ b/lib/librte_eal/common/eal_common_launch.c\n@@ -21,17 +21,17 @@\n int\n rte_eal_wait_lcore(unsigned slave_id)\n {\n-\tif (lcore_config[slave_id].state == WAIT)\n+\tif (lcore_config[slave_id].state == LCORE_WAITING)\n \t\treturn 0;\n \n-\twhile (lcore_config[slave_id].state != WAIT &&\n-\t       lcore_config[slave_id].state != FINISHED)\n+\twhile (lcore_config[slave_id].state != LCORE_WAITING &&\n+\t       lcore_config[slave_id].state != LCORE_FINISHED)\n \t\trte_pause();\n \n \trte_rmb();\n \n \t/* we are in finished state, go to wait state */\n-\tlcore_config[slave_id].state = WAIT;\n+\tlcore_config[slave_id].state = LCORE_WAITING;\n \treturn lcore_config[slave_id].ret;\n }\n \n@@ -49,7 +49,7 @@ rte_eal_mp_remote_launch(int (*f)(void *), void *arg,\n \n \t/* check state of lcores */\n \tRTE_LCORE_FOREACH_SLAVE(lcore_id) {\n-\t\tif (lcore_config[lcore_id].state != WAIT)\n+\t\tif (lcore_config[lcore_id].state != LCORE_WAITING)\n \t\t\treturn -EBUSY;\n \t}\n \n@@ -60,7 +60,7 @@ rte_eal_mp_remote_launch(int (*f)(void *), void *arg,\n \n \tif (call_master == CALL_MASTER) {\n \t\tlcore_config[master].ret = f(arg);\n-\t\tlcore_config[master].state = FINISHED;\n+\t\tlcore_config[master].state = LCORE_FINISHED;\n \t}\n \n \treturn 0;\ndiff --git a/lib/librte_eal/common/include/rte_launch.h b/lib/librte_eal/common/include/rte_launch.h\nindex 06a671752ace..45704e37eedf 100644\n--- a/lib/librte_eal/common/include/rte_launch.h\n+++ b/lib/librte_eal/common/include/rte_launch.h\n@@ -19,9 +19,9 @@ extern \"C\" {\n  * State of an lcore.\n  */\n enum rte_lcore_state_t {\n-\tWAIT,       /**< waiting a new command */\n-\tRUNNING,    /**< executing command */\n-\tFINISHED,   /**< command executed */\n+\tLCORE_WAITING,    /**< waiting a new command */\n+\tLCORE_RUNNING,    /**< executing command */\n+\tLCORE_FINISHED,   /**< command executed */\n };\n \n /**\ndiff --git a/lib/librte_eal/common/rte_service.c b/lib/librte_eal/common/rte_service.c\nindex 03fde97a9c89..4468b33a377d 100644\n--- a/lib/librte_eal/common/rte_service.c\n+++ b/lib/librte_eal/common/rte_service.c\n@@ -450,7 +450,7 @@ rte_service_runner_func(void *arg)\n \t\trte_smp_rmb();\n \t}\n \n-\tlcore_config[lcore].state = WAIT;\n+\tlcore_config[lcore].state = LCORE_WAITING;\n \n \treturn 0;\n }\ndiff --git a/lib/librte_eal/freebsd/eal/eal_thread.c b/lib/librte_eal/freebsd/eal/eal_thread.c\nindex 309b5872666b..c0a26c65bc27 100644\n--- a/lib/librte_eal/freebsd/eal/eal_thread.c\n+++ b/lib/librte_eal/freebsd/eal/eal_thread.c\n@@ -41,7 +41,7 @@ rte_eal_remote_launch(int (*f)(void *), void *arg, unsigned slave_id)\n \tint m2s = lcore_config[slave_id].pipe_master2slave[1];\n \tint s2m = lcore_config[slave_id].pipe_slave2master[0];\n \n-\tif (lcore_config[slave_id].state != WAIT)\n+\tif (lcore_config[slave_id].state != LCORE_WAITING)\n \t\treturn -EBUSY;\n \n \tlcore_config[slave_id].f = f;\n@@ -136,7 +136,7 @@ eal_thread_loop(__attribute__((unused)) void *arg)\n \t\tif (n <= 0)\n \t\t\trte_panic(\"cannot read on configuration pipe\\n\");\n \n-\t\tlcore_config[lcore_id].state = RUNNING;\n+\t\tlcore_config[lcore_id].state = LCORE_RUNNING;\n \n \t\t/* send ack */\n \t\tn = 0;\n@@ -153,7 +153,7 @@ eal_thread_loop(__attribute__((unused)) void *arg)\n \t\tret = lcore_config[lcore_id].f(fct_arg);\n \t\tlcore_config[lcore_id].ret = ret;\n \t\trte_wmb();\n-\t\tlcore_config[lcore_id].state = FINISHED;\n+\t\tlcore_config[lcore_id].state = LCORE_FINISHED;\n \t}\n \n \t/* never reached */\ndiff --git a/lib/librte_eal/linux/eal/eal.c b/lib/librte_eal/linux/eal/eal.c\nindex 13f40168415d..8b93a7b929a9 100644\n--- a/lib/librte_eal/linux/eal/eal.c\n+++ b/lib/librte_eal/linux/eal/eal.c\n@@ -1158,7 +1158,7 @@ rte_eal_init(int argc, char **argv)\n \t\tif (pipe(lcore_config[i].pipe_slave2master) < 0)\n \t\t\trte_panic(\"Cannot create pipe\\n\");\n \n-\t\tlcore_config[i].state = WAIT;\n+\t\tlcore_config[i].state = LCORE_WAITING;\n \n \t\t/* create a thread for each lcore */\n \t\tret = pthread_create(&lcore_config[i].thread_id, NULL,\ndiff --git a/lib/librte_eal/linux/eal/eal_thread.c b/lib/librte_eal/linux/eal/eal_thread.c\nindex 379773b683e8..63f3e66110e7 100644\n--- a/lib/librte_eal/linux/eal/eal_thread.c\n+++ b/lib/librte_eal/linux/eal/eal_thread.c\n@@ -41,7 +41,7 @@ rte_eal_remote_launch(int (*f)(void *), void *arg, unsigned slave_id)\n \tint m2s = lcore_config[slave_id].pipe_master2slave[1];\n \tint s2m = lcore_config[slave_id].pipe_slave2master[0];\n \n-\tif (lcore_config[slave_id].state != WAIT)\n+\tif (lcore_config[slave_id].state != LCORE_WAITING)\n \t\treturn -EBUSY;\n \n \tlcore_config[slave_id].f = f;\n@@ -136,7 +136,7 @@ eal_thread_loop(__attribute__((unused)) void *arg)\n \t\tif (n <= 0)\n \t\t\trte_panic(\"cannot read on configuration pipe\\n\");\n \n-\t\tlcore_config[lcore_id].state = RUNNING;\n+\t\tlcore_config[lcore_id].state = LCORE_RUNNING;\n \n \t\t/* send ack */\n \t\tn = 0;\n@@ -158,9 +158,9 @@ eal_thread_loop(__attribute__((unused)) void *arg)\n \t\t * state, because the application will not lcore_wait() for it.\n \t\t */\n \t\tif (lcore_config[lcore_id].core_role == ROLE_SERVICE)\n-\t\t\tlcore_config[lcore_id].state = WAIT;\n+\t\t\tlcore_config[lcore_id].state = LCORE_WAITING;\n \t\telse\n-\t\t\tlcore_config[lcore_id].state = FINISHED;\n+\t\t\tlcore_config[lcore_id].state = LCORE_FINISHED;\n \t}\n \n \t/* never reached */\n",
    "prefixes": [
        "RFC"
    ]
}