From patchwork Fri Nov 2 02:53:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Honggang LI X-Patchwork-Id: 10664895 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8779B13B5 for ; Fri, 2 Nov 2018 02:53:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 663792B8EC for ; Fri, 2 Nov 2018 02:53:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 55F442BD5B; Fri, 2 Nov 2018 02:53:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 603522B8EC for ; Fri, 2 Nov 2018 02:53:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726218AbeKBL7C (ORCPT ); Fri, 2 Nov 2018 07:59:02 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38592 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725999AbeKBL7B (ORCPT ); Fri, 2 Nov 2018 07:59:01 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2CD543086254; Fri, 2 Nov 2018 02:53:31 +0000 (UTC) Received: from lhg.nay.redhat.com (unknown [10.66.129.124]) by smtp.corp.redhat.com (Postfix) with ESMTP id C46125D6A6; Fri, 2 Nov 2018 02:53:29 +0000 (UTC) From: Honggang LI To: hal@dev.mellanox.co.il Cc: linux-rdma@vger.kernel.org, Honggang Li Subject: [PATCH 2/2] complib/cl_event_wheel.c minor update for the sample test program Date: Fri, 2 Nov 2018 10:53:21 +0800 Message-Id: <20181102025321.25429-2-honli@redhat.com> In-Reply-To: <20181102025321.25429-1-honli@redhat.com> References: <20181102025321.25429-1-honli@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Fri, 02 Nov 2018 02:53:31 +0000 (UTC) Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Honggang Li Signed-off-by: Honggang Li --- complib/cl_event_wheel.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/complib/cl_event_wheel.c b/complib/cl_event_wheel.c index 27443f66..21e1f4ee 100644 --- a/complib/cl_event_wheel.c +++ b/complib/cl_event_wheel.c @@ -457,6 +457,7 @@ uint32_t cl_event_wheel_num_regs(IN cl_event_wheel_t * const p_event_wheel, } #ifdef __CL_EVENT_WHEEL_TEST__ +#include /* sleep() */ /* Dump out the complete state of the event wheel */ void __cl_event_wheel_dump(IN cl_event_wheel_t * const p_event_wheel) @@ -511,14 +512,10 @@ static uint64_t __test_event_aging(uint64_t key, uint32_t num_regs, void *contex int main() { cl_event_wheel_t event_wheel; - /* uint64_t key; */ /* init complib */ complib_init(); - /* construct */ - cl_event_wheel_construct(&event_wheel); - /* init */ cl_event_wheel_init(&event_wheel); @@ -534,7 +531,7 @@ int main() "The Second Aging Event"); cl_event_wheel_reg(&event_wheel, 3, /* key */ - cl_get_time_stamp() + 3500000, /* 3 sec lifetime */ + cl_get_time_stamp() + 3500000, /* 3.5 sec lifetime */ __test_event_aging, /* cb */ "The Third Aging Event"); @@ -542,7 +539,7 @@ int main() sleep(2); cl_event_wheel_reg(&event_wheel, 2, /* key */ - cl_get_time_stamp() + 8000000, /* 3 sec lifetime */ + cl_get_time_stamp() + 8000000, /* 8 sec lifetime */ __test_event_aging, /* cb */ "The Second Aging Event Moved");