From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id E86BE374 for ; Wed, 14 Mar 2018 22:41:10 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Mar 2018 14:41:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,307,1517904000"; d="scan'208";a="42082580" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga002.jf.intel.com with ESMTP; 14 Mar 2018 14:40:48 -0700 Received: from fmsmsx123.amr.corp.intel.com (10.18.125.38) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 14 Mar 2018 14:40:48 -0700 Received: from fmsmsx115.amr.corp.intel.com ([169.254.4.79]) by fmsmsx123.amr.corp.intel.com ([169.254.7.62]) with mapi id 14.03.0319.002; Wed, 14 Mar 2018 14:40:48 -0700 From: "Carrillo, Erik G" To: Pavan Nikhilesh , "jerin.jacob@caviumnetworks.com" , "nipun.gupta@nxp.com" , "hemant.agrawal@nxp.com" CC: "dev@dpdk.org" Thread-Topic: [PATCH v7 5/7] test: add event timer adapter auto-test Thread-Index: AQHTu5i/8pIfJJfvWkW7cA177Dr8fKPQQoNw Date: Wed, 14 Mar 2018 21:40:47 +0000 Message-ID: References: <1515630074-29020-1-git-send-email-erik.g.carrillo@intel.com> <1520546046-6973-1-git-send-email-erik.g.carrillo@intel.com> <1520546046-6973-6-git-send-email-erik.g.carrillo@intel.com> <20180314133103.GB27234@ltp-pvn> In-Reply-To: <20180314133103.GB27234@ltp-pvn> 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: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZGQwOGUzYjQtMjYzZS00NjI2LWExNDctYThkNWQ0OTA3YmZmIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjIuNS4xOCIsIlRydXN0ZWRMYWJlbEhhc2giOiJOR1htVU9TaDlnQ0RFMVRVVEtwdjI1aXpxR25pNmpFSFVFZGFCTjhkNERHWjkwNnU1UGFNNVwvM000WGFNZk9XVyJ9 x-ctpclassification: CTP_NT x-originating-ip: [10.1.200.107] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v7 5/7] test: add event timer adapter auto-test 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: Wed, 14 Mar 2018 21:41:11 -0000 Hi Pavan, > -----Original Message----- > From: Pavan Nikhilesh [mailto:pbhagavatula@caviumnetworks.com] > Sent: Wednesday, March 14, 2018 8:31 AM > To: Carrillo, Erik G ; > jerin.jacob@caviumnetworks.com; nipun.gupta@nxp.com; > hemant.agrawal@nxp.com > Cc: dev@dpdk.org > Subject: Re: [PATCH v7 5/7] test: add event timer adapter auto-test >=20 > Hi Gabriel, >=20 > Please make sure that the unit tests are generic, I could see that some p= laces > it is verifying whether event port is used or service cores are used, but > doesn't verify if actually event port/service core are needed i.e. > INTERNAL_PORT capability. Good point... I'll make these updates. Thanks for reviewing, Gabriel >=20 > On Thu, Mar 08, 2018 at 03:54:04PM -0600, Erik Gabriel Carrillo wrote: > > Signed-off-by: Erik Gabriel Carrillo > > --- > > test/test/Makefile | 1 + > > test/test/test_event_timer_adapter.c | 1234 > > ++++++++++++++++++++++++++++++++++ > > 2 files changed, 1235 insertions(+) > > create mode 100644 test/test/test_event_timer_adapter.c > > > > > + > > +/* This port conf callback is used by the max adapter instance creatio= n > test. > > + * Because that test may be limited by the number of ports available > > +in the > > + * event device, this callback allocates just one port and returns it > > +each > > + * time a port is requested. > > + */ > > +static int > > +test_port_conf_cb(uint16_t id, uint8_t event_dev_id, uint8_t > *event_port_id, > > + void *conf_arg) > > +{ > > + struct rte_eventdev *dev; > > + struct rte_event_dev_config dev_conf; > > + struct rte_event_port_conf *port_conf, def_port_conf =3D {0}; > > + int started; > > + static int port_allocated; > > + static uint8_t port_id; > > + uint8_t dev_id; > > + int ret; > > + > > + if (port_allocated) { > > + *event_port_id =3D port_id; > > + return 0; > > + } > > + > > + RTE_SET_USED(id); > > + > > + dev =3D &rte_eventdevs[event_dev_id]; >=20 > I don't think this is the correct way of accessing event dev information = i.e. > accessing the global rte_eventdevs structure from a application. >=20 > > + dev_id =3D dev->data->dev_id; > > + dev_conf =3D dev->data->dev_conf; > > + > > + started =3D dev->data->dev_started; > > + if (started) > > + rte_event_dev_stop(dev_id); > > + > > + port_id =3D dev_conf.nb_event_ports; > > + dev_conf.nb_event_ports +=3D 1; > > + ret =3D rte_event_dev_configure(dev_id, &dev_conf); > > + if (ret < 0) { > > + if (started) > > + rte_event_dev_start(dev_id); > Shouldn't this be !started ?. The same pattern repeats a few places. >=20 > > + > > + return ret; > > + } > > + > > + if (conf_arg !=3D NULL) > > + port_conf =3D conf_arg; > > + else { > > + port_conf =3D &def_port_conf; > > + ret =3D rte_event_port_default_conf_get(dev_id, port_id, > > + port_conf); > > + if (ret < 0) > > + return ret; > > + } > > + > > + ret =3D rte_event_port_setup(dev_id, port_id, port_conf); > > + if (ret < 0) > > + return ret; > > + > > + *event_port_id =3D port_id; > > + > > + if (started) > > + rte_event_dev_start(dev_id); > > + > > + port_allocated =3D 1; > > + > > + return 0; > > +} > >=20 > Thanks, > Pavan.