Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/45190/?format=api
https://patches.dpdk.org/api/patches/45190/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/20180924082333.12812-3-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": "<20180924082333.12812-3-harry.van.haaren@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20180924082333.12812-3-harry.van.haaren@intel.com", "date": "2018-09-24T08:23:33", "name": "[v3,3/3] event/sw: add unit test for unlinks in progress", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "bd89feb5116bac250fb65dbf0c9da18faccc615f", "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": 310, "url": "https://patches.dpdk.org/api/users/310/?format=api", "username": "jerin", "first_name": "Jerin", "last_name": "Jacob", "email": "jerinj@marvell.com" }, "mbox": "https://patches.dpdk.org/project/dpdk/patch/20180924082333.12812-3-harry.van.haaren@intel.com/mbox/", "series": [ { "id": 1459, "url": "https://patches.dpdk.org/api/series/1459/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=1459", "date": "2018-09-24T08:23:31", "name": "[v3,1/3] event: add function for reading unlink in progress", "version": 3, "mbox": "https://patches.dpdk.org/series/1459/mbox/" } ], "comments": "https://patches.dpdk.org/api/patches/45190/comments/", "check": "success", "checks": "https://patches.dpdk.org/api/patches/45190/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 519B54C9D;\n\tMon, 24 Sep 2018 10:25:08 +0200 (CEST)", "from mga01.intel.com (mga01.intel.com [192.55.52.88])\n\tby dpdk.org (Postfix) with ESMTP id DB6711AFF\n\tfor <dev@dpdk.org>; Mon, 24 Sep 2018 10:25:01 +0200 (CEST)", "from fmsmga005.fm.intel.com ([10.253.24.32])\n\tby fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t24 Sep 2018 01:25:01 -0700", "from silpixa00399779.ir.intel.com (HELO\n\tsilpixa00399779.ger.corp.intel.com) ([10.237.223.187])\n\tby fmsmga005.fm.intel.com with ESMTP; 24 Sep 2018 01:25:00 -0700" ], "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.54,297,1534834800\"; d=\"scan'208\";a=\"265170308\"", "From": "Harry van Haaren <harry.van.haaren@intel.com>", "To": "dev@dpdk.org", "Cc": "jerin.jacob@caviumnetworks.com,\n\tHarry van Haaren <harry.van.haaren@intel.com>", "Date": "Mon, 24 Sep 2018 09:23:33 +0100", "Message-Id": "<20180924082333.12812-3-harry.van.haaren@intel.com>", "X-Mailer": "git-send-email 2.17.1", "In-Reply-To": "<20180924082333.12812-1-harry.van.haaren@intel.com>", "References": "<20180920112251.47854-1-harry.van.haaren@intel.com>\n\t<20180924082333.12812-1-harry.van.haaren@intel.com>", "Subject": "[dpdk-dev] [PATCH v3 3/3] event/sw: add unit test for unlinks in\n\tprogress", "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": "This commit adds a unit test that checks the behaviour\nof the unlinks_in_progress() function, ensuring that the\nreturned values are the number of unlinks requested,\nuntil the scheduler runs and \"acks\" the requests, after\nwhich the count should be zero again.\n\nSigned-off-by: Harry van Haaren <harry.van.haaren@intel.com>\n\n---\n\nv3:\n- Move RTE_SET_USED() to correct patch (Jerin)\n\nv2:\n- Add print before running unlink test (Harry)\n---\n drivers/event/sw/sw_evdev_selftest.c | 77 ++++++++++++++++++++++++++++\n 1 file changed, 77 insertions(+)", "diff": "diff --git a/drivers/event/sw/sw_evdev_selftest.c b/drivers/event/sw/sw_evdev_selftest.c\nindex c40912db5..d00d5de61 100644\n--- a/drivers/event/sw/sw_evdev_selftest.c\n+++ b/drivers/event/sw/sw_evdev_selftest.c\n@@ -1903,6 +1903,77 @@ qid_priorities(struct test *t)\n \treturn 0;\n }\n \n+static int\n+unlink_in_progress(struct test *t)\n+{\n+\t/* Test unlinking API, in particular that when an unlink request has\n+\t * not yet been seen by the scheduler thread, that the\n+\t * unlink_in_progress() function returns the number of unlinks.\n+\t */\n+\tunsigned int i;\n+\t/* Create instance with 1 ports, and 3 qids */\n+\tif (init(t, 3, 1) < 0 ||\n+\t\t\tcreate_ports(t, 1) < 0) {\n+\t\tprintf(\"%d: Error initializing device\\n\", __LINE__);\n+\t\treturn -1;\n+\t}\n+\n+\tfor (i = 0; i < 3; i++) {\n+\t\t/* Create QID */\n+\t\tconst struct rte_event_queue_conf conf = {\n+\t\t\t.schedule_type = RTE_SCHED_TYPE_ATOMIC,\n+\t\t\t/* increase priority (0 == highest), as we go */\n+\t\t\t.priority = RTE_EVENT_DEV_PRIORITY_NORMAL - i,\n+\t\t\t.nb_atomic_flows = 1024,\n+\t\t\t.nb_atomic_order_sequences = 1024,\n+\t\t};\n+\n+\t\tif (rte_event_queue_setup(evdev, i, &conf) < 0) {\n+\t\t\tprintf(\"%d: error creating qid %d\\n\", __LINE__, i);\n+\t\t\treturn -1;\n+\t\t}\n+\t\tt->qid[i] = i;\n+\t}\n+\tt->nb_qids = i;\n+\t/* map all QIDs to port */\n+\trte_event_port_link(evdev, t->port[0], NULL, NULL, 0);\n+\n+\tif (rte_event_dev_start(evdev) < 0) {\n+\t\tprintf(\"%d: Error with start call\\n\", __LINE__);\n+\t\treturn -1;\n+\t}\n+\n+\t/* unlink all ports to have outstanding unlink requests */\n+\tint ret = rte_event_port_unlink(evdev, t->port[0], NULL, 0);\n+\tif (ret < 0) {\n+\t\tprintf(\"%d: Failed to unlink queues\\n\", __LINE__);\n+\t\treturn -1;\n+\t}\n+\n+\t/* get active unlinks here, expect 3 */\n+\tint unlinks_in_progress =\n+\t\trte_event_port_unlinks_in_progress(evdev, t->port[0]);\n+\tif (unlinks_in_progress != 3) {\n+\t\tprintf(\"%d: Expected num unlinks in progress == 3, got %d\\n\",\n+\t\t\t\t__LINE__, unlinks_in_progress);\n+\t\treturn -1;\n+\t}\n+\n+\t/* run scheduler service on this thread to ack the unlinks */\n+\trte_service_run_iter_on_app_lcore(t->service_id, 1);\n+\n+\t/* active unlinks expected as 0 as scheduler thread has acked */\n+\tunlinks_in_progress =\n+\t\trte_event_port_unlinks_in_progress(evdev, t->port[0]);\n+\tif (unlinks_in_progress != 0) {\n+\t\tprintf(\"%d: Expected num unlinks in progress == 0, got %d\\n\",\n+\t\t\t\t__LINE__, unlinks_in_progress);\n+\t}\n+\n+\tcleanup(t);\n+\treturn 0;\n+}\n+\n static int\n load_balancing(struct test *t)\n {\n@@ -3260,6 +3331,12 @@ test_sw_eventdev(void)\n \t\tprintf(\"ERROR - QID Priority test FAILED.\\n\");\n \t\tgoto test_fail;\n \t}\n+\tprintf(\"*** Running Unlink-in-progress test...\\n\");\n+\tret = unlink_in_progress(t);\n+\tif (ret != 0) {\n+\t\tprintf(\"ERROR - Unlink in progress test FAILED.\\n\");\n+\t\tgoto test_fail;\n+\t}\n \tprintf(\"*** Running Ordered Reconfigure test...\\n\");\n \tret = ordered_reconfigure(t);\n \tif (ret != 0) {\n", "prefixes": [ "v3", "3/3" ] }{ "id": 45190, "url": "