From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on0120.outbound.protection.outlook.com [104.47.1.120]) by dpdk.org (Postfix) with ESMTP id 8CDDA5699 for ; Mon, 30 Jul 2018 15:36:37 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nokia.onmicrosoft.com; s=selector1-nokia-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=JtVZP5Uem8g6nrD3KLhZjldhjXBhIcoN/PyPSDPApMY=; b=csrfz0BUd8YnD7MrOgT6wbwEH+qH5YT6J5vFVI/diF3MEdMr0zePNlg/f/Yj9GjN9DI68AXiNP2pdT7FI4S4x+dShNQKIgPVo7XWx8PtsL8eZ9gQhlF+7Xv3HDJW3/Fl2qeklHDeH53dSKbnJFaOWZ/jKWD8PA/YVHqxOcljNno= Received: from DB7PR07MB4556.eurprd07.prod.outlook.com (52.135.141.14) by DB7PR07MB4763.eurprd07.prod.outlook.com (52.135.141.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.995.12; Mon, 30 Jul 2018 13:36:36 +0000 Received: from DB7PR07MB4556.eurprd07.prod.outlook.com ([fe80::10fa:ae08:1e34:67ac]) by DB7PR07MB4556.eurprd07.prod.outlook.com ([fe80::10fa:ae08:1e34:67ac%4]) with mapi id 15.20.1017.010; Mon, 30 Jul 2018 13:36:35 +0000 From: "Elo, Matias (Nokia - FI/Espoo)" To: Jerin Jacob CC: "Van Haaren, Harry" , "dev@dpdk.org" Thread-Topic: [dpdk-dev] eventdev: method for finding out unlink status Thread-Index: AQHUJ9Aa1/qQlBsMGkGIBi2aSKyqoKSnZV8AgAAXrwCAAALrgIAAAmqAgAAQZICAADKWAA== Date: Mon, 30 Jul 2018 13:36:35 +0000 Message-ID: <75889C0D-2790-4EB8-B202-1311D764CCF2@nokia.com> References: <20180730075408.GA14117@jerin> <80CC5C07-0D73-4F86-9F93-0AB78DEF2BFD@nokia.com> <20180730092921.GA22242@jerin> <20180730103638.GA26701@jerin> In-Reply-To: <20180730103638.GA26701@jerin> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: Apple Mail (2.3445.9.1) authentication-results: spf=none (sender IP is ) smtp.mailfrom=matias.elo@nokia.com; x-originating-ip: [131.228.32.171] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DB7PR07MB4763; 6:JkHHz83pvD40jCoNMJ0jfaWzAvQsAwnqOdLod7PHSWC1O64iYuLeHbgyNPcXlORi6WiLLBLr6bKQFy39A27gjhyBcDqtJgpshBxNBEG0uj1UPYllRgkSK1EoNkl76X80QQ9yGT3pbKT9R/Ki0gnUS+wcU+hWYO1TAXG1TgSvsPKdqSEZJykYxn+rsYZYpeht0mq2rbYlCKgsUliWnet6wvMAZR+aAHQA9JkTmJGg1Kkwauv/fHFKmLEucJQNTbppSXma20JHRBwXkPzxLo100ff42oZ5vAK3H1KqZOwjOi0Jv6CLHNFvi6SAyfFWN2p0R6ZzdXhUWiKB1N4m0Eao8lgyvKJZRhq16N+9QIQQ2Nne1xcy0gn98A/O41MUEUJNobqrFG9TCfetvJV1BdM9Ea/iC2E0AdTIW/8cpiWmfcj8uKixg4xj+ap7QYRwLBXzigmU2Mtxjs1pT++0z+VX/Q==; 5:4lKs/30bKqMrJYP9LvoTAR/4L8cpOkc21pinF2XjrAN8iDgeJAjY9xZCHrmQ8LW2MWIgJRK5ehcj7Oq8ks3c73qxqGggFy8Ucw8PRPcgIVsBlRgrkwuPGE1CPr+5cq10043IVXAYzYkPGYM4ywqVxEnKRRkkTMlpq++eujjUcKM=; 7:UAu7yyTxspHPCukjWGBfaL3Co/yQDM2ACLf0e1xdcZOkdN5xYI8peRY2BLbOyYmZcqUkRM0BLL30vOXv9HayMb3QXICniixEf9Q+6QZ/usJCt4t0ybbrFkjOkg6DaLMO9N+Mww79JdL1mIoRFJgn29j+jHBpa0bH9hPi+6qmgCPTSFeY9Af7WqCgNPrqbETQt0FceoTJ2UzCDcvIxTEcDpk/5WkbRlJy1+CaKLEubBrScsSWNPOmXVIOx+SlV2sO x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: cbae8f63-a5ff-4c01-54f3-08d5f6217891 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(5600074)(711020)(4618075)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7193020); SRVR:DB7PR07MB4763; x-ms-traffictypediagnostic: DB7PR07MB4763: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(3231311)(11241501184)(806099)(944501410)(52105095)(3002001)(10201501046)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123558120)(20161123562045)(20161123564045)(6072148)(201708071742011)(7699016); SRVR:DB7PR07MB4763; BCL:0; PCL:0; RULEID:; SRVR:DB7PR07MB4763; x-forefront-prvs: 0749DC2CE6 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(39860400002)(366004)(346002)(376002)(136003)(396003)(189003)(199004)(54906003)(81166006)(5660300001)(6916009)(2906002)(81156014)(316002)(2900100001)(6486002)(102836004)(5250100002)(82746002)(7736002)(36756003)(93886005)(25786009)(26005)(305945005)(83716003)(6436002)(68736007)(14454004)(8936002)(229853002)(50226002)(97736004)(106356001)(486006)(476003)(6512007)(57306001)(86362001)(14444005)(256004)(11346002)(2616005)(478600001)(446003)(66066001)(8676002)(105586002)(76176011)(99286004)(186003)(6246003)(6506007)(53936002)(6116002)(3846002)(4326008)(33656002); DIR:OUT; SFP:1102; SCL:1; SRVR:DB7PR07MB4763; H:DB7PR07MB4556.eurprd07.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:3; A:1; received-spf: None (protection.outlook.com: nokia.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: v15gayypPpLRqqiA/gSDlFruAdhmno3C+hfLPxEFMriJEYq8LCOF2LdCJQyVRgKRCcQPrS3/TEYHReFQe4ik5QslaCTUewIXu73fzEaGXqKWZ3v7Yyut1Y3u0ojXp3LjcknADx/hyPvI6+Pa9XX1nSve8TV+SsS7vj6stiahLN/9rJRPkXplb703tz0cVAaxJl9ZvH17Sn9HzeIgolzEqaUlXm8sd5qGJPq5LBieustO3qSUku6hfgTekLDYs9OPYXUGtojxCdO4vXYmbMdbQe1Sk1UyTw7U/R4fnssqvXqFAa/UBhi6xWtMinr8sxl8DyPGLFJ5U2i8U5Ytzfcn4VD0wSLXyrUqzKwKkdAFPNR17BKvqZ29GGAlaqFzRqoOGYvpKI0XNwv+RLRDIR/ZSg== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: nokia.com X-MS-Exchange-CrossTenant-Network-Message-Id: cbae8f63-a5ff-4c01-54f3-08d5f6217891 X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Jul 2018 13:36:35.8906 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 5d471751-9675-428d-917b-70f44f9630b0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR07MB4763 Subject: Re: [dpdk-dev] eventdev: method for finding out unlink status X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jul 2018 13:36:37 -0000 >> For this "runtime scale down" use-case the missing information is being >> able to identify when an unlink is complete. After that (and ensuring th= e >> port buffer is empty) the application can be guaranteed that there are n= o >> more events going to be sent to that port, and the application can take >> the worker lcore out of its polling-loop and put it to sleep. >>=20 >> As mentioned before, I think an "unlinks_in_progress()" function is perh= aps >> the easiest way to achieve this functionality, as it allows relatively s= imple >> tracking of unlinks() using an atomic counter in sw. (Implementation det= ails >> become complex when we have a separate core running event/sw, separate c= ores >> polling, and a control-plane thread calling unlink...) >>=20 >> I think the end result we're hoping for is something like pseudo code be= low, >> (keep in mind that the event/sw has a service-core thread running it, so= no >> application code there): >>=20 >> int worker_poll =3D 1; >>=20 >> worker() { >> while(worker_poll) { >> // eventdev_dequeue_burst() etc >> } >> go_to_sleep(1); >> } >>=20 >> control_plane_scale_down() { >> unlink(evdev, worker, queue_id); >> while(unlinks_in_progress(evdev) > 0) >> usleep(100); >>=20 >> /* here we know that the unlink is complete. >> * so we can now stop the worker from polling */ >> worker_poll =3D 0; >> } >=20 >=20 > Make sense. Instead of rte_event_is_unlink_in_progress(), How about > adding a callback in rte_event_port_unlink() which will be called on=20 > unlink completion. It will reduce the need for ONE more API. >=20 > Anyway it RC2 now, so we can not accept a new feature. So we will have > time for deprecation notice. >=20 Both solutions should work but I would perhaps favor Harry's approach as it requires less code in the application side and doesn't break backward compatibility.