get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 52122,
    "url": "https://patches.dpdk.org/api/patches/52122/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20190402155722.21400-1-stephen@networkplumber.org/",
    "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": "<20190402155722.21400-1-stephen@networkplumber.org>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20190402155722.21400-1-stephen@networkplumber.org",
    "date": "2019-04-02T15:57:22",
    "name": "[v2] eal: rename state values in rte_lcore_state",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "642ecd27fb21599672099a986989202171d9d756",
    "submitter": {
        "id": 27,
        "url": "https://patches.dpdk.org/api/people/27/?format=api",
        "name": "Stephen Hemminger",
        "email": "stephen@networkplumber.org"
    },
    "delegate": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20190402155722.21400-1-stephen@networkplumber.org/mbox/",
    "series": [
        {
            "id": 4063,
            "url": "https://patches.dpdk.org/api/series/4063/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=4063",
            "date": "2019-04-02T15:57:22",
            "name": "[v2] eal: rename state values in rte_lcore_state",
            "version": 2,
            "mbox": "https://patches.dpdk.org/series/4063/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/52122/comments/",
    "check": "fail",
    "checks": "https://patches.dpdk.org/api/patches/52122/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 512BC378B;\n\tTue,  2 Apr 2019 17:57:32 +0200 (CEST)",
            "from mail-pf1-f195.google.com (mail-pf1-f195.google.com\n\t[209.85.210.195]) by dpdk.org (Postfix) with ESMTP id CA2D32B99\n\tfor <dev@dpdk.org>; Tue,  2 Apr 2019 17:57:30 +0200 (CEST)",
            "by mail-pf1-f195.google.com with SMTP id 8so6602444pfr.4\n\tfor <dev@dpdk.org>; Tue, 02 Apr 2019 08:57:30 -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\t143sm21259094pge.50.2019.04.02.08.57.27\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tTue, 02 Apr 2019 08:57:28 -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:in-reply-to:references;\n\tbh=QBJiEr+r2QY2Jj9sl4y384/vmt1NMtorn9sBFQeouw4=;\n\tb=qWdtKWl0/kWVPwocB5M9P+wPJAsPhlx4MUQoUUPl9BHYv/J88o4liIeitpvcXWapvz\n\tfY8pclsUQsQdTUMdvQyqaO8jAlqaIcKO4XQiMqcjcXHU+lLiq8nQFXni5U0gEWW7/gSe\n\tXcKcjol47C9hIo1GR9xHyMeZ4FjZO8RKPu/pDQD+3cNpcRA8M4ZDAiHL/mtFtAurmIVT\n\t+d3yvuxiXfUH8hg50+remfXvbAWWMoT2fhkPA1l6x1IiVmyX0MhR+4mZFerhs0XDVKWG\n\tb+L48Q58Tw3eATRh2DyYCGOzWeJlbS1WImP4VmbRiCVSasM7uqIIcJ8420tBW6lhZBli\n\tzOaQ==",
        "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:in-reply-to\n\t:references;\n\tbh=QBJiEr+r2QY2Jj9sl4y384/vmt1NMtorn9sBFQeouw4=;\n\tb=hLPnzs9YNQ9SuyDLuyW4Acc25/a+1BiZow/PSo5fuZYwyJxp+vd4vWXTg4k/6fHaAd\n\tHQESZ/E+WtZ2y5B/Hxmx6q6SiEBaWOL4QA35MVieH3XJQQ91D1019Zmm2JV1rf3Uu3xm\n\tNf10KE/YHd3dvm/20Czzq1UM7PgU0ProuEM2M913fun5d68MNaL5OM8x0Nw8c24MhkHJ\n\ty7EuaNJNmrDyGaL79+Sdgf4MZ6J3Ra4Ncnw6I3pF7T/cdmYgH0IJR7mHdOplxqeUzZSu\n\tVks7fqzgSY49NolQF17v+1MFs8xBmBy2UIKm6Km+HnvlNWaXdu0fqbDYd7MXvsaQmao6\n\tdWpg==",
        "X-Gm-Message-State": "APjAAAW9BxMnZHlfT/V+bELYfwXLTI/YZa9VPPSd5nVS3VCoGfJPu1Ss\n\tcJ4p6dHawme4d3fryqVnBY7GhXPL5SiH3Q==",
        "X-Google-Smtp-Source": "APXvYqyts1cQGYOx7upHH+vwLDr/nDlh2qRdp5lWVUqI18kz+OHmexSVO9imaWnfvOkTzonnXVzYVg==",
        "X-Received": "by 2002:a62:480d:: with SMTP id\n\tv13mr70536296pfa.125.1554220649460; \n\tTue, 02 Apr 2019 08:57:29 -0700 (PDT)",
        "From": "Stephen Hemminger <stephen@networkplumber.org>",
        "To": "dev@dpdk.org",
        "Cc": "Stephen Hemminger <stephen@networkplumber.org>",
        "Date": "Tue,  2 Apr 2019 08:57:22 -0700",
        "Message-Id": "<20190402155722.21400-1-stephen@networkplumber.org>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20190326192556.19934-1-stephen@networkplumber.org>",
        "References": "<20190326192556.19934-1-stephen@networkplumber.org>",
        "Subject": "[dpdk-dev] [PATCH v2] 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 \"RTE_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---\nv2 - change prefix to RTE_LCORE_\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..06370840ba36 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) != RTE_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..9e16f7d3520f 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) != RTE_LCORE_FINISHED ||\n+\t       rte_eal_get_lcore_state(w_lcore) != RTE_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..dee3923101bc 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) == RTE_LCORE_RUNNING;\n }\n \n static int32_t\ndiff --git a/examples/ip_pipeline/thread.c b/examples/ip_pipeline/thread.c\nindex 272fbbeed1bc..3a62a0aee8bc 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) == RTE_LCORE_RUNNING;\n }\n \n /**\ndiff --git a/examples/l2fwd-keepalive/main.c b/examples/l2fwd-keepalive/main.c\nindex 0bf2b533648a..2e1edfa05937 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) == RTE_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..74a3f1a28432 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 == RTE_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 != RTE_LCORE_WAITING &&\n+\t       lcore_config[slave_id].state != RTE_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 = RTE_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 != RTE_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 = RTE_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..286ca31c98ab 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+\tRTE_LCORE_WAITING,    /**< waiting a new command */\n+\tRTE_LCORE_RUNNING,    /**< executing command */\n+\tRTE_LCORE_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 5f75e5a53fbf..8dd7586027ff 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 = RTE_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..f25e84fa312b 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 != RTE_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 = RTE_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 = RTE_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 75ed0cf1029f..3fe25a1feb2f 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 = RTE_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..058692a45412 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 != RTE_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 = RTE_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 = RTE_LCORE_WAITING;\n \t\telse\n-\t\t\tlcore_config[lcore_id].state = FINISHED;\n+\t\t\tlcore_config[lcore_id].state = RTE_LCORE_FINISHED;\n \t}\n \n \t/* never reached */\n",
    "prefixes": [
        "v2"
    ]
}