From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id E442A3256 for ; Fri, 1 Dec 2017 21:19:45 +0100 (CET) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Dec 2017 12:19:44 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,346,1508828400"; d="scan'208";a="155159678" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga004.jf.intel.com with ESMTP; 01 Dec 2017 12:19:44 -0800 Received: from fmsmsx156.amr.corp.intel.com (10.18.116.74) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.319.2; Fri, 1 Dec 2017 12:19:44 -0800 Received: from fmsmsx115.amr.corp.intel.com ([169.254.4.116]) by fmsmsx156.amr.corp.intel.com ([169.254.13.63]) with mapi id 14.03.0319.002; Fri, 1 Dec 2017 12:19:44 -0800 From: "Carrillo, Erik G" To: Pavan Nikhilesh Bhagavatula CC: "dev@dpdk.org" Thread-Topic: [RFC PATCH v4 2/4] eventtimer: add common code Thread-Index: AQHTaNG+8P8crW5AH0KrpUQdf9hI2aMtZzTAgAETc4CAAHZKcA== Date: Fri, 1 Dec 2017 20:19:43 +0000 Message-ID: References: <1511217333-142455-1-git-send-email-erik.g.carrillo@intel.com> <1511890808-6072-1-git-send-email-erik.g.carrillo@intel.com> <1511890808-6072-3-git-send-email-erik.g.carrillo@intel.com> <20171129051924.o2q7z6l7zeewd7kf@Pavan-LT> <20171201051314.osskzpohzike7r3h@Pavan-LT> In-Reply-To: <20171201051314.osskzpohzike7r3h@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: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYTIzZjdmMjgtMjA4Yi00MzFhLWFiMGYtZTA0OTlhYmFlMTZiIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjIuNS4xOCIsIlRydXN0ZWRMYWJlbEhhc2giOiJsS1wvTjJibmNjMjhmRXNSWkFDMjh5RU5wXC9SREdtYVFvVmk2YWlcL01odld1ZXVDNDdQQmJ2RkpGK05zODllT1BrIn0= x-ctpclassification: CTP_IC x-originating-ip: [10.1.200.108] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [RFC PATCH v4 2/4] eventtimer: add common code 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: Fri, 01 Dec 2017 20:19:46 -0000 > -----Original Message----- > From: Pavan Nikhilesh Bhagavatula > [mailto:pbhagavatula@caviumnetworks.com] > Sent: Thursday, November 30, 2017 11:13 PM > To: Carrillo, Erik G > Cc: dev@dpdk.org > Subject: Re: [RFC PATCH v4 2/4] eventtimer: add common code >=20 > On Thu, Nov 30, 2017 at 08:59:19PM +0000, Carrillo, Erik G wrote: > > Hi Pavan, > > > > Thanks for the review; I'm working on addressing the comments and have > the following question (inline): > > > > <... snipped ...> > > > > > > + adapter->data->mz =3D mz; > > > > + adapter->data->event_dev_id =3D conf->event_dev_id; > > > > + adapter->data->id =3D adapter_id; > > > > + adapter->data->socket_id =3D conf->socket_id; > > > > + adapter->data->conf =3D *conf; /* copy conf structure */ > > > > + > > > > + /* Query eventdev PMD for timer adapter capabilities and ops */ > > > > + ret =3D dev->dev_ops->timer_adapter_caps_get(dev, > > > > + &adapter->data->caps, > > > > + &adapter->ops); > > > > > > The underlying driver needs info about the adapter flags i.e. > > > RTE_EVENT_TIMER_ADAPTER_F_ADJUST_RES and > > > RTE_EVENT_TIMER_ADAPTER_F_SP_PUT so we need to pass those too > conf- > > > >flags. > > > > By "underlying driver", are you referring to the eventdev PMD, or the > event timer adapter "driver" (i.e., the set of ops functions)? > > > > If the latter, the adapter "driver" will have a chance to inspect the f= lags > when adapter->ops->init() is called below, since it can look at the flags > through the adapter arg. > > >=20 > I was refering to the timer driver, the presence of flag > RTE_EVENT_TIMER_ADAPTER_F_SP_PUT would suggest the driver to use a > multi thread unsafe arm/cancel data path API and it would set a different > function pointers to adapter->arm_burst etc. >=20 > I dont think in the current scheme this is possible. Currently, if we see > mempool it inspects flags before setting ops. >=20 > Hope this clears things up. >=20 > -Pavan Yes, I see your point now. I agree that it would be useful to allow differ= ent ops structures to be selected based on the flags that are set in additi= on to being able to inspect the flags within the ops functions themselves. = I have made the change in the follow-up patch series. Thanks, Gabriel >=20 > > If the former, will the eventdev PMD consider the flags when deciding > whether or not to provide an ops definition in the timer_adapter_caps_get= () > call? > > > > > > > > > + if (ret < 0) { > > > > + rte_errno =3D -EINVAL; > > > > + return NULL; > > > > + } > > > > + > > > > + if (!(adapter->data->caps & > > > > + RTE_EVENT_TIMER_ADAPTER_CAP_INTERNAL_PORT)) { > > > > + FUNC_PTR_OR_NULL_RET_WITH_ERRNO(conf_cb, -EINVAL); > > > > + ret =3D conf_cb(adapter->data->id, adapter->data- > > > >event_dev_id, > > > > + &adapter->data->event_port_id, conf_arg); > > > > + if (ret < 0) { > > > > + rte_errno =3D -EINVAL; > > > > + return NULL; > > > > + } > > > > + } > > > > + > > > > + /* Allow driver to do some setup */ > > > > + FUNC_PTR_OR_NULL_RET_WITH_ERRNO(adapter->ops->init, - > > > ENOTSUP); > > > > + ret =3D adapter->ops->init(adapter); > > > > + if (ret < 0) { > > > > + rte_errno =3D -EINVAL; > > > > + return NULL; > > > > + } > > > > + > > > > + /* Set fast-path function pointers */ > > > > + adapter->arm_burst =3D adapter->ops->arm_burst; > > > > + adapter->arm_tmo_tick_burst =3D adapter->ops- > > > >arm_tmo_tick_burst; > > > > + adapter->cancel_burst =3D adapter->ops->cancel_burst; > > > > + > > > > + adapter->allocated =3D 1; > > > > + > > > > + return adapter; > > > > +} > > > > <... snipped ...>