From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 3FBA01B303 for ; Fri, 19 Jan 2018 00:57:24 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Jan 2018 15:57:22 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,379,1511856000"; d="scan'208";a="23577658" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga001.fm.intel.com with ESMTP; 18 Jan 2018 15:57:22 -0800 Received: from fmsmsx157.amr.corp.intel.com (10.18.116.73) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 18 Jan 2018 15:57:22 -0800 Received: from fmsmsx115.amr.corp.intel.com ([169.254.4.132]) by FMSMSX157.amr.corp.intel.com ([169.254.14.125]) with mapi id 14.03.0319.002; Thu, 18 Jan 2018 15:57:21 -0800 From: "Carrillo, Erik G" To: Pavan Nikhilesh , "jerin.jacob@caviumnetworks.com" CC: "dev@dpdk.org" Thread-Topic: [PATCH v6 08/23] eventtimer: add adapter start/stop definitions Thread-Index: AQHTiwG3LdYTwgvxuUCrlK0j9R9Ig6N6T8XQ Date: Thu, 18 Jan 2018 23:57:20 +0000 Message-ID: References: <1512158458-22661-1-git-send-email-erik.g.carrillo@intel.com> <1515630074-29020-1-git-send-email-erik.g.carrillo@intel.com> <1515630074-29020-9-git-send-email-erik.g.carrillo@intel.com> <20180111172831.7ljnkrzjxmlxd7vs@Pavan-LT> In-Reply-To: <20180111172831.7ljnkrzjxmlxd7vs@Pavan-LT> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMmU5ZTU4MjgtNGY5Mi00MThjLWJlZDktMThkNzUxNDU5ZjBmIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjIuNS4xOCIsIlRydXN0ZWRMYWJlbEhhc2giOiI4OTFrbGVWTkFVK0h4T2VlUGp1ZkRNZUROUEhMbnBlQ0lZR3NmbFVxN1JBUGpPek5UZ25lZE53NVRPODBVS0FiIn0= x-ctpclassification: CTP_NT 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 v6 08/23] eventtimer: add adapter start/stop definitions 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: Thu, 18 Jan 2018 23:57:24 -0000 > -----Original Message----- > From: Pavan Nikhilesh [mailto:pbhagavatula@caviumnetworks.com] > Sent: Thursday, January 11, 2018 11:29 AM > To: Carrillo, Erik G ; > jerin.jacob@caviumnetworks.com; nipun.gupta@nxp.com; > hemant.agrawal@nxp.com > Cc: dev@dpdk.org > Subject: Re: [PATCH v6 08/23] eventtimer: add adapter start/stop definiti= ons >=20 > On Wed, Jan 10, 2018 at 06:20:59PM -0600, Erik Gabriel Carrillo wrote: > > Add definitions to the default software implementation for the > > functions that start and stop adapter instances. > > > > Signed-off-by: Erik Gabriel Carrillo > > --- > > lib/librte_eventdev/rte_event_timer_adapter.c | 19 > > +++++++++++++++---- > > 1 file changed, 15 insertions(+), 4 deletions(-) > > > > diff --git a/lib/librte_eventdev/rte_event_timer_adapter.c > > b/lib/librte_eventdev/rte_event_timer_adapter.c > > index 38f4dcf..27e6226 100644 > > --- a/lib/librte_eventdev/rte_event_timer_adapter.c > > +++ b/lib/librte_eventdev/rte_event_timer_adapter.c > > @@ -565,7 +565,18 @@ sw_event_timer_adapter_uninit(struct > > rte_event_timer_adapter *adapter) static int > > sw_event_timer_adapter_start(const struct rte_event_timer_adapter > > *adapter) { > > - RTE_SET_USED(adapter); > > + int ret; > > + struct rte_event_timer_adapter_sw_data *sw_data; > > + > > + sw_data =3D adapter->data->adapter_priv; > > + > > + ret =3D rte_service_component_runstate_set(sw_data->service_id, 1); > > + if (ret < 0) > > + return ret; > > + > > + /* If no service core is mapped to the service, fail */ > > + if (!rte_service_runstate_get(sw_data->service_id)) > > + return -ENOENT; >=20 > If a service is mapped to more than one service core then the service is > executed in parallel if it is multi thread safe else every core takes a l= ock and > executes the service callback. >=20 > Now in case of timer adapter the following piece of code arms the timer o= n > the service core that currently runs the service. > rte_timer_reset_sync(tim, cycles, SINGLE, > rte_lcore_id(), > sw_event_timer_cb, > msg->evtim); > This might lead to delay in timer expiry being called as rte_timer_manage= () > has to be scheduled on the same service core again. >=20 > The immediate solution that comes to my mind is to limit the number of > service cores mapped to 1. >=20 > Thoughts? Yes, good catch. This service is not MT-safe and if it gets mapped to mult= iple lcores, each such lcore will be unable to run the service function wh= ile other cores are running it, which would introduce delays unnecessarily = since rte_timer_manage gets called less frequently. I agree that the numb= er of mapped service cores should be limited to 1 while the service is MT-u= nsafe. If we do that, we can also put the message ring into single-consume= r mode. In a future change, I can also look at making the service MT-safe. >=20 > Cheers, > Pavan. >=20 > > > > return 0; > > } > > @@ -573,9 +584,9 @@ sw_event_timer_adapter_start(const struct > > rte_event_timer_adapter *adapter) static int > > sw_event_timer_adapter_stop(const struct rte_event_timer_adapter > > *adapter) { > > - RTE_SET_USED(adapter); > > - > > - return 0; > > + struct rte_event_timer_adapter_sw_data *sw_data; > > + sw_data =3D adapter->data->adapter_priv; > > + return rte_service_component_runstate_set(sw_data->service_id, > 0); > > } > > > > static void > > -- > > 2.6.4 > >