Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/12297/?format=api
https://patches.dpdk.org/api/patches/12297/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/1461908467-1815-2-git-send-email-remy.horton@intel.com/", "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": "<1461908467-1815-2-git-send-email-remy.horton@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1461908467-1815-2-git-send-email-remy.horton@intel.com", "date": "2016-04-29T05:41:05", "name": "[dpdk-dev,v1,1/3] eal: add new keepalive state & callback hook", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "fccb957fcb92f438590e21b510724a4742bd6df5", "submitter": { "id": 326, "url": "https://patches.dpdk.org/api/people/326/?format=api", "name": "Remy Horton", "email": "remy.horton@intel.com" }, "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/1461908467-1815-2-git-send-email-remy.horton@intel.com/mbox/", "series": [], "comments": "https://patches.dpdk.org/api/patches/12297/comments/", "check": "pending", "checks": "https://patches.dpdk.org/api/patches/12297/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 416AF58C5;\n\tFri, 29 Apr 2016 07:41:16 +0200 (CEST)", "from mga09.intel.com (mga09.intel.com [134.134.136.24])\n\tby dpdk.org (Postfix) with ESMTP id A08FC5693\n\tfor <dev@dpdk.org>; Fri, 29 Apr 2016 07:41:13 +0200 (CEST)", "from orsmga003.jf.intel.com ([10.7.209.27])\n\tby orsmga102.jf.intel.com with ESMTP; 28 Apr 2016 22:41:11 -0700", "from rhorton-mobl.ger.corp.intel.com (HELO VM.ir.intel.com)\n\t([163.33.228.53])\n\tby orsmga003.jf.intel.com with ESMTP; 28 Apr 2016 22:41:11 -0700" ], "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.24,550,1455004800\"; d=\"scan'208\";a=\"794786660\"", "From": "Remy Horton <remy.horton@intel.com>", "To": "dev@dpdk.org", "Date": "Fri, 29 Apr 2016 06:41:05 +0100", "Message-Id": "<1461908467-1815-2-git-send-email-remy.horton@intel.com>", "X-Mailer": "git-send-email 2.5.5", "In-Reply-To": "<1461908467-1815-1-git-send-email-remy.horton@intel.com>", "References": "<1461908467-1815-1-git-send-email-remy.horton@intel.com>", "Subject": "[dpdk-dev] [PATCH v1 1/3] eal: add new keepalive state & callback\n\thook", "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": "Signed-off-by: Remy Horton <remy.horton@intel.com>\n---\n lib/librte_eal/bsdapp/eal/rte_eal_version.map | 7 +++++\n lib/librte_eal/common/include/rte_keepalive.h | 40 +++++++++++++++++++++++++\n lib/librte_eal/common/rte_keepalive.c | 35 ++++++++++++++++++++--\n lib/librte_eal/linuxapp/eal/rte_eal_version.map | 7 +++++\n 4 files changed, 87 insertions(+), 2 deletions(-)", "diff": "diff --git a/lib/librte_eal/bsdapp/eal/rte_eal_version.map b/lib/librte_eal/bsdapp/eal/rte_eal_version.map\nindex 58c2951..9a33441 100644\n--- a/lib/librte_eal/bsdapp/eal/rte_eal_version.map\n+++ b/lib/librte_eal/bsdapp/eal/rte_eal_version.map\n@@ -151,3 +151,10 @@ DPDK_16.04 {\n \trte_eal_primary_proc_alive;\n \n } DPDK_2.2;\n+\n+DPDK_16.7 {\n+\tglobal:\n+\n+\trte_keepalive_register_alive_callback;\n+\n+} DPDK_16.04;\ndiff --git a/lib/librte_eal/common/include/rte_keepalive.h b/lib/librte_eal/common/include/rte_keepalive.h\nindex 10dac2e..3159730 100644\n--- a/lib/librte_eal/common/include/rte_keepalive.h\n+++ b/lib/librte_eal/common/include/rte_keepalive.h\n@@ -59,6 +59,16 @@ typedef void (*rte_keepalive_failure_callback_t)(\n \tconst int id_core);\n \n /**\n+ * Keepalive 'alive' callback.\n+ *\n+ * Receives a data pointer passed to rte_keepalive_register_alive_callback()\n+ * and the id of the failed core.\n+ */\n+typedef void (*rte_keepalive_alive_callback_t)(\n+\tvoid *data,\n+\tconst int id_core);\n+\n+/**\n * Keepalive state structure.\n * @internal\n */\n@@ -105,4 +115,34 @@ void rte_keepalive_register_core(struct rte_keepalive *keepcfg,\n void\n rte_keepalive_mark_alive(struct rte_keepalive *keepcfg);\n \n+/**\n+ * Per-core sleep-time indication.\n+ * @param *keepcfg\n+ * Keepalive structure pointer\n+ *\n+ * This function needs to be called from within the main process loop of\n+ * the LCore going to sleep.\n+ */\n+void\n+rte_keepalive_mark_sleep(struct rte_keepalive *keepcfg);\n+\n+/**\n+ * Registers a 'live core' callback.\n+ *\n+ * The complement of the 'dead core' callback. This is called when a\n+ * core is known to be alive, and is intended for cases when an app\n+ * needs to know 'liveness' beyond just knowing when a core has died.\n+ *\n+ * @param *keepcfg\n+ * Keepalive structure pointer\n+ * @param callback\n+ * Function called upon detection of a dead core.\n+ * @param data\n+ * Data pointer to be passed to function callback.\n+ */\n+void\n+rte_keepalive_register_alive_callback(struct rte_keepalive *keepcfg,\n+\trte_keepalive_alive_callback_t callback,\n+\tvoid *data);\n+\n #endif /* _KEEPALIVE_H_ */\ndiff --git a/lib/librte_eal/common/rte_keepalive.c b/lib/librte_eal/common/rte_keepalive.c\nindex 23363ec..7af3558 100644\n--- a/lib/librte_eal/common/rte_keepalive.c\n+++ b/lib/librte_eal/common/rte_keepalive.c\n@@ -46,7 +46,8 @@ struct rte_keepalive {\n \t\tALIVE = 1,\n \t\tMISSING = 0,\n \t\tDEAD = 2,\n-\t\tGONE = 3\n+\t\tGONE = 3,\n+\t\tSLEEP = 4\n \t} __rte_cache_aligned state_flags[RTE_KEEPALIVE_MAXCORES];\n \n \t/** Last-seen-alive timestamps */\n@@ -68,6 +69,15 @@ struct rte_keepalive {\n \tvoid *callback_data;\n \tuint64_t tsc_initial;\n \tuint64_t tsc_mhz;\n+\n+\t/** Live core handler. */\n+\trte_keepalive_failure_callback_t alive_callback;\n+\n+\t/**\n+\t * Live core handler app data.\n+\t * Pointer is passed to live core handler.\n+\t */\n+\tvoid *alive_callback_data;\n };\n \n static void\n@@ -95,6 +105,11 @@ rte_keepalive_dispatch_pings(__rte_unused void *ptr_timer,\n \t\tcase ALIVE: /* Alive */\n \t\t\tkeepcfg->state_flags[idx_core] = MISSING;\n \t\t\tkeepcfg->last_alive[idx_core] = rte_rdtsc();\n+\t\t\tif (keepcfg->alive_callback)\n+\t\t\t\tkeepcfg->alive_callback(\n+\t\t\t\t\tkeepcfg->alive_callback_data,\n+\t\t\t\t\tidx_core\n+\t\t\t\t\t);\n \t\t\tbreak;\n \t\tcase MISSING: /* MIA */\n \t\t\tprint_trace(\"Core MIA. \", keepcfg, idx_core);\n@@ -111,6 +126,8 @@ rte_keepalive_dispatch_pings(__rte_unused void *ptr_timer,\n \t\t\tbreak;\n \t\tcase GONE: /* Buried */\n \t\t\tbreak;\n+\t\tcase SLEEP: /* Idled core */\n+\t\t\tbreak;\n \t\t}\n \t}\n }\n@@ -133,11 +150,19 @@ rte_keepalive_create(rte_keepalive_failure_callback_t callback,\n \treturn keepcfg;\n }\n \n+void rte_keepalive_register_alive_callback(struct rte_keepalive *keepcfg,\n+\trte_keepalive_failure_callback_t callback,\n+\tvoid *data)\n+{\n+\tkeepcfg->alive_callback = callback;\n+\tkeepcfg->alive_callback_data = data;\n+}\n+\n 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] = ALIVE;\n \t\tkeepcfg->last_alive[id_core] = rte_rdtsc();\n \t}\n }\n@@ -147,3 +172,9 @@ rte_keepalive_mark_alive(struct rte_keepalive *keepcfg)\n {\n \tkeepcfg->state_flags[rte_lcore_id()] = ALIVE;\n }\n+\n+void\n+rte_keepalive_mark_sleep(struct rte_keepalive *keepcfg)\n+{\n+\tkeepcfg->state_flags[rte_lcore_id()] = SLEEP;\n+}\ndiff --git a/lib/librte_eal/linuxapp/eal/rte_eal_version.map b/lib/librte_eal/linuxapp/eal/rte_eal_version.map\nindex 12503ef..862bc92 100644\n--- a/lib/librte_eal/linuxapp/eal/rte_eal_version.map\n+++ b/lib/librte_eal/linuxapp/eal/rte_eal_version.map\n@@ -154,3 +154,10 @@ DPDK_16.04 {\n \trte_eal_primary_proc_alive;\n \n } DPDK_2.2;\n+\n+DPDK_16.7 {\n+\tglobal:\n+\n+\trte_keepalive_register_alive_callback;\n+\n+} DPDK_16.04;\n", "prefixes": [ "dpdk-dev", "v1", "1/3" ] }{ "id": 12297, "url": "