From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-eopbgr30138.outbound.protection.outlook.com [40.107.3.138]) by dpdk.org (Postfix) with ESMTP id A76F24C9D for ; Mon, 30 Jul 2018 12:28:36 +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=kpdC4JmQ86coJrAxCn1JzfAUDV007P77qPwuIELmxns=; b=ZvaoMFuoHNTReQFP30yV/00hxo0JNrl3nw5H1xe6Ox8xniAs+nDJPRokcfRy3qPEp4zDXFSTQ1hNHeqTz8DuHOjhXY9JtBirOW4JqjwE4YRYU3b15VlHH/66FL6FqwsgcXm68FSSPzU6a57J1nqOWhs9Zu7Kk4pyWopYq1rkClE= Received: from DB7PR07MB4556.eurprd07.prod.outlook.com (52.135.141.14) by DB7PR07MB4074.eurprd07.prod.outlook.com (52.134.100.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1017.11; Mon, 30 Jul 2018 10:28:35 +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 10:28:35 +0000 From: "Elo, Matias (Nokia - FI/Espoo)" To: "Van Haaren, Harry" CC: Jerin Jacob , "dev@dpdk.org" Thread-Topic: [dpdk-dev] eventdev: method for finding out unlink status Thread-Index: AQHUJ9Aa1/qQlBsMGkGIBi2aSKyqoKSnZV8AgAAXrwCAAALrgIAAAmqAgAAOcwA= Date: Mon, 30 Jul 2018 10:28:35 +0000 Message-ID: <90E39B85-3490-482B-9578-F2D94576111E@nokia.com> References: <20180730075408.GA14117@jerin> <80CC5C07-0D73-4F86-9F93-0AB78DEF2BFD@nokia.com> <20180730092921.GA22242@jerin> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: Apple Mail (2.3445.9.1) x-originating-ip: [131.228.32.171] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DB7PR07MB4074; 6:qBVmUd4GvKmFGo94yjxhhFrv5Z2rRrS3AUfaSCBWVv3DgLJplzg5XZsVOLKjwGFryBCYg6UbGmzf1D5t0FtnAlsDdOrVg9Z3oO9WBK8ytieiK9Ulnr6OTKu8YiDAc/GZz7142NVulg6xgbdWZVFgqyyXqBR7MqDasvS+IlUgMBcbXuIbGJjYI8aTJreGxY4i+OQYTr8fKtvp18a5JRhJbhwkTh4MGeuM7t4i3AWVKrkaljz68+q4ZD9oKr346MQ7FNGxFUBy1xiO+/sVoMrLtr7fvB3x4J1l6N7k4+X9Ymupy5GDUohVN+HlRPVdii7hM2UY5TKRH054NABBK3rp7IRuThFNSYGMAetHTD3VfhqiF4dnfxwfyGVyQ+DwPhsu5tsCkxNflV4JHn8DykHbiAP5EIWandn5T/Ci+EetNmEv2jvH8+8qhczm3z47JjawZpCFpcBPePj9FQUYrDcu0g==; 5:ZOCD8u5R+FtfqTIZbAowRV0YedoXrX4kPfnjxCCAj5+6xZml2M6AdsBlFRgNLuyvNLT+GO7iqosR+1L8EtSxbV0bogzhUIv6tKX89YTUDYjFYyKlQORKTBbQwgFKZgFgXcCtbL8iLnhevYxA2SabF7ONqtG6+TV1dXKte4Uq5jk=; 7:4d6kvkMe3q2PthaVag7KYYWcN5EWk2c1m3RyNFB0MUtezQ2uO0bJMOEjj7AqqolLD7I81VtUJUkkyb9iG+o8XGZ4IyCAO85WeEZVan9syD2DZzlFd5oql5oacRUR6JCPnWpZfoBl1oZPTRSAtcW8UWDlsQ05yRQBPA2SiX4KSfMpbqalS+esvvGqCNnPO4+uf53pEfejJhelVG3v8Vee4yILCWggYZ5FZLIKUvRLCU+n348FitihDqAdjxxSeLCP x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: 9630c8c5-63ad-4e3f-1249-08d5f60734ec 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:DB7PR07MB4074; x-ms-traffictypediagnostic: DB7PR07MB4074: authentication-results: spf=none (sender IP is ) smtp.mailfrom=matias.elo@nokia.com; 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)(3002001)(10201501046)(93006095)(93001095)(3231311)(11241501184)(806099)(944501410)(52105095)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(6072148)(201708071742011)(7699016); SRVR:DB7PR07MB4074; BCL:0; PCL:0; RULEID:; SRVR:DB7PR07MB4074; x-forefront-prvs: 0749DC2CE6 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(366004)(136003)(346002)(39860400002)(396003)(376002)(199004)(189003)(68736007)(97736004)(5250100002)(7736002)(305945005)(50226002)(6506007)(2906002)(102836004)(229853002)(6246003)(5660300001)(6486002)(33656002)(53936002)(6436002)(26005)(6512007)(2900100001)(8676002)(478600001)(81156014)(81166006)(4326008)(14454004)(76176011)(8936002)(25786009)(99286004)(93886005)(86362001)(11346002)(82746002)(105586002)(476003)(446003)(6916009)(106356001)(54906003)(486006)(256004)(36756003)(83716003)(57306001)(66066001)(186003)(2616005)(316002)(6116002)(3846002); DIR:OUT; SFP:1102; SCL:1; SRVR:DB7PR07MB4074; 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: z/B+EVdMiieaUm+iqBKh9oeZXd89D3pQq3HNpDrflrjIJuG1fTGC+GiayqmD6cPPlB2PiEL/Exww7FAQQSDttjxLlzUh+vOOugxa9A5gdBzMNLqsFb18McxZQQ6OwSzL4MRHW7exmhgTov1N9cL82x7mFDuJyYWBA2e9wl2rJ+S1iJ470NyA7WsikptQgNRusDOFgsY9Ahaky7KyI+3Lpc4xbs8bNClQ/4GMOaScCI0+spLcCAr6GFUcHjBNJpdGCOncgJTYclPmiC5B3YqrTmZ+5zRMv70lWA9sE/EmgwebPwyq5p9bV6rVNTiamDbzIJwJQmf1fVXiAtQIEi7NCVPgW7h3iJ5uSJOIQBax6vm/B1/i4zjqLl9WakvuJ5T71zQdA3Lw4RI6bOmlhtoXgw== 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: 9630c8c5-63ad-4e3f-1249-08d5f60734ec X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Jul 2018 10:28:35.4312 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 5d471751-9675-428d-917b-70f44f9630b0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR07MB4074 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 10:28:37 -0000 > I don't think that the eventdev API requires 1:1 Lcore / Port mapping, so= really a > PMD should be able to handle any thread calling any port. >=20 > The event/sw PMD allows any thread to call dequeue/enqueue any port, > so long as it is not being accessed by another thread. >=20 >=20 >>>> A given event port assigned to a new lcore other than >>>> it previous one then we need to do some clean up at port level. >>>=20 >>> In my case I'm mapping an event port per thread statically (basically >> thread_id =3D=3D port_id), >>> so this shouldn't be an issue. >=20 > This is the common case - but I don't think we should demand it. > There is a valid scale-down model which just polls *all* ports using > a single lcore, instead of unlink() of multiple ports. I agree, 1 : 1 Lcore / Port mapping shouldn't be required. > I think the end result we're hoping for is something like pseudo code bel= ow, > (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 > Hope my pseudo-code makes pseudo-sense :) Makes sense =3D) One use case this API wouldn't support is if an application would unlink only a subset of linked queues. In this case events could be still arriving constantly after unlinks_in_progress() returns zero, so there is n= o way for the application to know when all events from unlinked queues have been processed. However, at least in our application this information is not nee= ded.