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 01F10234 for ; Tue, 16 May 2017 05:15:13 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga104.jf.intel.com with ESMTP; 15 May 2017 20:15:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.38,347,1491289200"; d="scan'208";a="1169642810" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga002.fm.intel.com with ESMTP; 15 May 2017 20:15:12 -0700 Received: from fmsmsx126.amr.corp.intel.com (10.18.125.43) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 15 May 2017 20:15:11 -0700 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by FMSMSX126.amr.corp.intel.com (10.18.125.43) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 15 May 2017 20:15:11 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.193]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.217]) with mapi id 14.03.0319.002; Tue, 16 May 2017 11:15:09 +0800 From: "Yang, Qiming" To: "Chen, Jing D" , "dev@dpdk.org" CC: "Wu, Jingjing" Thread-Topic: [PATCH v2] test: add delay time in test alarm Thread-Index: AQHSxUc3cDGp6/qfVE6pDDCztEW09KHkwRMAgBGXn+A= 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> In-Reply-To: <4341B239C0EFF9468EE453F9E9F4604D3C6448ED@shsmsx102.ccr.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNWI1ZjhmNmItODkxOS00MjE4LWE2NTEtZDIyYjIzYjFlMWU1IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6Ilh4NHUzdWpFK3lmVkVCUHRMd1NcLzhYZHhQYkhzM00rYVwvSGV6Z2VWdzRxcz0ifQ== x-ctpclassification: CTP_IC dlp-product: dlpe-windows dlp-version: 10.0.102.7 dlp-reaction: no-action x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v2] test: add delay time in test alarm 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: Tue, 16 May 2017 03:15:14 -0000 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.