From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <harry.van.haaren@intel.com>
Received: from mga06.intel.com (mga06.intel.com [134.134.136.31])
 by dpdk.org (Postfix) with ESMTP id 41A671B1D2
 for <dev@dpdk.org>; Tue, 19 Dec 2017 11:25:53 +0100 (CET)
X-Amp-Result: SKIPPED(no attachment in message)
X-Amp-File-Uploaded: False
Received: from orsmga006.jf.intel.com ([10.7.209.51])
 by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;
 19 Dec 2017 02:25:52 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.45,426,1508828400"; 
   d="scan'208";a="4045332"
Received: from irsmsx107.ger.corp.intel.com ([163.33.3.99])
 by orsmga006.jf.intel.com with ESMTP; 19 Dec 2017 02:25:50 -0800
Received: from irsmsx102.ger.corp.intel.com ([169.254.2.180]) by
 IRSMSX107.ger.corp.intel.com ([169.254.10.239]) with mapi id 14.03.0319.002;
 Tue, 19 Dec 2017 10:25:49 +0000
From: "Van Haaren, Harry" <harry.van.haaren@intel.com>
To: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>,
 "jerin.jacob@caviumnetworks.com" <jerin.jacob@caviumnetworks.com>,
 "Richardson, Bruce" <bruce.richardson@intel.com>, "Eads, Gage"
 <gage.eads@intel.com>, "hemant.agrawal@nxp.com" <hemant.agrawal@nxp.com>,
 "nipun.gupta@nxp.com" <nipun.gupta@nxp.com>, "Rao, Nikhil"
 <nikhil.rao@intel.com>, "santosh.shukla@caviumnetworks.com"
 <santosh.shukla@caviumnetworks.com>
CC: "dev@dpdk.org" <dev@dpdk.org>
Thread-Topic: [dpdk-dev] [PATCH v3 7/8] app/eventdev: add service core
 configuration
Thread-Index: AQHTcpLIu9eEIZlOG0e0QGte1IRsu6NKgFCg
Date: Tue, 19 Dec 2017 10:25:49 +0000
Message-ID: <E923DB57A917B54B9182A2E928D00FA650FE380C@IRSMSX102.ger.corp.intel.com>
References: <1508330348-30060-1-git-send-email-pbhagavatula@caviumnetworks.com>
 <20171211151346.14405-1-pbhagavatula@caviumnetworks.com>
 <20171211151346.14405-7-pbhagavatula@caviumnetworks.com>
In-Reply-To: <20171211151346.14405-7-pbhagavatula@caviumnetworks.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNDJkOTUxMTQtOGYyMC00ZmZhLWIwMTctMzUwOTE3YTQ3YTk2IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6Ik54OUJ2aFJJRDNQa0IrZVkxdVJxZUthamZJN1RcL1h6b1JKSFV0ZXd3dW9RPSJ9
x-ctpclassification: CTP_IC
dlp-product: dlpe-windows
dlp-version: 11.0.0.116
dlp-reaction: no-action
x-originating-ip: [163.33.239.181]
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
Subject: Re: [dpdk-dev] [PATCH v3 7/8] app/eventdev: add service core
 configuration
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Tue, 19 Dec 2017 10:25:53 -0000

> From: Pavan Nikhilesh [mailto:pbhagavatula@caviumnetworks.com]
<snip>
> 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 <pbhagavatula@caviumnetworks.com>
> ---
>  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 <harry.van.haaren@intel.com>