From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0084.outbound.protection.outlook.com [104.47.34.84]) by dpdk.org (Postfix) with ESMTP id 06695199B3 for ; Tue, 12 Dec 2017 08:24:05 +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=dOF/2SQJ3Oi5HoL1Wr+EYYzxkyoiYNezKUsB0ldhGC8=; b=JEqpuxZOh7bROAxzvvlwbNxgfy2pqB/U/DfydhZkptzgM4Wv7IpTm8vI+a4G5g/HQbJR4MWFSODCa0bQXzFUmPPgvKQ5utR4L22tSH5IRN81fWsmVNeYpcbPixGkYF80SiPtapdRa7DNyr8xQff+Emv2V38ifkZ9L2azGR/3ysY= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; Received: from Pavan-LT (111.93.218.67) by DM5PR07MB3468.namprd07.prod.outlook.com (10.164.153.23) 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 07:23:58 +0000 Date: Tue, 12 Dec 2017 12:53:46 +0530 From: Pavan Nikhilesh Bhagavatula To: "Eads, Gage" , "jerin.jacob@caviumnetworks.com" , "Richardson, Bruce" , "nipun.gupta@nxp.com" , "santosh.shukla@caviumnetworks.com" , "Van Haaren, Harry" , "hemant.agrawal@nxp.com" Cc: dev@dpdk.org Message-ID: <20171212072345.blcsaqs6q22qiwwf@Pavan-LT> References: <20171211150528.13236-1-pbhagavatula@caviumnetworks.com> <9184057F7FC11744A2107296B6B8EB1E2BB16442@FMSMSX108.amr.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9184057F7FC11744A2107296B6B8EB1E2BB16442@FMSMSX108.amr.corp.intel.com> User-Agent: NeoMutt/20170609 (1.8.3) X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: MWHPR18CA0029.namprd18.prod.outlook.com (10.175.9.143) To DM5PR07MB3468.namprd07.prod.outlook.com (10.164.153.23) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4a7ad59b-e629-4333-de8d-08d5413151c1 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(5600026)(4604075)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603307); SRVR:DM5PR07MB3468; X-Microsoft-Exchange-Diagnostics: 1; DM5PR07MB3468; 3:kyzOnzkvF+YnbCieZ2EeUpqZ8YoE8U3TXnXPPyb4CsS8Vcz+BB7EwYy1z/nMzzK+hlXHLbDEuuP3ccmqQWQgRraOD4GXpSomxLQKUUFW9pHJdtCLWZNH2JYrykX4+ro+qOtPU+iHfDVxNp+RLUPyINtJ5WmHE9qIujXT0nb1KHBTUP5Jx3WIqD0gfEyz03H9Aa+SESLcb/YjXHwtbAP4n3L2rIq2c1yJ/iiGpxXuZ7rMtK0jjkgCTK1nLuq03caq; 25:elQY2aWJtdEkjw5H2o8N+AHxPYI+WD1eetWBW/P4hRcTl74l+pUKZ4jKkgdv4tX7N00CJ48vpMaSCqUR7VJCTP8xl6Iz5zFyTeaQogBeFn/7bzsdM0hCRYiENk5msottKCgS8WmIAvSnf2CarCsXDunpAB9HUOLai1BeOqb7muFQWZvDY8rI7vSHHV7T2cG1xRgIPQ5SaS4Y/39uakQJuC0xiANLfYjGBiWia0xohsU7JP8USFqzBcI504xHW9KRkn34Ivs3A6cLR4G4l6m7Y+mzwx0OFviPaMSkIZRZ0Qre8WF6MPdfHbuGS3uFVrl/MSVHTzS/7oVxCZXnKHf/7A==; 31:dKUBgJ0AdRocnfINhTfiGd6zVpIdGLL9ZQCM02FMVwVzWcf9NOWCIVOYPOUs3s7SoL4W+cudCaFLwhK0yU7X7RJ5+GEScXbgB0FesMO6ia8wYcEdOO1buIkHf6P1BSkMwEMWtx+c5OySTNxdAkVmObJytx5xPI9W9GOzLl10aOICKmS0ugL1vN8o1JUEXgSo6MFBacnVRm89HH4eFOSiR7MBj1oDzYPh1uDLrQ+8sQQ= X-MS-TrafficTypeDiagnostic: DM5PR07MB3468: X-Microsoft-Exchange-Diagnostics: 1; DM5PR07MB3468; 20:5+mVT/KYZw5ZH4mmwRIhj1tjb6YeJOQv1JsSx4eQRnSaoLVhRyOHHDCac31rUM6MD0KgFSOMMWGRvOm8lRyUUql+zsXgoIR7y2vo47TFUVubFodJtTPKDMpgUMWUbTMOa7TiNy3JH7uug32mdmu7AsEV295mPbmotWuizt+1tc17bXQF127SmPVJbxmDv69QUNsts+rACoBSpub0mI6uepc3ZpYkd16HK7k6ySgX1H30VjSTuSWM6zndipvOOeIQZ2CMpAgiR7d1uTqZ76v61ozwHpoBDxDpw0Maqngyzr04bha7sYnPaBIWHv2F8AwrsIWQkrjYk11ABmKu/tBLziHiptUJ7OPej8aVTWovwbrRKYzZ5JjEUdzII1dZQ+RhT+hcxmnACG7lTYR2n8vLx01c3byk5PiZZS12lMUyVtluxsjAvRrKUcMTUjJLN4oWmhRpo0M/5AQZ7AiajyQatP1bCtx52Y9w9a73ArOhfFEJE9/HJcOCGruOcmr0r6VQv+UHw7TvTfkT88u/n4Qh5/2Ro6rL5Cp+obMvHyK5V5EtqW9NxOSqtZQUzz0up3f8kdv6VdAX7CnsgyBXamLp3lh6NxzSvGs+N2Jq5DSRjQY= 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)(8121501046)(5005006)(93006095)(10201501046)(3002001)(3231023)(6041248)(20161123564025)(20161123558100)(20161123562025)(20161123560025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:DM5PR07MB3468; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:DM5PR07MB3468; X-Microsoft-Exchange-Diagnostics: 1; DM5PR07MB3468; 4:qu1+lq8dQPBGtqPTpql4CujsFtkruUPucOBFwTm/S/4TyiyZCFJ8+9Uks0gsXJYy8IsjzfrXtIpCn/OCe+p7l1XhzBuT7CCok//3eobmngljyYQx1lo5hQwDHFuoA2iO5rDxLeepxHMcA7H8CNPWyH2TSqtO5IeCBZPruKEDv0fWOsvrILLtUjhczraSDP8JAO6wcnMjvA+c+rnStF0j9BnYDjHmBuhGDQCLEtfCdN3Q025HvF8U3pBybtnFP5Ai14J+i/ScgX2GAPqeq9d9AVdCCAH6Y+V2/0jsFeQAuh+T3Ex9894gN/Rd5j4Dz9PS4KSrVKFakMvkUHa8QPCTEVWobYHhIl0r2vXSKUG8ILI= X-Forefront-PRVS: 051900244E X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(376002)(366004)(346002)(189003)(199004)(13464003)(24454002)(81156014)(8676002)(2201001)(7736002)(2950100002)(110136005)(83506002)(81166006)(47776003)(58126008)(6666003)(66066001)(4326008)(2501003)(97736004)(8656006)(16586007)(316002)(575784001)(5660300001)(42882006)(16526018)(25786009)(305945005)(2906002)(52116002)(9686003)(33896004)(68736007)(6246003)(59450400001)(229853002)(1076002)(53936002)(55016002)(6496006)(478600001)(6116002)(23726003)(106356001)(50466002)(105586002)(76176011)(33716001)(3846002)(5009440100003)(8936002)(53546010)(72206003)(921003)(107986001)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR07MB3468; H:Pavan-LT; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A: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; DM5PR07MB3468; 23:irjen1rABKmkDqkgaz31KXjGJSw5w0rFeq0TIvMWe?= =?us-ascii?Q?sqFQnuD+NuvnIpQgqVrynNp1UZpMNsT2Hmf04H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XfwWf+ZCF25QhI0XZbk=; 24:Ih8CVVdxyJ6ZszDcoaaVP5S70/hzSIGy1UYqy3kFP0SOh7tNG2Q18Uudz1z/M9mPqewgjjv+qkprRCZ2X1YbyOzveNqSmUug9GcYqmEWC5c=; 7:3Vgvlg2KGnB1X+kXukGm6wcfHGzE/ttWK/jW34ZwgeuPIxCYVXR1Ysx4UCK/7/+kZrp+2MkW4iooTgdoKTBXVdKi3IqqmDg+T/p0jxpFbMrqVhyv9aNcuAS25ymqD8rxdI3ge4o1lpDEr2cXNUvVj2If+UaCK++IH5oO2RynMqJiaXCK5Bm5PJOuf/qa4ch5qHmXrbBMMaE5biXAOpian/bZyvmFFC8ibtK/6WXeRbec635+NCJKOjQ5EK9IPfRQ SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Dec 2017 07:23:58.9280 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4a7ad59b-e629-4333-de8d-08d5413151c1 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR07MB3468 Subject: Re: [dpdk-dev] [PATCH] 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 07:24:05 -0000 On Mon, Dec 11, 2017 at 05:24:57PM +0000, Eads, Gage wrote: > > > -----Original Message----- > > From: Pavan Nikhilesh [mailto:pbhagavatula@caviumnetworks.com] > > Sent: Monday, December 11, 2017 9:05 AM > > To: Eads, Gage ; jerin.jacob@caviumnetworks.com; > > Richardson, Bruce ; nipun.gupta@nxp.com; > > santosh.shukla@caviumnetworks.com; Van Haaren, Harry > > ; hemant.agrawal@nxp.com > > Cc: dev@dpdk.org; Pavan Nikhilesh > > Subject: [dpdk-dev] [PATCH] 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 | 15 ++++++++++++++- > > 1 file changed, 14 insertions(+), 1 deletion(-) > > > > diff --git a/lib/librte_eventdev/rte_eventdev.c > > b/lib/librte_eventdev/rte_eventdev.c > > index e0c2a78..e17f8fc 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); > > @@ -918,6 +919,18 @@ rte_event_port_unlink(uint8_t dev_id, uint8_t port_id, > > rte_errno = -EINVAL; > > return 0; > > } > > + j = 0; > > + links_map = dev->data->links_map; > > + links_map += (port_id * RTE_EVENT_MAX_QUEUES_PER_DEV); > > + for (i = 0; i < nb_unlinks; i++) { > > + if (links_map[queues[i]] != > > + EVENT_QUEUE_SERVICE_PRIORITY_INVALID) { > > + linked_queues[j] = queues[i]; > > + j++; > > + } > > + } > > + queues = linked_queues; > > + nb_unlinks = j; > > Consider the following case where queues is non-NULL: nb_unlinks = 3, queues = [0, 5, 2], and queue 5 is not linked to the port. > > This new code block will unlink queues 0 and 2, and the function will return 2. However the documentation states that "if the return value is less than *nb_unlinks*, the remaining queues at the end of queues[] are not established", so a return value of 2 would imply that queues 0 and 5 were unlinked, but queue 2 was not. > > Perhaps this code could be moved to the "if (queues == NULL)" block, and in its place you can update nb_unlinks like so to handle the non-NULL queues case: > > links_map = dev->data->links_map; > links_map += (port_id * RTE_EVENT_MAX_QUEUES_PER_DEV); > for (i = 0; i < nb_unlinks; i++) { > if (links_map[queues[i]] != > EVENT_QUEUE_SERVICE_PRIORITY_INVALID) > break; > } > nb_unlinks = i; > > Thanks, > Gage Agreed, will send out a cleaned up v2 addressing both the cases. Thanks, Pavan.