From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM04-BN3-obe.outbound.protection.outlook.com (mail-eopbgr680078.outbound.protection.outlook.com [40.107.68.78]) by dpdk.org (Postfix) with ESMTP id E9AFA58C4 for ; Mon, 30 Jul 2018 16:26:27 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=3WAasJpW8zIZsQNnsBEgB906AfsNU+4t2u+mdjeZW1Y=; b=o/sfOfvBv+cG1pBg7tjB/DzJBSgfHAiQTJlKAPaO82ZtULyNjiPNxFo5flylZPxwggPMPQI4U6Jo4xzFwWUxwLQ9gFHazTZSxLpctS27fmWddnW9ONrn3Jd8OYFTizJK3kLG92VFJNOLrsmeERG1bZOdYKNaYqI5gy/yyky/aZI= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.JacobKollanukkaran@cavium.com; Received: from jerin (50.233.148.155) by SN6PR07MB5006.namprd07.prod.outlook.com (2603:10b6:805:ac::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.995.16; Mon, 30 Jul 2018 14:26:24 +0000 Date: Mon, 30 Jul 2018 19:56:16 +0530 From: Jerin Jacob To: "Elo, Matias (Nokia - FI/Espoo)" Cc: "Van Haaren, Harry" , "dev@dpdk.org" Message-ID: <20180730142614.GA11265@jerin> References: <20180730075408.GA14117@jerin> <80CC5C07-0D73-4F86-9F93-0AB78DEF2BFD@nokia.com> <20180730092921.GA22242@jerin> <20180730103638.GA26701@jerin> <75889C0D-2790-4EB8-B202-1311D764CCF2@nokia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <75889C0D-2790-4EB8-B202-1311D764CCF2@nokia.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Originating-IP: [50.233.148.155] X-ClientProxiedBy: BYAPR02CA0018.namprd02.prod.outlook.com (2603:10b6:a02:ee::31) To SN6PR07MB5006.namprd07.prod.outlook.com (2603:10b6:805:ac::32) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8fbd310e-5e30-4997-0738-08d5f6286ec2 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:SN6PR07MB5006; X-Microsoft-Exchange-Diagnostics: 1; SN6PR07MB5006; 3:uq+k74oOCKa33x1SdgC/SoOGm8PBSESykYlOrg/u3//49h2C8y4QztgDqpFrYGhitajhzW6muXgB/W+xd5Q5S7aHigtPFW4A9C8bLChkGZBUycIC4OO2sfGaZCWX8syo+k71O6R3wzzmSt5PTcp5/jRwUZHSle4WoHwdAgUOlrara5lInHBea14ueH8mjA+2NgfepZ3WUvNhtRBhwQec4oBRc6k0KFojpqm91y/5lEXuepvM4q89NMUoSw6EzmEk; 25:pojxHhlmbfWBUR0uGfjXwjyPvfTxORRq3OXRSJJ/6UNrcVX67szfwsmeapJYV4kjHK9mdbisXCvuchVHoC6f6mvQ4YX9KAlKAjlF5hlIe57Zvcf/BZOZKuJ5VCJm2M35jbX4XRxay3r+tXFpaBk5V69KrYDsbTmKHiyql4bmaoWUzKhG6P00ucCWLEdixkJ6+W1rci7izt/f6nOCTWBZs+yUUZVS3RkI1RHx8EYw/Ebu5OGbW/3reM8kdwSpWM9avvjDCYdcWN/gx4VBThax5luDJiG8i7b8/uGh8KytZM/3ho+zOA7mY8Y5Bemj9CjfqLCLKVLbswfsnWne7TEU9g==; 31:NgIboWrXDwMpEd6k7cjZZ1scDAPhYTq+qIUkPrjsncjreziQn5tBFKEudFPzcJlpJqWhNDrEXEVsBzAaXzGfwQqDf48ogdAU7oLtElNkqi8xcnttarwIJz0vOp50BSFQdVNI2p4Ksh4wKAbXsBys/UtzB14NDex3M8lOjLxFDaZjI14fFkOIvLxNEERgnN9eJz5l54YEvrTr9XZfu4+rEA1OIBm3NrjTC0qvXP6wrcM= X-MS-TrafficTypeDiagnostic: SN6PR07MB5006: X-Microsoft-Exchange-Diagnostics: 1; SN6PR07MB5006; 20:3MIroY3vZEEnBJ1oJ4ekrt+nmTO8uk5oUTTPUqkEMvVaQjtOzZsLJYXMG8jW1UVjyC6klxtpCne4AN2w+7zzK41zMquk64u6MBFPiwsAzABcSqqI7NGdvhgeSad6WGiezf8kLt2jKBpTCCEqtO4W0LktNe72o9GCAlQMgtaA71C8AA/HoN8QAYpu8wq62yd8UeXmObAIXkw9R6A7JZgvJvm6So4AWgfGkMeZi6nER2g3WtbnzeuAMpM9+qtb3RCoezXRUkJw2LHHfdmtSo420LvRoYX9VcqiyQbxRI9wN0NIBhA2tjBo5nxvFDYDC653kZQHGFLcGlf+ObCp9GOh0ymPuxTRdnAbLrVBY1Bw2Lnc/ZtaDyDhpCRjyHZFzePi5qMpDlYW3eGdEbbDPVGw5QtdowE6rrckdT9zHdtcFoWLABCZTxK/iCeU2S8tH3lcPd8xlr89Cz9v0A6m5oSvL8GFZHbWHglWmxOlbnsdqsk+oC5AUZMF2GJiF0CJ76oxuZe/YAWNryK9CJqVQa4GwUkIUy1SBDTOdNgrRzfXrdZDEBWk+ye2FY7/6UM6tLhtxGzoXQYofrlE3WQK8WSEMqrqpk1/boF/2zo6L6iQInE= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(82608151540597)(109105607167333)(195916259791689)(228905959029699); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3002001)(10201501046)(93006095)(3231311)(944501410)(52105095)(149027)(150027)(6041310)(201703131423095)(201703031522075)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123562045)(20161123558120)(20161123560045)(6072148)(201708071742011)(7699016); SRVR:SN6PR07MB5006; BCL:0; PCL:0; RULEID:; SRVR:SN6PR07MB5006; X-Microsoft-Exchange-Diagnostics: 1; SN6PR07MB5006; 4:DGJbP5WFloOhjP+XtxOiaFhw48j57pXiKdbpQHenYlZk33bFKHyoFwMBfVemgUEN0Udfe+W16+5lkGCp6kGNvhdFldrsl+B1G5aLdOLFn7gYi6N1yeuV7J6uGw7NV0olw+r6OaN8rV/LsMtgeoPneoetF72XH1yiCjsZ/4zGrJO5KUmOb7u3x5x/xsnE9HHZMssamg5T+O7dDwKvnu6IyfxPFVAsdcSYmpHVzS/4cbTkSskHlKWvTeMOgaGkcQXGiQNw74Y0JQCNgc5Sk0Dp1lxv9Pd1Xo5pn4YWVg1CPmpG2yI+lZKk2sH9HqmGfHf+I3VCx9SAMoluvJxQCUEw+jG6epRlVfUxzqGPpPnrwAj/uc9TITnf+3cX3T8KEM/3RMRYUUPR+cNiAcFSaBni5sBFL7hWKdq7SrpJWAR5yIY= X-Forefront-PRVS: 0749DC2CE6 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39860400002)(346002)(396003)(136003)(376002)(366004)(199004)(189003)(13464003)(26005)(106356001)(68736007)(81156014)(81166006)(956004)(97736004)(47776003)(72206003)(6666003)(476003)(33896004)(11346002)(7736002)(5660300001)(446003)(486006)(33716001)(8936002)(44832011)(6496006)(305945005)(386003)(93886005)(6916009)(52116002)(478600001)(76176011)(54906003)(42882007)(8676002)(66066001)(23726003)(6116002)(58126008)(229853002)(25786009)(296002)(316002)(55016002)(3846002)(1076002)(33656002)(4326008)(16586007)(14444005)(16526019)(105586002)(9686003)(53936002)(50466002)(186003)(2906002)(6246003)(18370500001); DIR:OUT; SFP:1101; SCL:1; SRVR:SN6PR07MB5006; H:jerin; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-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uPr9hcH3L3xvXW?= =?us-ascii?Q?e1C9JWdZVWriryPpSTCc22WUxNYhLdkzdppuABobsHGrpfXBviyM9UOX1RLy?= =?us-ascii?Q?oj83mFNGj22A+G5/spO5uwGNh7RHcmXri1nzqaSeOVY47ALWaFyyGwRcMFOD?= =?us-ascii?Q?GUj8C6h8TW8nUV1po+R8vzAdKqnM98YlT9mbpD5n/O/TPoHKTK2UI/0QgYkU?= =?us-ascii?Q?TFfJi0Pi8gKNmvI57eNLVylByx9LpGPJoprAOUE+s0IH+7CR3H/1xdpvCR1z?= =?us-ascii?Q?TxijsQSYdwScLNF4bY6k0usxYJjznVuk8ADHrTkLSWgsrYVxzYn48dmGMPlz?= =?us-ascii?Q?PNTjOKtnh3H7l1u7KMutOruRoz12BCDQHSS9wW5whODpg9EWxfKndIntQR3k?= =?us-ascii?Q?rFNPTwF6WoYvZ44VlnNytI0IP1QlFrmpgHBb/kRTFEwUt86XLW7dOQFquEXJ?= =?us-ascii?Q?31wMIfk0e23OxlwhoK2K1wGHlkv8XwmGiSTli6KX23eWJ4XzCYcMvgt/PLPI?= =?us-ascii?Q?c+QP9fvqw3pxH/KJ0/FLtYVvt89RFrGJNLC5F+9JPfm8i4s?= X-Microsoft-Antispam-Message-Info: wF+zd3DbVztOPFu/B5nyQVcrfR10zlJSdxxyro7aJqgNTY3FsD0l2P5niNui2J4DWB3VGx9nie3XcgeWpDACX8MCAcaytlkWjDn3ZpGJlKwF7GNilqfPLtwiwsKUVUNyDsKn0eFGLtXUDVzNTIWH7iU4r1ThEWFG6uyaO951HcvQYrZquB2MCUeYuIW8464NF097Pzpw4rB8pT3ENaSCJqwflhm9BqaIOSY6035Gzkh2W+iXRFK0pDCd71Hc0OFM8kBC49hkYk01zSrqr4QJY/1LV6iYEb87elCqZr/PtjDGCMmBK7LiWK85dhXag/UdGvq1JVC5XOJ6FmUOg1v2fZ2J+Nbxd3mDSm4OmDPnxKw= X-Microsoft-Exchange-Diagnostics: 1; SN6PR07MB5006; 6:bcgpkFXT/FTK7VE70ZqZh5+jj03dJvBOIpNSUCp9Ro4Uz/OUXDd+3Dh1cSOPEe1aR98Bt2+fBFrvJF+lDOwdugH+DM8TxM+0mRaFcKijQEdABFMmvqNkvwJ68cFfUABEfS52oV6jsZuZPLvdGJcCoKEWxP+t3ZQGjEfw6tdx1fk59jozeERlUsy7t0U5sZ1nl7a1A8624SrYHbXpyRG85ExL4oz6N8U3Pg/7N+CW87BzJ8m/1BPScEHBzW0vN00vlNaxZldd5YDFAE0EkCbpUZauz/DY1ga5RxjbgrTrxhrpxCibEi4tz6oDiLvWdicVVqbVBn+9UrEQRAClrBxEmDPvGCJI3oSeWagjN30Zx3zGlQp1d+cFTrd8MhExWXEylEYDjGaOv0BRzXCWs/lYXfnaKObKTIlukwYUxkRz5bFaCb8qJ9ZIn95oi3427jM/6Z2hF+iNl65AJix/mxXSKg==; 5:XoZxjHFC3xuugMfpDTDJFeMZzR+Ug7vifzNKpSLdpd56GxnYOw2VZuEx4CraV2TVw68b7pZ3dBuuSP11NTw3cPhH+mdHoliwA9sd9wGIPryPzUzEOy0mwPNJJmNQW+iOfp3JF20lZyKh1rewTmeu/1MfSgs31pcU207iHldIQtg=; 7:nPIn5EtlRmCqtcTpF7toTBpXDa7y+O1aQxql8Fwp/MT/Z+NeDhR/Ht2PhfhvbgxqCm/XBDZPh1/nRe0PG+ovPO+BIh85GZpB0gBPNpthj5ZTNB9B4BW/SjfZ82oAtWA4wjsQYGIn/gRlVPTYPdrV61oeWFl+aP1QlBxSD+qsvmrUbOi3TIdAQDpEFmJBxeSMwjHfQ8jHrVq2PPUfPxjQxnsi+sh4uXaCAI1Dl43s9mwReDx6P/bW/1x9HhJww1Vj SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jul 2018 14:26:24.1533 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8fbd310e-5e30-4997-0738-08d5f6286ec2 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR07MB5006 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 14:26:28 -0000 -----Original Message----- > Date: Mon, 30 Jul 2018 13:36:35 +0000 > From: "Elo, Matias (Nokia - FI/Espoo)" > To: Jerin Jacob > CC: "Van Haaren, Harry" , "dev@dpdk.org" > > Subject: Re: [dpdk-dev] eventdev: method for finding out unlink status > x-mailer: Apple Mail (2.3445.9.1) > > > >> For this "runtime scale down" use-case the missing information is being > >> able to identify when an unlink is complete. After that (and ensuring the > >> port buffer is empty) the application can be guaranteed that there are no > >> 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. > >> > >> As mentioned before, I think an "unlinks_in_progress()" function is perhaps > >> the easiest way to achieve this functionality, as it allows relatively simple > >> tracking of unlinks() using an atomic counter in sw. (Implementation details > >> become complex when we have a separate core running event/sw, separate cores > >> polling, and a control-plane thread calling unlink...) > >> > >> 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): > >> > >> int worker_poll = 1; > >> > >> worker() { > >> while(worker_poll) { > >> // eventdev_dequeue_burst() etc > >> } > >> go_to_sleep(1); > >> } > >> > >> control_plane_scale_down() { > >> unlink(evdev, worker, queue_id); > >> while(unlinks_in_progress(evdev) > 0) > >> usleep(100); > >> > >> /* here we know that the unlink is complete. > >> * so we can now stop the worker from polling */ > >> worker_poll = 0; > >> } > > > > > > 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. > > > > Anyway it RC2 now, so we can not accept a new feature. So we will have > > time for deprecation notice. > > > > 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. OK. Does rte_event_port_unlink() returning -EBUSY will help? while (rte_event_port_unlink() != nr_links) usleep(100); 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? Are we calling this API in fastpath? or it is control thread as mentioned in harry's pseudo code.