Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/73683/?format=api
http://patchwork.dpdk.org/api/patches/73683/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20200710065954.4937-1-sarosh.arif@emumba.com/", "project": { "id": 1, "url": "http://patchwork.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": "<20200710065954.4937-1-sarosh.arif@emumba.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20200710065954.4937-1-sarosh.arif@emumba.com", "date": "2020-07-10T06:59:54", "name": "[v3] lib/librte_timer:fix corruption with reset", "commit_ref": null, "pull_url": null, "state": "rejected", "archived": true, "hash": "c990db4fc5745e27ff7c92bcbb85b1d55b616a75", "submitter": { "id": 1638, "url": "http://patchwork.dpdk.org/api/people/1638/?format=api", "name": "Sarosh Arif", "email": "sarosh.arif@emumba.com" }, "delegate": { "id": 1, "url": "http://patchwork.dpdk.org/api/users/1/?format=api", "username": "tmonjalo", "first_name": "Thomas", "last_name": "Monjalon", "email": "thomas@monjalon.net" }, "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20200710065954.4937-1-sarosh.arif@emumba.com/mbox/", "series": [ { "id": 10940, "url": "http://patchwork.dpdk.org/api/series/10940/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=10940", "date": "2020-07-10T06:59:54", "name": "[v3] lib/librte_timer:fix corruption with reset", "version": 3, "mbox": "http://patchwork.dpdk.org/series/10940/mbox/" } ], "comments": "http://patchwork.dpdk.org/api/patches/73683/comments/", "check": "warning", "checks": "http://patchwork.dpdk.org/api/patches/73683/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@inbox.dpdk.org", "Delivered-To": "patchwork@inbox.dpdk.org", "Received": [ "from dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id D4D59A0526;\n\tFri, 10 Jul 2020 09:01:39 +0200 (CEST)", "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 157351DB11;\n\tFri, 10 Jul 2020 09:01:39 +0200 (CEST)", "from mail-wm1-f65.google.com (mail-wm1-f65.google.com\n [209.85.128.65]) by dpdk.org (Postfix) with ESMTP id 1203D1DAF6\n for <dev@dpdk.org>; Fri, 10 Jul 2020 09:01:38 +0200 (CEST)", "by mail-wm1-f65.google.com with SMTP id g75so4798842wme.5\n for <dev@dpdk.org>; Fri, 10 Jul 2020 00:01:38 -0700 (PDT)", "from localhost.localdomain ([39.40.87.182])\n by smtp.gmail.com with ESMTPSA id 133sm8498045wme.5.2020.07.10.00.01.34\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Fri, 10 Jul 2020 00:01:37 -0700 (PDT)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=emumba-com.20150623.gappssmtp.com; s=20150623;\n h=from:to:cc:subject:date:message-id:in-reply-to:references;\n bh=+bq0+am2PmuY0f1Htu54NjqEVD1fJomIB5FI/6fsnk4=;\n b=mT5ugCNOMknw1ggtI5bfj9PqhLLFickF/4rHlCIpoPy0MwzYXOd9bqXN9SVyKMyie2\n ubC/wKHjls+fXIS5txr1VhVR9V5gqYjgwr1crOcNCsLnlnZ+4GmzjMf1qf0+LgOlw4wV\n KMHphLwqfZdHst0BtqNZSuObAkmyTOIOu5a1dMYkD/yQ6/q3YPMcgTvZZsJNMZNi4q8F\n LPdahkE9SBBrSHAMSyu0zICfkdytWvdFKLp04DQw/L4FRoWdCY7Rrs5USGVRaZKC0gaP\n Md2lp5fROOhag8AbEQeiMAUejiUbziwLT5b1mVlhDXFeQrfcAB9H3dr3kZTTWNnbfsK3\n r1tg==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20161025;\n h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n :references;\n bh=+bq0+am2PmuY0f1Htu54NjqEVD1fJomIB5FI/6fsnk4=;\n b=tF8cIBQE0HBpYmGplFM1mCQ8S2m71f9QvTezLTVBNDPfQpvsmoQYVHhL0Ld7cNZ9AJ\n A5/NLEK9w7anT52r86bihh1DX3kzPVUBW2ReJeR2Dl04hVsaOdmB+mWIJBJkrhtwIkZx\n vfVtKT13mm4XvvA0ESLVFGJCTGTdyFNFHzADZil8vuBCBjbVWhYnREro3HDqcK+brEcG\n siRoVEHSD3Ys1zlinYEnub5NRB6DC1GEiWK4cPGZOLFh36WTlej9qYz6KJmv8cyKS859\n HqF4fjBnMi5imCeYfMyxEYOnUWRRnH+pWPCWIW72Q2NYkckIdewTFJGAeWTnFfkVKuJ6\n kxWw==", "X-Gm-Message-State": "AOAM530Y8SrKKW0Yra0GGC6FEGfOlCPvD/SVtJj4OjVm0ULOSXv5hZig\n FPr2kRfbbOqJKr10DUhzDwpjLQ==", "X-Google-Smtp-Source": "\n ABdhPJxXaK9j2VdglRCz6sS3PkCYh8oLOpOZ6EQyuDQ4sNU/GUPFFQsC0lQfQma9azlkY7EovtF+BA==", "X-Received": "by 2002:a7b:c208:: with SMTP id x8mr3697669wmi.49.1594364497699;\n Fri, 10 Jul 2020 00:01:37 -0700 (PDT)", "From": "Sarosh Arif <sarosh.arif@emumba.com>", "To": "rsanford@akamai.com,\n\terik.g.carrillo@intel.com,\n\tdev@dpdk.org", "Cc": "stable@dpdk.org, Sarosh Arif <sarosh.arif@emumba.com>,\n h.mikita89@gmail.com", "Date": "Fri, 10 Jul 2020 11:59:54 +0500", "Message-Id": "<20200710065954.4937-1-sarosh.arif@emumba.com>", "X-Mailer": "git-send-email 2.17.1", "In-Reply-To": "<20200707090320.2463-1-sarosh.arif@emumba.com>", "References": "<20200707090320.2463-1-sarosh.arif@emumba.com>", "Subject": "[dpdk-dev] [PATCH v3] lib/librte_timer:fix corruption with reset", "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 <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 <mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "If the user tries to reset/stop some other timer in it's callback\nfunction, which is also about to expire, using \nrte_timer_reset_sync/rte_timer_stop_sync the application goes into\nan infinite loop. This happens because \nrte_timer_reset_sync/rte_timer_stop_sync loop until the timer \nresets/stops and there is check inside timer_set_config_state which\nprevents a running timer from being reset/stopped by not it's own \ntimer_cb. Therefore timer_set_config_state returns -1 due to which \nrte_timer_reset returns -1 and rte_timer_reset_sync goes into an \ninfinite loop. \n\nThe soloution to this problem is to return -1 from \nrte_timer_reset_sync/rte_timer_stop_sync in case the user tries to \nreset/stop some other timer in it's callback function.\n\nBugzilla ID: 491\nFixes: 20d159f20543 (\"timer: fix corruption with reset\")\nCc: h.mikita89@gmail.com\nSigned-off-by: Sarosh Arif <sarosh.arif@emumba.com>\n---\nv2: remove line continuations\nv3: separate code and declarations\n---\n lib/librte_timer/rte_timer.c | 26 ++++++++++++++++++++++++--\n lib/librte_timer/rte_timer.h | 4 ++--\n 2 files changed, 26 insertions(+), 4 deletions(-)", "diff": "diff --git a/lib/librte_timer/rte_timer.c b/lib/librte_timer/rte_timer.c\nindex 6d19ce469..0cd3e2c86 100644\n--- a/lib/librte_timer/rte_timer.c\n+++ b/lib/librte_timer/rte_timer.c\n@@ -576,14 +576,24 @@ rte_timer_alt_reset(uint32_t timer_data_id, struct rte_timer *tim,\n }\n \n /* loop until rte_timer_reset() succeed */\n-void\n+int\n rte_timer_reset_sync(struct rte_timer *tim, uint64_t ticks,\n \t\t enum rte_timer_type type, unsigned tim_lcore,\n \t\t rte_timer_cb_t fct, void *arg)\n {\n+\tstruct rte_timer_data *timer_data;\n+\tTIMER_DATA_VALID_GET_OR_ERR_RET(default_data_id, timer_data, -EINVAL);\n+\n+\tif (tim->status.state == RTE_TIMER_RUNNING &&\n+\t(tim->status.owner != (uint16_t)tim_lcore ||\n+\ttim != timer_data->priv_timer[tim_lcore].running_tim))\n+\t\treturn -1;\n+\n \twhile (rte_timer_reset(tim, ticks, type, tim_lcore,\n \t\t\t fct, arg) != 0)\n \t\trte_pause();\n+\n+\treturn 0;\n }\n \n static int\n@@ -642,11 +652,23 @@ rte_timer_alt_stop(uint32_t timer_data_id, struct rte_timer *tim)\n }\n \n /* loop until rte_timer_stop() succeed */\n-void\n+int\n rte_timer_stop_sync(struct rte_timer *tim)\n {\n+\tstruct rte_timer_data *timer_data;\n+\tunsigned int lcore_id = rte_lcore_id();\n+\n+\tTIMER_DATA_VALID_GET_OR_ERR_RET(default_data_id, timer_data, -EINVAL);\n+\n+\tif (tim->status.state == RTE_TIMER_RUNNING &&\n+\t(tim->status.owner != (uint16_t)lcore_id ||\n+\ttim != timer_data->priv_timer[lcore_id].running_tim))\n+\t\treturn -1;\n+\n \twhile (rte_timer_stop(tim) != 0)\n \t\trte_pause();\n+\n+\treturn 0;\n }\n \n /* Test the PENDING status of the timer handle tim */\ndiff --git a/lib/librte_timer/rte_timer.h b/lib/librte_timer/rte_timer.h\nindex c6b3d450d..392ca423d 100644\n--- a/lib/librte_timer/rte_timer.h\n+++ b/lib/librte_timer/rte_timer.h\n@@ -275,7 +275,7 @@ int rte_timer_reset(struct rte_timer *tim, uint64_t ticks,\n * @param arg\n * The user argument of the callback function.\n */\n-void\n+int\n rte_timer_reset_sync(struct rte_timer *tim, uint64_t ticks,\n \t\t enum rte_timer_type type, unsigned tim_lcore,\n \t\t rte_timer_cb_t fct, void *arg);\n@@ -314,7 +314,7 @@ int rte_timer_stop(struct rte_timer *tim);\n * @param tim\n * The timer handle.\n */\n-void rte_timer_stop_sync(struct rte_timer *tim);\n+int rte_timer_stop_sync(struct rte_timer *tim);\n \n /**\n * Test if a timer is pending.\n", "prefixes": [ "v3" ] }{ "id": 73683, "url": "