From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70130.outbound.protection.outlook.com [40.107.7.130]) by dpdk.org (Postfix) with ESMTP id D086C14E8 for ; Tue, 31 Jul 2018 11:27:38 +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=5pohWALcUjcPRHxNldk7keTE+2TLzXj03Nyatxw+Iqc=; b=sGLoiKUpMwpPEVgjW2gbcsw/DGhGJMcc5LeozQE2STPgljmZexoqmEQLvN6cfz8sT0SSmjcdTEq2BaWp4vXy/LwTYolFFwaqco6x3epeDeq7ZF66+M28b4OVZc9oj4linYXK4rgwZWKjGZvKVK2VcQV4TW1rWhuoJa0Z/ar46NU= Received: from DB7PR07MB4556.eurprd07.prod.outlook.com (52.135.141.14) by DB7PR07MB4681.eurprd07.prod.outlook.com (52.135.141.28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1017.5; Tue, 31 Jul 2018 09:27:37 +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; Tue, 31 Jul 2018 09:27:37 +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/qQlBsMGkGIBi2aSKyqoKSnZV8AgAAXrwCAAALrgIAAAmqAgAAQZICAADKWAIAADY8AgAEpQgCAAAXaAIAAEBUA Date: Tue, 31 Jul 2018 09:27:37 +0000 Message-ID: <4C54AAAE-A872-47E1-B815-AF68965F9F3E@nokia.com> 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> In-Reply-To: <20180731083107.GA23233@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; DB7PR07MB4681; 6:UV/xeKNxVy7zJMmt3XQo0CZi7mOoLrf1+EobkIKWenPVjZ7xjlDwPtp3+W7SJhS5WVMSAS9pcw/UsLURKLt0F4PnPp8jst5GBw7Cx6qfg4ZahduMZFVL3Xyh2/z8QnOw5BxIbQoAJa+DJFHpBCjhvEZUVxRo7rSwiYk1is2EZpZcNR/L6mUgF9UxuwxmpCM+n3MMqSaA7M2RB+SAYk/aZQG76E+oRXN6+R+p+WBKKbPR5qzMSVNFH0NJ93xrl5/LAjuXgC9e1I+xmLzh4olE6zukpCps9WL74v1vyZhFxFIs6ZWl4bCHtQvWM4jWid96RXhT7OIRDIqh0vdnkphTs2lD7xdYrFXhzDluCl1F5e0EmZgkd+Dzy4LEu13J0o+K0Q3n4dwvda9UemHOzo6WuqLHY/OUasYGxNL71HnMDmdmyvpLRkGgr0XTv+4Xx0PXOT1x5h0REp+JJahSUl5EYg==; 5:IBtrF+Ywgzek92m2vomQzvYQA/d5S14rdthvNv9Sz6fEqriMy53MRq/bpH8bDgTvpc7hbfs21a8D7e568FS11aSLSnGJHhXTICGnazj5GX6ws+xpqWsl8eQy+zGsdPwJfCWHeVXhHalOwqpFSH+cWhPCAk6TRqPMKGv6UWmhumo=; 7:N60p1AUofQaQDUmu84i7IiAHG1/H+7jdaKwuRygfFJil1FxmivXJO9Alw14MWU8knW2iWXiGxh/BRfnBWDWl/8dMwoHniysM5U/s9wLxchb/Kd1t1eqilXLYrJRDZyr1mSrl+WBk0OVmJHg/pK1gYDvIbdkkBnM2v3j8bNE9YiMmjpsxp3OLXa7GZIsiw37kZNiDnYEeHOmpy+UEsKExjG1Me6WUDIS+3qj0mg9D6p7DLnW4PQHRMSIPULOHjxaY x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: 17f52c55-2f35-4630-425a-08d5f6c7db1a 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:DB7PR07MB4681; x-ms-traffictypediagnostic: DB7PR07MB4681: 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)(3231311)(11241501184)(806099)(944501410)(52105095)(93006095)(93001095)(10201501046)(3002001)(6055026)(149027)(150027)(6041310)(20161123558120)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(6072148)(201708071742011)(7699016); SRVR:DB7PR07MB4681; BCL:0; PCL:0; RULEID:; SRVR:DB7PR07MB4681; x-forefront-prvs: 0750463DC9 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(376002)(366004)(39860400002)(346002)(136003)(396003)(189003)(199004)(52314003)(81166006)(81156014)(229853002)(36756003)(14444005)(256004)(6246003)(5660300001)(6486002)(54906003)(2900100001)(68736007)(316002)(53936002)(6506007)(6916009)(82746002)(99286004)(93886005)(4326008)(33656002)(57306001)(66066001)(6512007)(76176011)(6436002)(8676002)(25786009)(8936002)(476003)(26005)(186003)(83716003)(14454004)(11346002)(446003)(5250100002)(486006)(2906002)(3846002)(6116002)(478600001)(305945005)(7736002)(97736004)(102836004)(50226002)(86362001)(105586002)(106356001)(2616005); DIR:OUT; SFP:1102; SCL:1; SRVR:DB7PR07MB4681; H:DB7PR07MB4556.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: qDc6sHArIVxJ9p+RR+a395zaddiJH9KouF0wtFYcOAFVVmM37Y+M7fO+l8EzKjKxAFc5DL0EI+YpLJz/OD1ykWNOPMfX3PmiXbsfhwob8bZYyYCKQwP+AABegH1EWxIQj69nv/QDcfmqTSSK0itjRRTEPUKgcR+53ellcZGPmhjds187TWg8BD0AqGn8HW1ZOi1Ycw1lOAl0B3KKaMj/8RnZzPu5/Rm4QIXi0HFg+43LmKXlkojAtLbrsapQjEOOGCeLUtadCxQr6ZRzzL/2gr7yv4LY1kyKBZ2lK/7dFc+NrFXVuvFaJEKHUKhcf95gaxoT5PHsgmR9urQpS5lP1Owi3r4h79UBqwUg5uw2F1jyvB2DKefIfhsMsrLRgthMKPjPdq9sVmYCjXHbAw190g== 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: 17f52c55-2f35-4630-425a-08d5f6c7db1a X-MS-Exchange-CrossTenant-originalarrivaltime: 31 Jul 2018 09:27:37.6218 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 5d471751-9675-428d-917b-70f44f9630b0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR07MB4681 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: Tue, 31 Jul 2018 09:27:39 -0000 >>>>>>=20 >>>>>> I think the end result we're hoping for is something like pseudo cod= e below, >>>>>> (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 >>>>> 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 hav= e >>>>> 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 p= ort & queues >> have never been linked? >=20 > Based on return code? Yes, that works. I was thinking about the complexity of the implementation = as it would have to also track the pending unlink requests. But anyway, Harry is better= answering these questions since I guess he would be implementing this.