From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 5F899293B for ; Tue, 12 Dec 2017 17:08:14 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Dec 2017 08:08:13 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,395,1508828400"; d="scan'208";a="2182344" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by orsmga008.jf.intel.com with ESMTP; 12 Dec 2017 08:08:13 -0800 Received: from fmsmsx158.amr.corp.intel.com (10.18.116.75) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 12 Dec 2017 08:08:13 -0800 Received: from fmsmsx108.amr.corp.intel.com ([169.254.9.23]) by fmsmsx158.amr.corp.intel.com ([169.254.15.96]) with mapi id 14.03.0319.002; Tue, 12 Dec 2017 08:08:13 -0800 From: "Eads, Gage" To: Pavan Nikhilesh , "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" Thread-Topic: [dpdk-dev] [PATCH v2] eventdev: use links map to unlink queues Thread-Index: AQHTcyxckyTjJHg0JUWPe7OjYL4eQaM/3vLw Date: Tue, 12 Dec 2017 16:08:12 +0000 Message-ID: <9184057F7FC11744A2107296B6B8EB1E2BB16F75@FMSMSX108.amr.corp.intel.com> References: <20171211150528.13236-1-pbhagavatula@caviumnetworks.com> <20171212093331.20216-1-pbhagavatula@caviumnetworks.com> In-Reply-To: <20171212093331.20216-1-pbhagavatula@caviumnetworks.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNTczMTZkN2UtNWE2Zi00YjFjLWJmNzYtODc5YmE1ZmMxMmU4IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6IkZpUjhWWDRYczhqbjJQWTZNWGFYM25IRmx5Z1wvYStVNmpwb3ptUXpWUWI0PSJ9 x-ctpclassification: CTP_IC dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [10.1.200.106] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 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 16:08:15 -0000 > -----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 >=20 > The octeontx event device doesn't store the queues to port mapping as a r= esult > 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). >=20 > Using links_map we can determine the exact queues mapped to a specific po= rt > and unlink them. >=20 > Signed-off-by: Pavan Nikhilesh > --- > lib/librte_eventdev/rte_eventdev.c | 33 ++++++++++++++++++++++++++------= - > 1 file changed, 26 insertions(+), 7 deletions(-) >=20 > 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; >=20 > 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; > } >=20 > + links_map =3D dev->data->links_map; > + /* Point links_map to this port specific area */ > + links_map +=3D (port_id * RTE_EVENT_MAX_QUEUES_PER_DEV); > + > if (queues =3D=3D NULL) { > - for (i =3D 0; i < dev->data->nb_queues; i++) > - all_queues[i] =3D i; > + j =3D 0; > + for (i =3D 0; i < dev->data->nb_queues; i++) { > + if (links_map[i] !=3D > + > EVENT_QUEUE_SERVICE_PRIORITY_INVALID) { > + all_queues[j] =3D i; > + j++; > + } > + } > queues =3D all_queues; > - nb_unlinks =3D dev->data->nb_queues; > + } else { > + j =3D 0; > + for (i =3D 0; i < nb_unlinks; i++) { > + if (links_map[queues[i]] =3D=3D > + > EVENT_QUEUE_SERVICE_PRIORITY_INVALID) > + break; > + > + linked_queues[j] =3D queues[i]; > + j++; > + } > + queues =3D linked_queues; > } >=20 Looks good. If you want, you can simplify the else case like so: + } else { + for (j =3D 0; j < nb_unlinks; j++) + if (links_map[queues[j]] =3D=3D + EVENT_QUEUE_SERVICE_PRIORITY_INVALID) + break; + } Up to you. Either way: Acked-by: Gage Eads