Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/27692/?format=api
https://patches.dpdk.org/api/patches/27692/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/1503320296-51122-10-git-send-email-harry.van.haaren@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": "<1503320296-51122-10-git-send-email-harry.van.haaren@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1503320296-51122-10-git-send-email-harry.van.haaren@intel.com", "date": "2017-08-21T12:58:10", "name": "[dpdk-dev,v2,09/15] service: fix loops to always scan all services", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "b0a5995430549abfb8e853e99ca2668430961587", "submitter": { "id": 317, "url": "https://patches.dpdk.org/api/people/317/?format=api", "name": "Van Haaren, Harry", "email": "harry.van.haaren@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/1503320296-51122-10-git-send-email-harry.van.haaren@intel.com/mbox/", "series": [], "comments": "https://patches.dpdk.org/api/patches/27692/comments/", "check": "success", "checks": "https://patches.dpdk.org/api/patches/27692/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 4DA7D7D8E;\n\tMon, 21 Aug 2017 14:58:42 +0200 (CEST)", "from mga05.intel.com (mga05.intel.com [192.55.52.43])\n\tby dpdk.org (Postfix) with ESMTP id 5C4D27D23\n\tfor <dev@dpdk.org>; Mon, 21 Aug 2017 14:58:36 +0200 (CEST)", "from fmsmga002.fm.intel.com ([10.253.24.26])\n\tby fmsmga105.fm.intel.com with ESMTP; 21 Aug 2017 05:58:35 -0700", "from silpixa00398672.ir.intel.com ([10.237.223.128])\n\tby fmsmga002.fm.intel.com with ESMTP; 21 Aug 2017 05:58:34 -0700" ], "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos; i=\"5.41,409,1498546800\"; d=\"scan'208\";\n\ta=\"1208383323\"", "From": "Harry van Haaren <harry.van.haaren@intel.com>", "To": "dev@dpdk.org", "Cc": "Harry van Haaren <harry.van.haaren@intel.com>", "Date": "Mon, 21 Aug 2017 13:58:10 +0100", "Message-Id": "<1503320296-51122-10-git-send-email-harry.van.haaren@intel.com>", "X-Mailer": "git-send-email 2.7.4", "In-Reply-To": "<1503320296-51122-1-git-send-email-harry.van.haaren@intel.com>", "References": "<1502800360-15782-1-git-send-email-harry.van.haaren@intel.com>\n\t<1503320296-51122-1-git-send-email-harry.van.haaren@intel.com>", "Subject": "[dpdk-dev] [PATCH v2 09/15] service: fix loops to always scan all\n\tservices", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "Precedence": "list", "List-Id": "DPDK patches and discussions <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": "Services can be registered and unregistered, and \"holes\" can\nappear in the contiguous array of services if a service is\nunregistered. As a result, we must never iterate to the\nnumber of services (as counted by rte_service_count), instead\nscanning the service array and checking if the service is valid.\n\nAfter this commit, the rte_service_count variable is only used\nfor its intended purpose; tracking the number of services that\nare present.\n\nFixes: 21698354c832 (\"service: introduce service cores concept\")\n\nSigned-off-by: Harry van Haaren <harry.van.haaren@intel.com>\n---\n lib/librte_eal/common/rte_service.c | 12 +++++++++---\n 1 file changed, 9 insertions(+), 3 deletions(-)", "diff": "diff --git a/lib/librte_eal/common/rte_service.c b/lib/librte_eal/common/rte_service.c\nindex 6291c0c..a5fbcf9 100644\n--- a/lib/librte_eal/common/rte_service.c\n+++ b/lib/librte_eal/common/rte_service.c\n@@ -323,7 +323,10 @@ rte_service_runner_func(void *arg)\n \n \twhile (lcore_states[lcore].runstate == RUNSTATE_RUNNING) {\n \t\tconst uint64_t service_mask = cs->service_mask;\n-\t\tfor (i = 0; i < rte_service_count; i++) {\n+\n+\t\tfor (i = 0; i < RTE_SERVICE_NUM_MAX; i++) {\n+\t\t\tif (!service_valid(i))\n+\t\t\t\tcontinue;\n \t\t\tstruct rte_service_spec_impl *s = &rte_services[i];\n \t\t\tif (s->runstate != RUNSTATE_RUNNING ||\n \t\t\t\t\t!(service_mask & (UINT64_C(1) << i)))\n@@ -655,7 +658,8 @@ int32_t rte_service_dump(FILE *f, uint32_t id)\n \tint print_one = (id != UINT32_MAX);\n \n \tuint64_t total_cycles = 0;\n-\tfor (i = 0; i < rte_service_count; i++) {\n+\n+\tfor (i = 0; i < RTE_SERVICE_NUM_MAX; i++) {\n \t\tif (!service_valid(i))\n \t\t\tcontinue;\n \t\ttotal_cycles += rte_services[i].cycles_spent;\n@@ -673,7 +677,9 @@ int32_t rte_service_dump(FILE *f, uint32_t id)\n \n \t/* print all services, as UINT32_MAX was passed as id */\n \tfprintf(f, \"Services Summary\\n\");\n-\tfor (i = 0; i < rte_service_count; i++) {\n+\tfor (i = 0; i < RTE_SERVICE_NUM_MAX; i++) {\n+\t\tif (!service_valid(i))\n+\t\t\tcontinue;\n \t\tuint32_t reset = 1;\n \t\trte_service_dump_one(f, &rte_services[i], total_cycles, reset);\n \t}\n", "prefixes": [ "dpdk-dev", "v2", "09/15" ] }{ "id": 27692, "url": "