From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Van Haaren, Harry" Subject: Re: [PATCH v3 7/8] app/eventdev: add service core configuration Date: Tue, 19 Dec 2017 10:25:49 +0000 Message-ID: References: <1508330348-30060-1-git-send-email-pbhagavatula@caviumnetworks.com> <20171211151346.14405-1-pbhagavatula@caviumnetworks.com> <20171211151346.14405-7-pbhagavatula@caviumnetworks.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Cc: "dev@dpdk.org" To: Pavan Nikhilesh , "jerin.jacob@caviumnetworks.com" , "Richardson, Bruce" , "Eads, Gage" , "hemant.agrawal@nxp.com" , "nipun.gupta@nxp.com" , "Rao, Nikhil" , "santosh.shukla@caviumnetworks.com" Return-path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 41A671B1D2 for ; Tue, 19 Dec 2017 11:25:53 +0100 (CET) In-Reply-To: <20171211151346.14405-7-pbhagavatula@caviumnetworks.com> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" > From: Pavan Nikhilesh [mailto:pbhagavatula@caviumnetworks.com] > Add service core configuration for Rx adapter. The configuration picks > the least used service core to run the service on. >=20 > Signed-off-by: Pavan Nikhilesh > --- > app/test-eventdev/evt_common.h | 41 ++++++++++++++++--------------= --- > --- > app/test-eventdev/test_perf_atq.c | 12 +++++++---- > app/test-eventdev/test_perf_common.c | 13 ++++++++++++ > app/test-eventdev/test_perf_queue.c | 12 +++++++---- > 4 files changed, 47 insertions(+), 31 deletions(-) >=20 > diff --git a/app/test-eventdev/evt_common.h b/app/test-eventdev/evt_commo= n.h > index 0fadab4a0..042823a52 100644 > --- a/app/test-eventdev/evt_common.h > +++ b/app/test-eventdev/evt_common.h > @@ -94,41 +94,36 @@ evt_has_all_types_queue(uint8_t dev_id) > } >=20 > static inline int > -evt_service_setup(uint8_t dev_id) > +evt_service_setup(uint32_t service_id) > { > - uint32_t service_id; > int32_t core_cnt; > unsigned int lcore =3D 0; > uint32_t core_array[RTE_MAX_LCORE]; > uint8_t cnt; > uint8_t min_cnt =3D UINT8_MAX; >=20 > - if (evt_has_distributed_sched(dev_id)) > - return 0; > - > if (!rte_service_lcore_count()) > return -ENOENT; See last comment - we can try to get next lcore, and add it as a service co= re to continue running test? >=20 > - if (!rte_event_dev_service_id_get(dev_id, &service_id)) { > - core_cnt =3D rte_service_lcore_list(core_array, > - RTE_MAX_LCORE); > - if (core_cnt < 0) > - return -ENOENT; > - /* Get the core which has least number of services running. */ > - while (core_cnt--) { > - /* Reset default mapping */ > - rte_service_map_lcore_set(service_id, > - core_array[core_cnt], 0); Nit: these two can be on the same line >=20 > + if (!(cap & RTE_EVENT_ETH_RX_ADAPTER_CAP_INTERNAL_PORT)) { > + uint32_t service_id; > + > + rte_event_eth_rx_adapter_service_id_get(prod, > + &service_id); > + ret =3D evt_service_setup(service_id); > + if (ret) { > + evt_err("Failed to setup service core" > + " for Rx adapter\n"); No need to split strings here. > + if (!evt_has_distributed_sched(opt->dev_id)) { > + uint32_t service_id; > + rte_event_dev_service_id_get(opt->dev_id, &service_id); > + ret =3D evt_service_setup(service_id); > + if (ret) { > + evt_err("No service lcore found to run event dev."); > + return ret; Would it be better to try get next lcore, and add as a service core here? T= hat way we could continue running the test. With above suggestions; Acked-by: Harry van Haaren