From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 84FD02882 for ; Fri, 14 Jul 2017 07:51:50 +0200 (CEST) Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga105.jf.intel.com with ESMTP; 13 Jul 2017 22:51:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.40,357,1496127600"; d="scan'208";a="125013657" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga005.jf.intel.com with ESMTP; 13 Jul 2017 22:51:48 -0700 Received: from fmsmsx117.amr.corp.intel.com (10.18.116.17) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 13 Jul 2017 22:51:48 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by fmsmsx117.amr.corp.intel.com (10.18.116.17) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 13 Jul 2017 22:51:48 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.197]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.94]) with mapi id 14.03.0319.002; Fri, 14 Jul 2017 13:51:45 +0800 From: "Yang, Qiming" To: "thomas@monjalon.net" , "dev@dpdk.org" CC: "Chen, Jing D" Thread-Topic: [PATCH v3] test: add delay time in test alarm Thread-Index: AQHS6XZB/fMTNKZ5D0as25P7hXgcbqJGCqyAgAHV4FCAByOKgIAD8z2g Date: Fri, 14 Jul 2017 05:51:44 +0000 Message-ID: References: <1493950673-15953-1-git-send-email-qiming.yang@intel.com> <1497929051-48912-1-git-send-email-qiming.yang@intel.com> <4341B239C0EFF9468EE453F9E9F4604D3C678919@shsmsx102.ccr.corp.intel.com> <4341B239C0EFF9468EE453F9E9F4604D3C67D3CA@shsmsx102.ccr.corp.intel.com> In-Reply-To: <4341B239C0EFF9468EE453F9E9F4604D3C67D3CA@shsmsx102.ccr.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: 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: [dpdk-dev] FW: [PATCH v3] 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: Fri, 14 Jul 2017 05:51:51 -0000 Hi, Thomas Can this patch be applied? Qiming > -----Original Message----- > From: Chen, Jing D > Sent: Wednesday, July 12, 2017 9:31 AM > To: Yang, Qiming ; dev@dpdk.org > Cc: Wu, Jingjing > Subject: RE: [PATCH v3] test: add delay time in test alarm >=20 >=20 > > > > > > -----Original Message----- > > > From: Yang, Qiming > > > Sent: Tuesday, June 20, 2017 11:24 AM > > > To: dev@dpdk.org > > > Cc: Chen, Jing D ; Wu, Jingjing > > > ; Yang, Qiming > > > Subject: [PATCH v3] test: add delay time in test alarm > > > > > > Because accuracy of timing to the microsecond is not guaranteed in > > > rte_eal_alarm_set, this function will not be called before the > > > requested time, but may be called a period of time afterwards which > > > can not be calculated. In order to ensure test alarm running > > > success, this patch added the delay time before check the flag. > > > > > > Signed-off-by: Qiming Yang > > > --- > > > v2 changes: > > > * fixed coding style problems > > > v3 changes: > > > * replaced the numeric by macro > > > --- > > > --- > > > test/test/test_alarm.c | 9 +++++++-- > > > 1 file changed, 7 insertions(+), 2 deletions(-) > > > > > > diff --git a/test/test/test_alarm.c b/test/test/test_alarm.c index > > > ecb2f6d..40f55b5 100644 > > > --- a/test/test/test_alarm.c > > > +++ b/test/test/test_alarm.c > > > @@ -47,6 +47,7 @@ > > > > > > #define RTE_TEST_ALARM_TIMEOUT 10 /* ms */ > > > #define RTE_TEST_CHECK_PERIOD 3 /* ms */ > > > +#define RTE_TEST_MAX_REPEAT 20 > > > > > > static volatile int flag; > > > > > > @@ -96,6 +97,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 +171,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++ < RTE_TEST_MAX_REPEAT) > > > + rte_delay_ms(10); > > > + > > > if (flag !=3D 2) { > > > printf("Error - expected callback not called\n"); > > > rte_eal_alarm_cancel(test_remove_in_callback, (void *)-1); > > @@ > > > -212,7 +217,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++ < RTE_TEST_MAX_REPEAT) > > > rte_delay_ms(RTE_TEST_CHECK_PERIOD); > > > > > > if (flag =3D=3D 0){ > > > -- > > > 2.7.4 >=20 > Acked-by : Jing Chen