From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 756581B1DC for ; Thu, 11 Jan 2018 01:21:43 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Jan 2018 16:21:43 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,342,1511856000"; d="scan'208";a="192627464" Received: from txasoft-yocto.an.intel.com (HELO txasoft-yocto.an.intel.com.) ([10.123.72.111]) by orsmga005.jf.intel.com with ESMTP; 10 Jan 2018 16:21:42 -0800 From: Erik Gabriel Carrillo To: pbhagavatula@caviumnetworks.com Cc: dev@dpdk.org, jerin.jacob@caviumnetworks.com, nipun.gupta@nxp.com, hemant.agrawal@nxp.com Date: Wed, 10 Jan 2018 18:21:05 -0600 Message-Id: <1515630074-29020-15-git-send-email-erik.g.carrillo@intel.com> X-Mailer: git-send-email 1.7.10 In-Reply-To: <1515630074-29020-1-git-send-email-erik.g.carrillo@intel.com> References: <1512158458-22661-1-git-send-email-erik.g.carrillo@intel.com> <1515630074-29020-1-git-send-email-erik.g.carrillo@intel.com> Subject: [dpdk-dev] [PATCH v6 14/23] eventtimer: add event timer initializer function 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: Thu, 11 Jan 2018 00:21:44 -0000 Add a function that can be used to initialize event timers so that they are in a known state before being used for arm or cancel operations. Signed-off-by: Erik Gabriel Carrillo --- lib/librte_eventdev/rte_event_timer_adapter.c | 8 ++++++++ lib/librte_eventdev/rte_event_timer_adapter.h | 11 +++++++++++ lib/librte_eventdev/rte_eventdev_version.map | 1 + 3 files changed, 20 insertions(+) diff --git a/lib/librte_eventdev/rte_event_timer_adapter.c b/lib/librte_eventdev/rte_event_timer_adapter.c index 0266ad5..8bd9ebc 100644 --- a/lib/librte_eventdev/rte_event_timer_adapter.c +++ b/lib/librte_eventdev/rte_event_timer_adapter.c @@ -396,6 +396,14 @@ rte_event_timer_adapter_service_id_get(struct rte_event_timer_adapter *adapter, return -ESRCH; } +void +rte_event_timer_init(struct rte_event_timer *evtim) +{ + evtim->ev.op = RTE_EVENT_OP_NEW; + evtim->ev.event_type = RTE_EVENT_TYPE_TIMER; + evtim->state = RTE_EVENT_TIMER_NOT_ARMED; +} + int rte_event_timer_arm_burst(const struct rte_event_timer_adapter *adapter, struct rte_event_timer **evtims, diff --git a/lib/librte_eventdev/rte_event_timer_adapter.h b/lib/librte_eventdev/rte_event_timer_adapter.h index bbbe7b9..3488488 100644 --- a/lib/librte_eventdev/rte_event_timer_adapter.h +++ b/lib/librte_eventdev/rte_event_timer_adapter.h @@ -484,6 +484,17 @@ struct rte_event_timer { * @warning * @b EXPERIMENTAL: this API may change without prior notice * + * Set an event timer's initial state and initialize the event it carries. + * + * @param evtim + * A pointer to an event timer structure. + */ +void rte_event_timer_init(struct rte_event_timer *evtim); + +/** + * @warning + * @b EXPERIMENTAL: this API may change without prior notice + * * Arm a burst of event timers with separate expiration timeout tick for each * event timer. * diff --git a/lib/librte_eventdev/rte_eventdev_version.map b/lib/librte_eventdev/rte_eventdev_version.map index a35a668..c4bc946 100644 --- a/lib/librte_eventdev/rte_eventdev_version.map +++ b/lib/librte_eventdev/rte_eventdev_version.map @@ -78,6 +78,7 @@ DPDK_18.02 { rte_event_timer_adapter_service_id_get; rte_event_timer_adapter_start; rte_event_timer_adapter_stop; + rte_event_timer_init; rte_event_timer_arm_burst; rte_event_timer_arm_tmo_tick_burst; rte_event_timer_cancel_burst; -- 2.6.4