From: "Yang, Qiming" Subject: Re: [PATCH v2] test: add delay time in test alarm Date: Tue, 16 May 2017 03:15:09 +0000 Message-ID: References: <1490076224-26964-1-git-send-email-qiming.yang@intel.com> <1493950673-15953-1-git-send-email-qiming.yang@intel.com> <4341B239C0EFF9468EE453F9E9F4604D3C6448ED@shsmsx102.ccr.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Cc: "Wu, Jingjing" To: "Chen, Jing D" , "dev@dpdk.org" Return-path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 01F10234 for ; Tue, 16 May 2017 05:15:13 +0200 (CEST) In-Reply-To: <4341B239C0EFF9468EE453F9E9F4604D3C6448ED@shsmsx102.ccr.corp.intel.com> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi, > -----Original Message----- > From: Chen, Jing D > Sent: Friday, May 5, 2017 2:29 PM > To: Yang, Qiming ; dev@dpdk.org > Cc: Wu, Jingjing > Subject: RE: [PATCH v2] test: add delay time in test alarm >=20 > Hi, >=20 > > diff --git a/test/test/test_alarm.c b/test/test/test_alarm.c index > > ecb2f6d..cbae1a0 100644 > > --- a/test/test/test_alarm.c > > +++ b/test/test/test_alarm.c > > @@ -96,6 +96,7 @@ static int > > test_multi_alarms(void) > > { > > int rm_count =3D 0; > > + int count =3D 0; > > cb_count.cnt =3D 0; > > > > printf("Expect 6 callbacks in order...\n"); @@ -169,7 +170,10 @@ > > test_multi_alarms(void) > > printf("Error, cancelling head-of-list leads to premature > > callback\n"); > > return -1; > > } > > - rte_delay_ms(10); > > + > > + while (flag !=3D 2 && count++ < 6) > > + rte_delay_ms(10); The count can be replaced with macro, but the delay 10 ms is based on the a= larm time set before. rte_eal_alarm_set(10 * US_PER_MS, test_remove_in_callback, (void *)1); > > + > > if (flag !=3D 2) { > > printf("Error - expected callback not called\n"); > > rte_eal_alarm_cancel(test_remove_in_callback, (void *)-1); > @@ > > -212,7 +216,7 @@ test_alarm(void) > > printf("fail to set alarm callback\n"); > > return -1; > > } > > - while (flag =3D=3D 0 && count ++ < 6) > > + while (flag =3D=3D 0 && count++ < 20) > > rte_delay_ms(RTE_TEST_CHECK_PERIOD); > > >=20 > What's the criteria to delay 20* RTE_TEST_CHECK_PERIOD ms? Add more > comments? >=20 > > if (flag =3D=3D 0){ > > -- > > 2.7.4 >=20 > Overall comment is to replace numeric with macro.