Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/55105/?format=api
https://patches.dpdk.org/api/patches/55105/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/20190619192215.25923-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": "<20190619192215.25923-1-stephen@networkplumber.org>", "list_archive_url": "https://inbox.dpdk.org/dev/20190619192215.25923-1-stephen@networkplumber.org", "date": "2019-06-19T19:22:15", "name": "[v4] eal: rename state values in rte_lcore_state", "commit_ref": null, "pull_url": null, "state": "rejected", "archived": true, "hash": "9bc92fad5beacaa7230bf938642339ec4213a361", "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/20190619192215.25923-1-stephen@networkplumber.org/mbox/", "series": [ { "id": 5092, "url": "https://patches.dpdk.org/api/series/5092/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=5092", "date": "2019-06-19T19:22:15", "name": "[v4] eal: rename state values in rte_lcore_state", "version": 4, "mbox": "https://patches.dpdk.org/series/5092/mbox/" } ], "comments": "https://patches.dpdk.org/api/patches/55105/comments/", "check": "fail", "checks": "https://patches.dpdk.org/api/patches/55105/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 D256B1D167;\n\tWed, 19 Jun 2019 21:22:29 +0200 (CEST)", "from mail-pg1-f194.google.com (mail-pg1-f194.google.com\n\t[209.85.215.194]) by dpdk.org (Postfix) with ESMTP id C43AD1D164\n\tfor <dev@dpdk.org>; Wed, 19 Jun 2019 21:22:28 +0200 (CEST)", "by mail-pg1-f194.google.com with SMTP id v11so204490pgl.5\n\tfor <dev@dpdk.org>; Wed, 19 Jun 2019 12:22:28 -0700 (PDT)", "from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127])\n\tby smtp.gmail.com with ESMTPSA id\n\tt11sm16286209pgp.1.2019.06.19.12.22.26\n\t(version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256);\n\tWed, 19 Jun 2019 12:22:26 -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:mime-version\n\t:content-transfer-encoding;\n\tbh=dXx9c4UZzMFzhujU8z0PP5bwfHyKxdv0m4DgX92L028=;\n\tb=yutegDHhAH9EH6gAktLSHpKiMxY/e+qMG+J/lYgu4uRyClyugWU84WxLMEOGgbV4Hc\n\tFhxm9VunXTB+uJPUnIkK31GNXKCOtigUbTdBHzsfBW9o/a5vebXSxo/a26ZrwKl7n2oa\n\tdUtcM6L5cRlPCBPknD/2EIACeYTpEX5a40Zt+Xn00/twq+sAXpsD2clYdVN+UDn3zDyo\n\t+A0soAz+Uku0l8dALH/nd5V9eSQItNrWWnpj79QM8wzpc1y414qOZAx7dFZ04qL1TEPl\n\tLCCPReSCp3hLe0a+A+IlcQjLpDaQvA/MAXL7jOFwzy9ZOaohwUynKP1pqKm66yJmbOzO\n\tFfFA==", "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:mime-version\n\t:content-transfer-encoding;\n\tbh=dXx9c4UZzMFzhujU8z0PP5bwfHyKxdv0m4DgX92L028=;\n\tb=n8ZaCwyWxAcSVcxk9Ojv58I4SG1bnTfZtkRTzDx/D3EXoGsQbI9gD9mqOJvFbmH2zN\n\ttgn+GEuC6wa77CmxAHYOIbywgAAwyYIbThFy9sMVCZ/jt5lg1UcltmLnptFA6vGyWQ8e\n\teC5wlFofWR2/liIdMv7as0S2Rndi9dvwcaTIZiV2Bx2Bf+3EX1G6l9f1NieBJf3PFLzd\n\tOMYfU+cHbDftUOaaLUpG+p8cTeF5PP25vf3cK8+Ok+JbzhDz7yaOXDKXy5cJHi9eMCJL\n\tK+fW+9RRAXYmwKXLM3pD4E23q1AoHkR4Xyu7jdfBPN7/65II6iQz8Xi0I/Tdo5uQsb34\n\t3dRA==", "X-Gm-Message-State": "APjAAAW+cJagVTm9n33d3MbVT/qdoYtI2XVNJguVFdy/8hBqco2nZbRd\n\twkjK028zIOuVYAEFLsd6lpRa7DxSYl8=", "X-Google-Smtp-Source": "APXvYqxxSQQOJMJaWkNBuXkUau0EcK32w1FJNG4Hp/c6DdP8+OI4l3H4f9khXQyWwlNpOdqFTp67wA==", "X-Received": "by 2002:a63:5065:: with SMTP id q37mr9166326pgl.32.1560972147513;\n\tWed, 19 Jun 2019 12:22:27 -0700 (PDT)", "From": "Stephen Hemminger <stephen@networkplumber.org>", "To": "dev@dpdk.org", "Cc": "Stephen Hemminger <stephen@networkplumber.org>", "Date": "Wed, 19 Jun 2019 12:22:15 -0700", "Message-Id": "<20190619192215.25923-1-stephen@networkplumber.org>", "X-Mailer": "git-send-email 2.20.1", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[dpdk-dev] [PATCH v4] 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---\nv4 - rebase (after lcore changes),fix FreeBSD typo\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/bond/main.c | 4 ++--\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.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 13 files changed, 27 insertions(+), 33 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 38c21fa0fa3d..af5724aa348a 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 d610b1617e77..ddff2b81c169 100644\n--- a/drivers/net/softnic/rte_eth_softnic_thread.c\n+++ b/drivers/net/softnic/rte_eth_softnic_thread.c\n@@ -113,10 +113,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/bond/main.c b/examples/bond/main.c\nindex 1c0df9d46797..42af07aa0227 100644\n--- a/examples/bond/main.c\n+++ b/examples/bond/main.c\n@@ -533,7 +533,7 @@ static void cmd_start_parsed(__attribute__((unused)) void *parsed_result,\n \trte_spinlock_trylock(&global_flag_stru_p->lock);\n \tif (global_flag_stru_p->LcoreMainIsRunning == 0) {\n \t\tif (rte_eal_get_lcore_state(global_flag_stru_p->LcoreMainCore)\n-\t\t != WAIT) {\n+\t\t != RTE_LCORE_WAITING) {\n \t\t\trte_spinlock_unlock(&global_flag_stru_p->lock);\n \t\t\treturn;\n \t\t}\n@@ -801,7 +801,7 @@ main(int argc, char *argv[])\n \n \t/* check state of lcores */\n \tRTE_LCORE_FOREACH_SLAVE(slave_core_id) {\n-\t\tif (rte_eal_get_lcore_state(slave_core_id) != WAIT)\n+\t\tif (rte_eal_get_lcore_state(slave_core_id) != RTE_LCORE_WAITING)\n \t\t\treturn -EBUSY;\n \t}\n \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 9831a4323785..f56e35cba519 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.c b/lib/librte_eal/freebsd/eal/eal.c\nindex 4eaa53195e04..50a858c88405 100644\n--- a/lib/librte_eal/freebsd/eal/eal.c\n+++ b/lib/librte_eal/freebsd/eal/eal.c\n@@ -784,7 +784,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/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 3e1d6eb6a1f3..92d7d652b905 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": [ "v4" ] }{ "id": 55105, "url": "