Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/79536/?format=api
https://patches.dpdk.org/api/patches/79536/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/e443e130a0aca99f0e03b727b1796e19479bdb07.1601640423.git.anatoly.burakov@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": "<e443e130a0aca99f0e03b727b1796e19479bdb07.1601640423.git.anatoly.burakov@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/e443e130a0aca99f0e03b727b1796e19479bdb07.1601640423.git.anatoly.burakov@intel.com", "date": "2020-10-02T12:07:09", "name": "[v2] l3fwd-power: make interrupt wakeup log thread safe", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "0e1f69fc04d74baff2fca520ab35f64d21155568", "submitter": { "id": 4, "url": "https://patches.dpdk.org/api/people/4/?format=api", "name": "Burakov, Anatoly", "email": "anatoly.burakov@intel.com" }, "delegate": { "id": 24651, "url": "https://patches.dpdk.org/api/users/24651/?format=api", "username": "dmarchand", "first_name": "David", "last_name": "Marchand", "email": "david.marchand@redhat.com" }, "mbox": "https://patches.dpdk.org/project/dpdk/patch/e443e130a0aca99f0e03b727b1796e19479bdb07.1601640423.git.anatoly.burakov@intel.com/mbox/", "series": [ { "id": 12667, "url": "https://patches.dpdk.org/api/series/12667/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=12667", "date": "2020-10-02T12:07:09", "name": "[v2] l3fwd-power: make interrupt wakeup log thread safe", "version": 2, "mbox": "https://patches.dpdk.org/series/12667/mbox/" } ], "comments": "https://patches.dpdk.org/api/patches/79536/comments/", "check": "warning", "checks": "https://patches.dpdk.org/api/patches/79536/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 53E78A04B5;\n\tFri, 2 Oct 2020 14:07:20 +0200 (CEST)", "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id D93DA1C1BF;\n\tFri, 2 Oct 2020 14:07:18 +0200 (CEST)", "from mga03.intel.com (mga03.intel.com [134.134.136.65])\n by dpdk.org (Postfix) with ESMTP id 6EE711C1B8\n for <dev@dpdk.org>; Fri, 2 Oct 2020 14:07:16 +0200 (CEST)", "from fmsmga004.fm.intel.com ([10.253.24.48])\n by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 02 Oct 2020 05:07:11 -0700", "from silpixa00399498.ir.intel.com (HELO\n silpixa00399498.ger.corp.intel.com) ([10.237.222.52])\n by fmsmga004.fm.intel.com with ESMTP; 02 Oct 2020 05:07:09 -0700" ], "IronPort-SDR": [ "\n 28htisfXtF6DjAjSMu1D2dFSP0EZlp83O8kzSGRCEXrGRPXXv2htILlZgBJeMtFgxDoXQ1HOER\n NNe2s7ASliPA==", "\n TxKr/+7UBlBkdn6Sumn7/tgY9/tozIaz0iS0nW73hsQf71TdG+T11R2/P8qZNmxkZRxX4uagVD\n nbCoLuJObrzA==" ], "X-IronPort-AV": [ "E=McAfee;i=\"6000,8403,9761\"; a=\"163061866\"", "E=Sophos;i=\"5.77,327,1596524400\"; d=\"scan'208\";a=\"163061866\"", "E=Sophos;i=\"5.77,327,1596524400\"; d=\"scan'208\";a=\"339977892\"" ], "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "From": "Anatoly Burakov <anatoly.burakov@intel.com>", "To": "dev@dpdk.org", "Cc": "David Hunt <david.hunt@intel.com>, reshma.pattan@intel.com,\n anatoly.burakov@intel.com", "Date": "Fri, 2 Oct 2020 13:07:09 +0100", "Message-Id": "\n <e443e130a0aca99f0e03b727b1796e19479bdb07.1601640423.git.anatoly.burakov@intel.com>", "X-Mailer": "git-send-email 2.17.1", "In-Reply-To": "\n <c155c104b7974876674d01ff2d789f78d607f04a.1601640180.git.anatoly.burakov@intel.com>", "References": "\n <c155c104b7974876674d01ff2d789f78d607f04a.1601640180.git.anatoly.burakov@intel.com>", "Subject": "[dpdk-dev] [PATCH v2] l3fwd-power: make interrupt wakeup log thread\n\tsafe", "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": "Currently, the interrupt status notification prevents log spam by\nremembering whether previous interrupt wakeup was due to traffic or due\nto timeout expiring. However, it is a single variable that can\npotentially be accessed from multiple threads, so it is not thread-safe.\n\nFix it by having per-lcore interrupt status.\n\nFixes: f4d1e19c293d (\"examples/l3fwd-power: add Rx interrupt timeout\")\nCc: anatoly.burakov@intel.com\n\nSigned-off-by: Anatoly Burakov <anatoly.burakov@intel.com>\n---\n\nNotes:\n v2:\n - Fix confusing variable naming\n\n examples/l3fwd-power/main.c | 19 ++++++++++++-------\n 1 file changed, 12 insertions(+), 7 deletions(-)", "diff": "diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c\nindex d0e6c9bd77..526af0db29 100644\n--- a/examples/l3fwd-power/main.c\n+++ b/examples/l3fwd-power/main.c\n@@ -821,20 +821,23 @@ power_freq_scaleup_heuristic(unsigned lcore_id,\n * 0 on success\n */\n static int\n-sleep_until_rx_interrupt(int num)\n+sleep_until_rx_interrupt(int num, int lcore)\n {\n \t/*\n \t * we want to track when we are woken up by traffic so that we can go\n-\t * back to sleep again without log spamming.\n+\t * back to sleep again without log spamming. Avoid cache line sharing\n+\t * to prevent threads stepping on each others' toes.\n \t */\n-\tstatic bool timeout;\n+\tstatic struct {\n+\t\tbool wakeup;\n+\t} __rte_cache_aligned status[RTE_MAX_LCORE];\n \tstruct rte_epoll_event event[num];\n \tint n, i;\n \tuint16_t port_id;\n \tuint8_t queue_id;\n \tvoid *data;\n \n-\tif (!timeout) {\n+\tif (status[lcore].wakeup) {\n \t\tRTE_LOG(INFO, L3FWD_POWER,\n \t\t\t\t\"lcore %u sleeps until interrupt triggers\\n\",\n \t\t\t\trte_lcore_id());\n@@ -851,7 +854,7 @@ sleep_until_rx_interrupt(int num)\n \t\t\t\" port %d queue %d\\n\",\n \t\t\trte_lcore_id(), port_id, queue_id);\n \t}\n-\ttimeout = n == 0;\n+\tstatus[lcore].wakeup = n != 0;\n \n \treturn 0;\n }\n@@ -1050,7 +1053,8 @@ static int main_intr_loop(__rte_unused void *dummy)\n \t\t\t\tif (intr_en) {\n \t\t\t\t\tturn_on_off_intr(qconf, 1);\n \t\t\t\t\tsleep_until_rx_interrupt(\n-\t\t\t\t\t\t\tqconf->n_rx_queue);\n+\t\t\t\t\t\t\tqconf->n_rx_queue,\n+\t\t\t\t\t\t\tlcore_id);\n \t\t\t\t\tturn_on_off_intr(qconf, 0);\n \t\t\t\t\t/**\n \t\t\t\t\t * start receiving packets immediately\n@@ -1473,7 +1477,8 @@ main_legacy_loop(__rte_unused void *dummy)\n \t\t\t\tif (intr_en) {\n \t\t\t\t\tturn_on_off_intr(qconf, 1);\n \t\t\t\t\tsleep_until_rx_interrupt(\n-\t\t\t\t\t\tqconf->n_rx_queue);\n+\t\t\t\t\t\t\tqconf->n_rx_queue,\n+\t\t\t\t\t\t\tlcore_id);\n \t\t\t\t\tturn_on_off_intr(qconf, 0);\n \t\t\t\t\t/**\n \t\t\t\t\t * start receiving packets immediately\n", "prefixes": [ "v2" ] }{ "id": 79536, "url": "