Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/52801/?format=api
http://patches.dpdk.org/api/patches/52801/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/1555364488-28207-3-git-send-email-erik.g.carrillo@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": "<1555364488-28207-3-git-send-email-erik.g.carrillo@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1555364488-28207-3-git-send-email-erik.g.carrillo@intel.com", "date": "2019-04-15T21:41:28", "name": "[v5,2/2] timer: add function to stop all timers in a list", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "7366e3aa7813fcc1f48b8c71a39366381946fdd9", "submitter": { "id": 762, "url": "http://patches.dpdk.org/api/people/762/?format=api", "name": "Carrillo, Erik G", "email": "erik.g.carrillo@intel.com" }, "delegate": null, "mbox": "http://patches.dpdk.org/project/dpdk/patch/1555364488-28207-3-git-send-email-erik.g.carrillo@intel.com/mbox/", "series": [ { "id": 4319, "url": "http://patches.dpdk.org/api/series/4319/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=4319", "date": "2019-04-15T21:41:26", "name": "Timer library changes", "version": 5, "mbox": "http://patches.dpdk.org/series/4319/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/52801/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/52801/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 D892A1B432;\n\tMon, 15 Apr 2019 23:42:40 +0200 (CEST)", "from mga02.intel.com (mga02.intel.com [134.134.136.20])\n\tby dpdk.org (Postfix) with ESMTP id D09251B429\n\tfor <dev@dpdk.org>; Mon, 15 Apr 2019 23:42:35 +0200 (CEST)", "from orsmga002.jf.intel.com ([10.7.209.21])\n\tby orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t15 Apr 2019 14:42:35 -0700", "from txasoft-yocto.an.intel.com ([10.123.72.192])\n\tby orsmga002.jf.intel.com with ESMTP; 15 Apr 2019 14:42:34 -0700" ], "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.60,355,1549958400\"; d=\"scan'208\";a=\"151130533\"", "From": "Erik Gabriel Carrillo <erik.g.carrillo@intel.com>", "To": "rsanford@akamai.com,\n\tthomas@monjalon.net", "Cc": "dev@dpdk.org", "Date": "Mon, 15 Apr 2019 16:41:28 -0500", "Message-Id": "<1555364488-28207-3-git-send-email-erik.g.carrillo@intel.com>", "X-Mailer": "git-send-email 1.7.10", "In-Reply-To": "<1555364488-28207-1-git-send-email-erik.g.carrillo@intel.com>", "References": "<1551892822-23967-1-git-send-email-erik.g.carrillo@intel.com>\n\t<1555364488-28207-1-git-send-email-erik.g.carrillo@intel.com>", "Subject": "[dpdk-dev] [PATCH v5 2/2] timer: add function to stop all timers in\n\ta list", "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": "Add a function to the timer API that allows a caller to traverse a\nspecified set of timer lists, stopping each timer in each list,\nand invoking a callback function.\n\nSigned-off-by: Erik Gabriel Carrillo <erik.g.carrillo@intel.com>\n---\n lib/librte_timer/rte_timer.c | 38 ++++++++++++++++++++++++++++++++++\n lib/librte_timer/rte_timer.h | 32 ++++++++++++++++++++++++++++\n lib/librte_timer/rte_timer_version.map | 1 +\n 3 files changed, 71 insertions(+)", "diff": "diff --git a/lib/librte_timer/rte_timer.c b/lib/librte_timer/rte_timer.c\nindex 511d902..ae5d236 100644\n--- a/lib/librte_timer/rte_timer.c\n+++ b/lib/librte_timer/rte_timer.c\n@@ -999,6 +999,44 @@ rte_timer_alt_manage(uint32_t timer_data_id,\n \treturn 0;\n }\n \n+/* Walk pending lists, stopping timers and calling user-specified function */\n+int __rte_experimental\n+rte_timer_stop_all(uint32_t timer_data_id, unsigned int *walk_lcores,\n+\t\t int nb_walk_lcores,\n+\t\t rte_timer_stop_all_cb_t f, void *f_arg)\n+{\n+\tint i;\n+\tstruct priv_timer *priv_timer;\n+\tuint32_t walk_lcore;\n+\tstruct rte_timer *tim, *next_tim;\n+\tstruct rte_timer_data *timer_data;\n+\n+\tTIMER_DATA_VALID_GET_OR_ERR_RET(timer_data_id, timer_data, -EINVAL);\n+\n+\tfor (i = 0; i < nb_walk_lcores; i++) {\n+\t\twalk_lcore = walk_lcores[i];\n+\t\tpriv_timer = &timer_data->priv_timer[walk_lcore];\n+\n+\t\trte_spinlock_lock(&priv_timer->list_lock);\n+\n+\t\tfor (tim = priv_timer->pending_head.sl_next[0];\n+\t\t tim != NULL;\n+\t\t tim = next_tim) {\n+\t\t\tnext_tim = tim->sl_next[0];\n+\n+\t\t\t/* Call timer_stop with lock held */\n+\t\t\t__rte_timer_stop(tim, 1, timer_data);\n+\n+\t\t\tif (f)\n+\t\t\t\tf(tim, f_arg);\n+\t\t}\n+\n+\t\trte_spinlock_unlock(&priv_timer->list_lock);\n+\t}\n+\n+\treturn 0;\n+}\n+\n /* dump statistics about timers */\n static void\n __rte_timer_dump_stats(struct rte_timer_data *timer_data __rte_unused, FILE *f)\ndiff --git a/lib/librte_timer/rte_timer.h b/lib/librte_timer/rte_timer.h\nindex 6a9c499..b502f8c 100644\n--- a/lib/librte_timer/rte_timer.h\n+++ b/lib/librte_timer/rte_timer.h\n@@ -500,6 +500,38 @@ rte_timer_alt_manage(uint32_t timer_data_id, unsigned int *poll_lcores,\n \t\t int n_poll_lcores, rte_timer_alt_manage_cb_t f);\n \n /**\n+ * Callback function type for rte_timer_stop_all().\n+ */\n+typedef void (*rte_timer_stop_all_cb_t)(struct rte_timer *tim, void *arg);\n+\n+/**\n+ * @warning\n+ * @b EXPERIMENTAL: this API may change without prior notice\n+ *\n+ * Walk the pending timer lists for the specified lcore IDs, and for each timer\n+ * that is encountered, stop it and call the specified callback function to\n+ * process it further.\n+ *\n+ * @param timer_data_id\n+ * An identifier indicating which instance of timer data should be used for\n+ * this operation.\n+ * @param walk_lcores\n+ * An array of lcore ids identifying the timer lists that should be processed.\n+ * @param nb_walk_lcores\n+ * The size of the walk_lcores array.\n+ * @param f\n+ * The callback function which should be called for each timers. Can be NULL.\n+ * @param f_arg\n+ * An arbitrary argument that will be passed to f, if it is called.\n+ * @return\n+ * - 0: success\n+ * - EINVAL: invalid timer_data_id\n+ */\n+int __rte_experimental\n+rte_timer_stop_all(uint32_t timer_data_id, unsigned int *walk_lcores,\n+\t\t int nb_walk_lcores, rte_timer_stop_all_cb_t f, void *f_arg);\n+\n+/**\n * @warning\n * @b EXPERIMENTAL: this API may change without prior notice\n *\ndiff --git a/lib/librte_timer/rte_timer_version.map b/lib/librte_timer/rte_timer_version.map\nindex c2e5836..72f75c8 100644\n--- a/lib/librte_timer/rte_timer_version.map\n+++ b/lib/librte_timer/rte_timer_version.map\n@@ -33,5 +33,6 @@ EXPERIMENTAL {\n \trte_timer_alt_stop;\n \trte_timer_data_alloc;\n \trte_timer_data_dealloc;\n+\trte_timer_stop_all;\n \trte_timer_subsystem_finalize;\n };\n", "prefixes": [ "v5", "2/2" ] }{ "id": 52801, "url": "