From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-eopbgr30097.outbound.protection.outlook.com [40.107.3.97]) by dpdk.org (Postfix) with ESMTP id ADE721E35 for ; Wed, 8 Aug 2018 12:05:06 +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=ZnUvUwHn6ImpDpuJ/zCPpiL9MXg3QL9nabPrpIwKHcA=; b=YTXdCrjOLQ5QMPsaLE1FvCz3Hsva5WjpaiexE0a5Mm8ZuYzZCTsYt5Cuk6kzBptNDIM+tTGQm/7PqEyszo/KF+we4sBx8Bmz/S3AeDKdCPOcIz6oTP/5NJV8Rwpo6I3XrgiReht5bQpTKkh8ahjF6NZ98kQaZjnlQeoaJYqMTn4= Received: from HE1PR07MB3193.eurprd07.prod.outlook.com (10.170.245.31) by HE1PR07MB3420.eurprd07.prod.outlook.com (10.170.247.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1038.17; Wed, 8 Aug 2018 10:05:05 +0000 Received: from HE1PR07MB3193.eurprd07.prod.outlook.com ([fe80::a1cc:e51c:8125:2f80]) by HE1PR07MB3193.eurprd07.prod.outlook.com ([fe80::a1cc:e51c:8125:2f80%3]) with mapi id 15.20.1059.007; Wed, 8 Aug 2018 10:05:05 +0000 From: "Elo, Matias (Nokia - FI/Espoo)" To: "Van Haaren, Harry" CC: "dev@dpdk.org" , Jerin Jacob Thread-Topic: [dpdk-dev] eventdev: method for finding out unlink status Thread-Index: AQHUJ9Aa1/qQlBsMGkGIBi2aSKyqoKSnZV8AgAAXrwCAAALrgIAAAmqAgAAQZICAADKWAIAADY8AgAEpQgCAAAXaAIAAEBUAgAydLwA= Date: Wed, 8 Aug 2018 10:05:05 +0000 Message-ID: References: <20180730075408.GA14117@jerin> <80CC5C07-0D73-4F86-9F93-0AB78DEF2BFD@nokia.com> <20180730092921.GA22242@jerin> <20180730103638.GA26701@jerin> <75889C0D-2790-4EB8-B202-1311D764CCF2@nokia.com> <20180730142614.GA11265@jerin> <6D43DE84-583D-42E5-B298-0E7BDA0C17FB@nokia.com> <20180731083107.GA23233@jerin> <4C54AAAE-A872-47E1-B815-AF68965F9F3E@nokia.com> In-Reply-To: <4C54AAAE-A872-47E1-B815-AF68965F9F3E@nokia.com> 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; HE1PR07MB3420; 6:8feQnCSfZv1BvWRV3tOOWAtVHq2LP+f5VRpmXnbwS79AwTOgE/Dg6zM1c6aqM/YNOMF/K6Ukti9roB18ZODo4UP2ZulySrMZJ5KSN5OvjnZEAZtkGrfDBOhHND0kHMB00MhCo9UJTGnEDylM1Q//aBeMnLVGxcMF+Da7uee8PLJvmH6vhtQ5Hf7jZGDuVCTkFk6wLLCMs3037Wa1fbJ5jkkSJliS8f/rIIohopus/I5DBnG49K28r+L7fOEbIRZqebIjfSe67AnbOQGu7nHgVk9c33ltZpRhy59f37e9u3vOouGxmDMFsAV7J/u5W8lTnH4J4tMmVtEnkUkWdZsMqJYtn2P5qWcsTuhnjl22maYQKsOLlVf1ZxEPoGThaVX9xFFwOIa2S2ziG/MJwGBl/ohlb68gMUXjm6k4ZGpx0fuypu+hM+M3WJaQZhiavAgeNzcmFpBTDvEHM0ViOR7sFA==; 5:e4/tCZuK1pfJKRg26a82olEDDIdbWBObZcEwyuklRM3u8f0aqBEh6DLL0t4Vl+Aem7IuihjJe8OjnF/ESyoYiUk4g1lnnLezI+Jt5rKHsOiNRp5koO3tL99qqla+Fd1KuvpxJHxNpcHcRFP/xl4ICE3vsuLtUQxPsMO81hBmjsI=; 7:zAVM8Y8M/Xw7igHbRPDNwUleXK36lG5nUKDOGi4wKBY/HVLF3T8eD8rr1aqrCuU8uunjppW3slo9v7tXw1MKhIZpk4aoDFa2qoEbchG91SOXyKFl9oI/yO4hjSpUqalVm0bNTzV5OFvJtwj3SfsSkxvtXtMoH2875VSkZlvapuozVFncwFez+wTI42wlkS0C3dlP9wd0hm9sfEzQl1T5qMKtY5lHEyc5mOR60WYHQzy6iDmZAkAje7BgD7gkzc72 x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: 3699ba46-734d-4a4d-83dc-08d5fd166a4b x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4618075)(2017052603328)(7193020); SRVR:HE1PR07MB3420; x-ms-traffictypediagnostic: HE1PR07MB3420: 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)(5005006)(8121501046)(10201501046)(3231311)(11241501184)(806099)(944501410)(52105095)(93006095)(93001095)(3002001)(6055026)(149027)(150027)(6041310)(20161123558120)(20161123560045)(20161123564045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016); SRVR:HE1PR07MB3420; BCL:0; PCL:0; RULEID:; SRVR:HE1PR07MB3420; x-forefront-prvs: 07584EDBCD x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(39860400002)(396003)(366004)(376002)(346002)(136003)(189003)(199004)(52314003)(106356001)(105586002)(53936002)(76176011)(256004)(82746002)(97736004)(6436002)(2906002)(99286004)(6486002)(186003)(14444005)(6512007)(6916009)(229853002)(33656002)(83716003)(50226002)(26005)(5250100002)(8936002)(2900100001)(68736007)(8676002)(2616005)(476003)(66066001)(102836004)(5660300001)(478600001)(57306001)(93886005)(54906003)(25786009)(81156014)(446003)(4326008)(11346002)(14454004)(305945005)(6246003)(86362001)(316002)(486006)(3846002)(6116002)(36756003)(6506007)(81166006)(7736002); DIR:OUT; SFP:1102; SCL:1; SRVR:HE1PR07MB3420; H:HE1PR07MB3193.eurprd07.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: nokia.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: 8Hy4mRK20s26UHYhLLHjNTr4rzlf3gW1wCcqQ486cNUvPT7tmz4S394VY2ntVMSQR9mj7WQBEUv1hXogSriu9DmC9zzQFVnDTsY6IIRjGVbgnxH6xFgUR2QLNSnSNJanPeDSbyMSHhCYsO8GGx4hKklETM8BG6RoAn/5sw7y0FkLgtGy503JH8WuuGS2DAQ8sY92enLoPW7gsI2KouOmcG+KrIO8OTlaWnJstvYDILtU+ypPyqi1mPQTzHUTMbrU2t6HL46y0LArkYdG2FLCD9+H8e32w48AxvswU9tTwAtGLb0ZanIAfGV05f897WZDwnXyV17JKmDl00CPH0zpBJAIjLwFu3ILas4O7kCXNPqr8ee4PbvCmTgC+CDUDJBRWceMY94ItkrVmKYoEwYCng== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-ID: <50ED49624B940F45B09B928FB9B912E5@eurprd07.prod.outlook.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: nokia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3699ba46-734d-4a4d-83dc-08d5fd166a4b X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Aug 2018 10:05:05.6014 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 5d471751-9675-428d-917b-70f44f9630b0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR07MB3420 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: Wed, 08 Aug 2018 10:05:06 -0000 >>>>>>>=20 >>>>>>> I think the end result we're hoping for is something like pseudo co= de below, >>>>>>> (keep in mind that the event/sw has a service-core thread running i= t, 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 >>>>>> 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 ha= ve >>>>>> time for deprecation notice. >>>>>>=20 >>>>>=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. >>>>=20 >>>> OK. >>>>=20 >>>> Does rte_event_port_unlink() returning -EBUSY will help? >>>=20 >>> It could perhaps work. The return value becomes a bit ambiguous though.= E.g. how >>> to differentiate a delayed unlink completion from a scenario where the = port & queues >>> have never been linked? >>=20 >> Based on return code? >=20 > Yes, that works. I was thinking about the complexity of the implementatio= n as it would > have to also track the pending unlink requests. But anyway, Harry is bett= er answering > these questions since I guess he would be implementing this. Hi Harry, Have you had time to think about this?