From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-eopbgr40124.outbound.protection.outlook.com [40.107.4.124]) by dpdk.org (Postfix) with ESMTP id A379D14EC for ; Tue, 31 Jul 2018 10:09: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=VX/AL5VVPcwgeIq6cB+IZPjlZfmkKccWbIR/68s3U3c=; b=CX+9bXOslvSb/Qpe5BdOcquUImo8Jn/DbKPuagGl7DHSUMdt6cPmtC6+vI6lCCROR/NG3K6Ui6xbG7e8X1fBI0OBIcSRdcFRTF4z+J6H6XGnr3eJ7w2Flx7ezTR0bnaeRvvoMNr+DQ+rqTC6afYyDubS93XeCTLY7cOYMBH3rBQ= Received: from DB7PR07MB4556.eurprd07.prod.outlook.com (52.135.141.14) by DB7PR07MB4588.eurprd07.prod.outlook.com (52.135.141.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1017.14; Tue, 31 Jul 2018 08:09:05 +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 08:09:05 +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/qQlBsMGkGIBi2aSKyqoKSnZV8AgAAXrwCAAALrgIAAAmqAgAAQZICAADKWAIAADY8AgAEpQgA= Date: Tue, 31 Jul 2018 08:09:05 +0000 Message-ID: <6D43DE84-583D-42E5-B298-0E7BDA0C17FB@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> In-Reply-To: <20180730142614.GA11265@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; DB7PR07MB4588; 6:BNtYmoyHVuwnpxYJxgS/5q18jpD1xSHAIbCdTlz6GsGTqrASLfjsPGpikiO958bXMCBe4FkR5W2gzipGrBCv+PatedVKepYZ0XaXqqu4Ruag0OFRbeBZl+i+e1GPXK4XJgk8oW4veUVCY5Y8riJx/kYhPugPPQRGHPf+mB454jn+hY0QoTlnjKRe9/bLltypOuykg1TI/fBvHuBY1WZqvyRUmdnBwaqO3La99uMXAnnsrQ28sscayIGbPPey0wC0IGAmnepGEuZYyP9/Px+bXHvRuDzk0mJIMZbFkUSd/zZnKfiFzQlS7UZxMHbWVdM1/UHlvA8d47dsFtyXMZrnw53OIa5Vqb/UDGrdPOZIMBqenLnAnI1M8ehrLm962vo9iTW5Q7aJ/7JkZUEYUQjsWJ+LNLO1oLBHMYGJZ9LxkDf1+NdUjeYsalY8N5QB8F68ayGj24UI9xvOKRFofx9ovw==; 5:o5VN2wefx6oFo0x4OjvYJGau/RY+vH1vktVLPhB8gdAqXRM8S3OOCjmIHMFVFosmFbVqq3kZip4Ty1TJPe1WTGhxCLaeA2+EtpLBtru3bBRL8vwxNq5bBd7qMPSnbWW3rpvjo4Ga+A5+accBdzlQB6WhSuGDgewzO+sP1PFizhI=; 7:RSNROH4EzbhwJA7ZQLmTd/J4pUND4ddf3G7cvouOssnpvYhgIzd7HdkTopOXBVrE/qfWKnJZ0A8KgSyebtLYKcLlvN8Y0a9aR6DV2+iqMVdRhMqxdCiaIpFHetxPs6wUE4CC7t1QB+SOhv9dAU44uZKZ0SAY8qRod7cd2CtiEsFX0is1oG56KZNnbUtQCZjFbyUxSRgew9bNJHE3XvrltLHUbUsouaebcrN2IaEWPjfGM4XABgWeynseTGpx4HDF x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: d15f5cbe-c300-43f6-b33b-08d5f6bce29f 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:DB7PR07MB4588; x-ms-traffictypediagnostic: DB7PR07MB4588: 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)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123558120)(20161123562045)(20161123564045)(6072148)(201708071742011)(7699016); SRVR:DB7PR07MB4588; BCL:0; PCL:0; RULEID:; SRVR:DB7PR07MB4588; x-forefront-prvs: 0750463DC9 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(346002)(39860400002)(376002)(366004)(396003)(136003)(199004)(189003)(33656002)(14454004)(106356001)(446003)(5660300001)(54906003)(476003)(83716003)(2906002)(2616005)(11346002)(82746002)(5250100002)(486006)(97736004)(66066001)(6916009)(478600001)(2900100001)(305945005)(36756003)(7736002)(68736007)(8676002)(229853002)(6506007)(6246003)(14444005)(256004)(105586002)(50226002)(8936002)(6512007)(6116002)(3846002)(86362001)(102836004)(93886005)(81166006)(53936002)(316002)(81156014)(6436002)(76176011)(99286004)(57306001)(6486002)(186003)(4326008)(25786009)(26005); DIR:OUT; SFP:1102; SCL:1; SRVR:DB7PR07MB4588; H:DB7PR07MB4556.eurprd07.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: nokia.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: fqI4uXnzz9Ojqpk72cNBl1vosaE5URi6ALxX8ZUpfrsPFfC3Vg0knDQaMrXWG+4jh/aN6sak3ypdE6yNo8T6qwSFD6epK0stzOh9IBYwSlIZRU0lCwG5/XRnP+V5W9J/Jdc/UOdjuMuZloH/5AKJDU1zkW9DRN84QxZsCD2IQ3O1zajzEq/usfgjgojkXgTsk0Dfqhoz3dgE8/ltU+PLniQIVguQYhlWPbBfwHjoU5U+PPeDEVWw+eaGyyiS2cjs5EOYphk8buUsox/JALqzSuhUbxeJovGJeZGhb5OqQbfV5V1fahu621Zj4rDuSlKRiyHkF6vhAC/tA1fUfOnPjvKsFSQ6dNCCsVPqBRPNQgasFtuFSBeOaNimhpcMUPQ6ueqhWLTx6gyEo2fSe/gpMg== 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: d15f5cbe-c300-43f6-b33b-08d5f6bce29f X-MS-Exchange-CrossTenant-originalarrivaltime: 31 Jul 2018 08:09:05.7203 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 5d471751-9675-428d-917b-70f44f9630b0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR07MB4588 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 08:09:06 -0000 >>>>=20 >>>> I think the end result we're hoping for is something like pseudo code = 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 have >>> 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? 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? The implementation may also be more complex compared to a separate function= but Harry is a better person to answer this. >=20 > while (rte_event_port_unlink() !=3D nr_links) > usleep(100); >=20 > I am trying to think, how can address this requirements without creating = new API and/or less impact to other > drivers which don't have this requirements? Wouldn't this function then just be NOP for the other drivers? >=20 > Are we calling this API in fastpath? or it is control thread as > mentioned in harry's pseudo code. In our use case it could be called also directly from the fast path by the = worker thread.