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 4312E1B210 for ; Thu, 11 Jan 2018 01:21:45 +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:44 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,342,1511856000"; d="scan'208";a="192627472" 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:44 -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:08 -0600 Message-Id: <1515630074-29020-18-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 17/23] eventtimer: add support for single-producer put mode 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:45 -0000 Add support for the RTE_EVENT_TIMER_ADAPTER_F_SP_PUT flag, which indicates that the API should be used in single-producer put mode. Signed-off-by: Erik Gabriel Carrillo --- lib/librte_eventdev/rte_event_timer_adapter.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/librte_eventdev/rte_event_timer_adapter.c b/lib/librte_eventdev/rte_event_timer_adapter.c index ebc6124..0af68b2 100644 --- a/lib/librte_eventdev/rte_event_timer_adapter.c +++ b/lib/librte_eventdev/rte_event_timer_adapter.c @@ -798,6 +798,7 @@ sw_event_timer_adapter_init(struct rte_event_timer_adapter *adapter) int ret; struct rte_event_timer_adapter_sw_data *sw_data; uint64_t nb_timers; + unsigned int flags; struct rte_service_spec service; static bool timer_subsystem_inited; // static initialized to false @@ -823,8 +824,11 @@ sw_event_timer_adapter_init(struct rte_event_timer_adapter *adapter) char msg_ring_name[RTE_RING_NAMESIZE]; snprintf(msg_ring_name, RTE_RING_NAMESIZE, "sw_evtim_adap_msg_ring_%"PRIu8, adapter->data->id); + flags = adapter->data->conf.flags & RTE_EVENT_TIMER_ADAPTER_F_SP_PUT ? + RING_F_SP_ENQ | RING_F_SC_DEQ : + RING_F_SC_DEQ; sw_data->msg_ring = rte_ring_create(msg_ring_name, nb_timers, - adapter->data->socket_id, 0); + adapter->data->socket_id, flags); if (sw_data->msg_ring == NULL) { rte_errno = ENOMEM; return -1; @@ -833,10 +837,13 @@ sw_event_timer_adapter_init(struct rte_event_timer_adapter *adapter) char pool_name[RTE_RING_NAMESIZE]; snprintf(pool_name, RTE_RING_NAMESIZE, "sw_evtim_adap_msg_pool_%"PRIu8, adapter->data->id); + flags = (adapter->data->conf.flags & RTE_EVENT_TIMER_ADAPTER_F_SP_PUT) ? + MEMPOOL_F_SP_PUT | MEMPOOL_F_SC_GET : + MEMPOOL_F_SC_GET; sw_data->msg_pool = rte_mempool_create(pool_name, nb_timers, sizeof(struct msg), 32, 0, NULL, NULL, NULL, NULL, - adapter->data->socket_id, 0); + adapter->data->socket_id, flags); if (sw_data->msg_pool == NULL) { rte_errno = ENOMEM; return -1; @@ -847,7 +854,7 @@ sw_event_timer_adapter_init(struct rte_event_timer_adapter *adapter) sw_data->tim_pool = rte_mempool_create(pool_name, nb_timers, sizeof(struct rte_timer), 32, 0, NULL, NULL, NULL, NULL, - adapter->data->socket_id, 0); + adapter->data->socket_id, flags); if (sw_data->tim_pool == NULL) { printf("Could not allocate tim mempool\n"); return -1; -- 2.6.4