From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0078.outbound.protection.outlook.com [104.47.34.78]) by dpdk.org (Postfix) with ESMTP id 6233D2C55 for ; Tue, 12 Dec 2017 18:23:23 +0100 (CET) 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; bh=ZfxnqO27sspRURY3PPhAyd3nnMQA5Z66Sv+aoAXRcEs=; b=C926MHEejnGpAyPFt0xfYGU5GGArHgawxC7VbocWhBSZoqUlQgfEsWMX7t0GZdB08rK/dkmrWRxEP9oEjwm/UUpFNacM12N13wfT7GXgfE5hf8japfVZUBUujoA9Oivzb0ShjPBFaOK25knWlm5i06XoJWJX6qHDe4+kgcIfKZI= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; Received: from Pavan-LT (103.16.71.47) by BN6PR07MB3457.namprd07.prod.outlook.com (10.161.153.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.302.9; Tue, 12 Dec 2017 17:23:17 +0000 Date: Tue, 12 Dec 2017 22:52:52 +0530 From: Pavan Nikhilesh Bhagavatula To: "Eads, Gage" , "jerin.jacob@caviumnetworks.com" , "Richardson, Bruce" , "Van Haaren, Harry" , "hemant.agrawal@nxp.com" , "nipun.gupta@nxp.com" , "Rao, Nikhil" , "santosh.shukla@caviumnetworks.com" Cc: dev@dpdk.org Message-ID: <20171212172251.mmotp3ngusvrfsby@Pavan-LT> References: <20171211150528.13236-1-pbhagavatula@caviumnetworks.com> <20171212093331.20216-1-pbhagavatula@caviumnetworks.com> <9184057F7FC11744A2107296B6B8EB1E2BB16F75@FMSMSX108.amr.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9184057F7FC11744A2107296B6B8EB1E2BB16F75@FMSMSX108.amr.corp.intel.com> User-Agent: NeoMutt/20170609 (1.8.3) X-Originating-IP: [103.16.71.47] X-ClientProxiedBy: BM1PR0101CA0053.INDPRD01.PROD.OUTLOOK.COM (10.174.220.143) To BN6PR07MB3457.namprd07.prod.outlook.com (10.161.153.20) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 777a33a2-36e8-45d5-a032-08d541850ab5 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307); SRVR:BN6PR07MB3457; X-Microsoft-Exchange-Diagnostics: 1; BN6PR07MB3457; 3:+daWKS4Su7FbID7vXCJ5vrinI+KIJ60nzW/PuT7uYXz0JBzjb+n5qbwpvzLixQ9X1SIn6KjPde8ToZFXr+6TnYcWKsxuLmdpeLJT8HY4NdBgE0EHKUtubBGMA/MVSZJmAy8XSQYmGcEXA8VdYexvPg2soRq9r6xhRrQ+QVmvZwxvnQ5LrmLfjvOUN6mOfRPbG5YiSLYbkqAs40ryvvu7RL3B2o8tTwbUeKwVCJI6FrnDgtBzZJiM4+jM/vaMUb7+; 25:3Nx5McN9V35xzwGwkil7/pPITwXDYv67NvOBWsbHeWPgiSGjV0IqjLCyP0aBasYqE+xV+isns1cJM24u1xa1u+WsIxMijTZg/yw1TB1u7RxOlXQ7kk0/eV7UKF+yCANjZotBSIWS5WCw6PHoga+X8kIKCpyDyYhJ/lDAxJB8fDe+0JTt55wq+MiZDm1Prbl3p0lzkgpXS4CgaGyukVh2JxIvt1ih6pP4popELVzHKsjy5wADrIyZMrDLhKjBzlnWMgkC2Mw4PhFtWBClrzM/UIc4sCMPxGhJQPlsaPX7hL/mDZp74UY91cJLLDpRCGVO9Vqa9FEkIQsfUSLvMjE/LQ==; 31:4rwLYwj/eNS14Rgk9bS2w6olbqdbjncTo5G99aIVmpolJSn4KsX63e826rBDgVEtLPLXsQ4qZcTRhvDBP3i5zpWeC5Nnz8bQ2oIYbLenrclyWuGiugS7xsZAlEebo+bVUGlZBOhER6aiMh60L/brEld6QtDx9bcNap1IhIRowPH+D/zrdvkXHpUhYvXsqIhjTg/rvMZkFixkGjAry5u7BxnOuzwIXRU5goww/71j7BU= X-MS-TrafficTypeDiagnostic: BN6PR07MB3457: X-Microsoft-Exchange-Diagnostics: 1; BN6PR07MB3457; 20:AJ/ZE/l1+lL0+FkR1rsXvcpw7VuirSjkOiWXk0hjroCp5eroBWKylb1plEzFN/Fwe3FNDDEesNoOG15UST0esiLvOjOHmSOhkWDLuBVjsloTVlEX/kvAsHrm3sWBupy6kgaONtWa1RJfVvGfqc3Y/J9fwRODf+PegsHNJHGZBq6hJ/Lzg/tlChh0UwIxz/MVNLvrRyleBkbhFPM3vdrxViWnzcjWRa8HWN9NvH6oDg+AIqYdoc9pydDhlhkYT/eUGY4I1SDS5Ez2Toa25G3wj3rk7apYv31aBPKb6snzpsVg7AuAN1OpuvUYuoL85/upybxyKP8vHf4a7q2Fi0ZRk7Sk3fv+uSos0oBGyC1GrpbVeEGSwa10YgX4XYOtrnQxQvpsJtISdvI1nKmf6RP1wZZVvhw7iq0K0z3PlxKXqjJaZ0vVemDljMNhZQKfTitI+Z7MRNyJ5/Sr8ijibopOQVmj3faIY0A+gAqSRuWrsEP6oiqrD/ymZwK9VaCllt8euhHUyfnsy7wQLFbouKU0njJ943GZYT9Tv3y7A4Ruun6VPPNNN9QsOqoffgHAMm33GwSdDfmoyY53FTPKmQNC7CHqJJhwMi9BY/Qs+AqxyvA= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(228905959029699); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(2401047)(5005006)(8121501046)(10201501046)(93006095)(3002001)(3231023)(6041248)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(20161123558100)(20161123555025)(20161123562025)(6072148)(201708071742011); SRVR:BN6PR07MB3457; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:BN6PR07MB3457; X-Microsoft-Exchange-Diagnostics: 1; BN6PR07MB3457; 4:+vEN7yPOucJpR3sh2T64j1eq70FG3M9/cKo4Aa98tXbOwiUfTKWFQ1PA/Ma+OEY79D4ZEje/0MHvTZ+dY6auhHLljATy/22DmLYOuv9MbUC1nA/2JpMqShy0HdAG741GF5kgf1oaSzg4c74oaLa+UrteDVjHDR/EpZ6ZV/eLTJv5IMSeo2fwDBCotCmTGUj/ecShlo57JBfbm8B/DMBlwsEqtObqHFPaLSnSzaTVfDrcVKOaPRAHJYbt8I/KtURaJSq/mDbYCvCT6pl/fxUEDfwnQ+58rIX2gn91YQSHiFnsMRs7xnFztKaHWoa2y1lnxeIAN5msbSi4I3fNgpO5+voLDCvj1UHPSPqxL2x70as= X-Forefront-PRVS: 051900244E X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(366004)(376002)(346002)(13464003)(199004)(189003)(24454002)(25786009)(2906002)(50466002)(6116002)(105586002)(3846002)(23726003)(53936002)(229853002)(4326008)(66066001)(16526018)(83506002)(76176011)(52116002)(478600001)(55016002)(9686003)(316002)(16586007)(58126008)(110136005)(97736004)(47776003)(33896004)(68736007)(8656006)(72206003)(6246003)(2950100002)(5660300001)(6666003)(2201001)(1076002)(106356001)(6496006)(42882006)(33716001)(575784001)(53546010)(8676002)(81166006)(81156014)(6636002)(2501003)(7736002)(305945005)(8936002)(107986001)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR07MB3457; H:Pavan-LT; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN6PR07MB3457; 23:mCS5h4vJlA3asI+CRY9O/D9536Keyr5CQ8CjtoyJT?= =?us-ascii?Q?mIulPp0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LTb4UMJWHZvk35KfBNmLzNFNyJY9b/flWBl+1xVXyIZ6XPtfPAqA1cONHHo8Dsxg7BE8poPLoI/oPUjWClm+OVs=; 7:D75m3Dq/8yq3RDO1g1aM/inz5lQKpoY15vn7t6l11f0Pgs23YhDU1PixNxUeVjL69kISITue4AD8MKdJMlf1u8NNZYasgQX6s4uvROqM01HySmHruKaWgBPkwdCSvu5KdJI3E0XTVtJoi8MeV4EKJ4t/eSzNlYF0MOisYc6FFIXmipXTHRt8a8KlkP8JRATuM68dbTpFoQ5hGJaiJbmAaC7WSeq5th0Lluhkdvu4/Krmrnn5szviNVwSe2zUSLi4 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Dec 2017 17:23:17.9236 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 777a33a2-36e8-45d5-a032-08d541850ab5 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR07MB3457 Subject: Re: [dpdk-dev] [PATCH v2] eventdev: use links map to unlink queues 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, 12 Dec 2017 17:23:24 -0000 On Tue, Dec 12, 2017 at 04:08:12PM +0000, Eads, Gage wrote: > > > > -----Original Message----- > > From: Pavan Nikhilesh [mailto:pbhagavatula@caviumnetworks.com] > > Sent: Tuesday, December 12, 2017 3:34 AM > > To: jerin.jacob@caviumnetworks.com; Richardson, Bruce > > ; Van Haaren, Harry > > ; Eads, Gage ; > > hemant.agrawal@nxp.com; nipun.gupta@nxp.com; Rao, Nikhil > > ; santosh.shukla@caviumnetworks.com > > Cc: dev@dpdk.org; Pavan Nikhilesh > > Subject: [dpdk-dev] [PATCH v2] eventdev: use links map to unlink queues > > > > The octeontx event device doesn't store the queues to port mapping as a result > > it cannot return the exact number of queues unlinked from a port when > > application wants to unlink all the queues mapped (supplies queues param as > > NULL). > > > > Using links_map we can determine the exact queues mapped to a specific port > > and unlink them. > > > > Signed-off-by: Pavan Nikhilesh > > --- > > lib/librte_eventdev/rte_eventdev.c | 33 ++++++++++++++++++++++++++------- > > 1 file changed, 26 insertions(+), 7 deletions(-) > > > > diff --git a/lib/librte_eventdev/rte_eventdev.c > > b/lib/librte_eventdev/rte_eventdev.c > > index e0c2a78..b43ffbf 100644 > > --- a/lib/librte_eventdev/rte_eventdev.c > > +++ b/lib/librte_eventdev/rte_eventdev.c > > @@ -888,7 +888,8 @@ rte_event_port_unlink(uint8_t dev_id, uint8_t port_id, { > > struct rte_eventdev *dev; > > uint8_t all_queues[RTE_EVENT_MAX_QUEUES_PER_DEV]; > > - int i, diag; > > + uint8_t linked_queues[RTE_EVENT_MAX_QUEUES_PER_DEV]; > > + int i, diag, j; > > uint16_t *links_map; > > > > RTE_EVENTDEV_VALID_DEVID_OR_ERRNO_RET(dev_id, -EINVAL, 0); > > @@ -906,13 +907,34 @@ rte_event_port_unlink(uint8_t dev_id, uint8_t > > port_id, > > return 0; > > } > > > > + links_map = dev->data->links_map; > > + /* Point links_map to this port specific area */ > > + links_map += (port_id * RTE_EVENT_MAX_QUEUES_PER_DEV); > > + > > if (queues == NULL) { > > - for (i = 0; i < dev->data->nb_queues; i++) > > - all_queues[i] = i; > > + j = 0; > > + for (i = 0; i < dev->data->nb_queues; i++) { > > + if (links_map[i] != > > + > > EVENT_QUEUE_SERVICE_PRIORITY_INVALID) { > > + all_queues[j] = i; > > + j++; > > + } > > + } > > queues = all_queues; > > - nb_unlinks = dev->data->nb_queues; > > + } else { > > + j = 0; > > + for (i = 0; i < nb_unlinks; i++) { > > + if (links_map[queues[i]] == > > + > > EVENT_QUEUE_SERVICE_PRIORITY_INVALID) > > + break; > > + > > + linked_queues[j] = queues[i]; > > + j++; > > + } > > + queues = linked_queues; > > } > > > > Looks good. If you want, you can simplify the else case like so: > > + } else { > + for (j = 0; j < nb_unlinks; j++) > + if (links_map[queues[j]] == > + EVENT_QUEUE_SERVICE_PRIORITY_INVALID) > + break; > + } Thanks Gage, will clean up 'linked_queues' and send v3. Pavan > > Up to you. Either way: > Acked-by: Gage Eads