From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 784FE4C93 for ; Fri, 30 Mar 2018 20:47:44 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 30 Mar 2018 11:47:40 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,382,1517904000"; d="scan'208";a="216345346" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga005.fm.intel.com with ESMTP; 30 Mar 2018 11:47:40 -0700 Received: from fmsmsx115.amr.corp.intel.com ([169.254.4.26]) by FMSMSX105.amr.corp.intel.com ([169.254.4.209]) with mapi id 14.03.0319.002; Fri, 30 Mar 2018 11:47:40 -0700 From: "Carrillo, Erik G" To: "Bhagavatula, Pavan" , "Jacob, Jerin" CC: "dev@dpdk.org" Thread-Topic: [PATCH v8 7/9] test: add event timer adapter auto-test Thread-Index: AQHTyD6aEYgQQWXRdketU+UMLz7Kc6PpHHUg Date: Fri, 30 Mar 2018 18:47:40 +0000 Message-ID: References: <1520546046-6973-1-git-send-email-erik.g.carrillo@intel.com> <1522358852-3630-1-git-send-email-erik.g.carrillo@intel.com> <1522358852-3630-8-git-send-email-erik.g.carrillo@intel.com> <20180330154755.GA23814@ltp-pvn> In-Reply-To: <20180330154755.GA23814@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: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMGYyOTRiYmUtMTNmZS00MTk2LWEwNGUtODY5MTRkMzU1Njg4IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjIuNS4xOCIsIlRydXN0ZWRMYWJlbEhhc2giOiJkTUJhRkpsYlJxcTFFNGNNWDA3UUtXK2xOaE93ZHR2OVdHWUwycjUrWUw4MTFoaXBUWmt1RllVNThLUytjNTdwIn0= x-ctpclassification: CTP_NT 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] [PATCH v8 7/9] 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: Fri, 30 Mar 2018 18:47:46 -0000 Hi Pavan, > -----Original Message----- > From: Bhagavatula, Pavan [mailto:Pavan.Bhagavatula@cavium.com] > Sent: Friday, March 30, 2018 10:49 AM > To: Carrillo, Erik G ; Jacob, Jerin > ; nipun.gupta@nxp.com; > hemant.agrawal@nxp.com > Cc: dev@dpdk.org > Subject: Re: [PATCH v8 7/9] test: add event timer adapter auto-test >=20 > Hi Erik, >=20 > Few comments below, >=20 <...snipped...> > > +/* Test that adapter stops correctly. */ static int > > +adapter_stop(void) > > +{ > > + uint32_t evdev_service_id, adapter_service_id; > > + struct rte_event_timer_adapter *l_adapter =3D NULL; > > + > Please use INTERNAL_PORT capability to determine if service core is > required. >=20 =20 Good catch. I meant to remove the references to service ids here, so I've = gone ahead and done that. <...snipped...> > > +stat_inc_reset_ev_enq(void) > > +{ > > + int ret, i, n; > > + int num_evtims =3D MAX_TIMERS; > > + struct rte_event_timer *evtims[num_evtims]; > > + struct rte_event evs[BATCH_SIZE]; > > + struct rte_event_timer_adapter_stats stats; > > + const struct rte_event_timer init_tim =3D { > > + .ev.op =3D RTE_EVENT_OP_NEW, > > + .ev.queue_id =3D TEST_QUEUE_ID, > > + .ev.sched_type =3D RTE_SCHED_TYPE_ATOMIC, > > + .ev.priority =3D RTE_EVENT_DEV_PRIORITY_NORMAL, > > + .ev.event_type =3D RTE_EVENT_TYPE_TIMER, > > + .state =3D RTE_EVENT_TIMER_NOT_ARMED, > > + .timeout_ticks =3D 5, // expire in .5 sec > > + }; > > + > > + ret =3D rte_mempool_get_bulk(eventdev_test_mempool, (void > **)evtims, > > + num_evtims); > > + TEST_ASSERT_EQUAL(ret, 0, "Failed to get array of timer objs: ret =3D > %d", > > + ret); > > + > > + for (i =3D 0; i < num_evtims; i++) { > > + *evtims[i] =3D init_tim; > > + evtims[i]->ev.event_ptr =3D evtims[i]; > > + } > > + > > + ret =3D rte_event_timer_adapter_stats_get(timdev, &stats); > > + TEST_ASSERT_EQUAL(ret, 0, "Failed to get stats"); > > + TEST_ASSERT_EQUAL((int)stats.ev_enq_count, 0, "Stats not clear at " > > + "startup"); > > + > > + /* Test with the max value for the adapter */ > > + ret =3D rte_event_timer_arm_burst(timdev, evtims, num_evtims); > > + TEST_ASSERT_EQUAL(ret, num_evtims, > > + "Failed to arm all event timers: attempted =3D %d, " > > + "succeeded =3D %d, rte_errno =3D %s", > > + num_evtims, ret, rte_strerror(rte_errno)); > > + > > + rte_delay_ms(1000); > > + > > +#define MAX_TRIES 1000 >=20 > Please make MAX_TRIES equivalent to num_evtims, here we are trying to > deq 10 events in burst and assume it to succeed but in case event dev > doesn't support burst mode event will be stuck as it will have only 1000 = tries > instead of 4096. Good catch again - I'll make these changes. =20 <...snipped...> > > +static int > > +adapter_create_max(void) > > +{ > > + int i; > > + uint32_t svc_start_count, svc_end_count; > > + struct rte_event_timer_adapter *adapters[ > > + > RTE_EVENT_TIMER_ADAPTER_NUM_MAX + 1]; > > + > > + struct rte_event_timer_adapter_conf conf =3D { > > + .event_dev_id =3D evdev, > > + // timer_adapter_id set in loop > > + .clk_src =3D RTE_EVENT_TIMER_ADAPTER_CPU_CLK, > > + .timer_tick_ns =3D NSECPERSEC / 10, > > + .max_tmo_ns =3D 180 * NSECPERSEC, > > + .nb_timers =3D MAX_TIMERS, > > + .flags =3D 0, > > + }; > > + > > + svc_start_count =3D rte_service_get_count(); > > + > > + /* This test expects that there are sufficient service IDs available > > + * to be allocated. I.e., RTE_EVENT_TIMER_ADAPTER_NUM_MAX > may need to > > + * be less than RTE_SERVICE_NUM_MAX if anything else uses a > service > > + * (the SW event device, for example). > > + */ > Same as above service use need to be dependent on INTERNAL_PORT > capability. >=20 > Also, in software event dev case this can be a valid test but in case of = a hw > event dev RTE_EVENT_TIMER_ADAPTER_NUM_MAX number of event > devicesmight not be binded to dpdk. Either we need to provide a API to > check how many event devices are supported or use > eventdev_timer_adapter_caps_get_t to get the number. >=20 > Thoughts? >=20 For now, I've modified the test case so that it returns ENOTSUP for the hw = case. But I like the idea of adding an API to query the count of devices. Thanks, Gabriel