From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 8C0BE4292B for ; Wed, 12 Apr 2023 21:56:47 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 827F84111C; Wed, 12 Apr 2023 21:56:47 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mails.dpdk.org (Postfix) with ESMTP id DF86B406A2; Wed, 12 Apr 2023 21:56:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1681329405; x=1712865405; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=bANFZnxZrdhdvNvDRLCU2gFVVkrmVbUM4qNWbvGvnI4=; b=c/QfWrQp7XliCp0gPo6NuvOUxCHUmuk2zFV64Tc/ilHR+RiTNWFLFPI4 n6tYFprpq2arJKi0VX0U+xmAPyAfC1WZclgXe9W5a+zBdWZpmNaJnL4i9 QdVsPPzaWuekisGr51R4rpeKFqbIOZxlgFJYxCi5H0bWas4mL/AyH00lG eLCA+2iY8yQAqrg2hDzvN0cQBT9W44/nLqfC1wuBnhCvK+tMgLOzaEVB1 1ZCZKy8cfW1S27mIzUVbKPSvCloWK5XoRLN+nvSPgCGEbPWuCKdgVXT49 5TrEtRK4KzWudWt9PCbTKHWWmuZ8FD6NJ4YsPhXi4O7y8pbur1by/TEhA A==; X-IronPort-AV: E=McAfee;i="6600,9927,10678"; a="430294691" X-IronPort-AV: E=Sophos;i="5.98,339,1673942400"; d="scan'208";a="430294691" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Apr 2023 12:56:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10678"; a="832800713" X-IronPort-AV: E=Sophos;i="5.98,339,1673942400"; d="scan'208";a="832800713" Received: from txandevlnx321.an.intel.com ([10.123.117.43]) by fmsmga001.fm.intel.com with ESMTP; 12 Apr 2023 12:56:44 -0700 From: Erik Gabriel Carrillo To: jerinj@marvell.com Cc: dev@dpdk.org, stable@dpdk.org Subject: [PATCH] eventdev/timer: move buffer flush call Date: Wed, 12 Apr 2023 14:56:37 -0500 Message-Id: <20230412195637.450033-1-erik.g.carrillo@intel.com> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org The SW event timer adapter attempts to flush its event buffer on every adapter tick. If events remain in the buffer after the attempt, another attempt to flush won't occur until the next adapter tick, which delays the enqueue of those events to the event device unecessarily. Move the buffer flush call so that it happens with every invocation of the service function, rather than on every adapter tick, to avoid the delay. Fixes: cc7b73ea9e3b ("eventdev: add new software timer adapter") Cc: stable@dpdk.org Signed-off-by: Erik Gabriel Carrillo --- lib/eventdev/rte_event_timer_adapter.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/lib/eventdev/rte_event_timer_adapter.c b/lib/eventdev/rte_event_timer_adapter.c index 23eb1d4a7d..427c4c6287 100644 --- a/lib/eventdev/rte_event_timer_adapter.c +++ b/lib/eventdev/rte_event_timer_adapter.c @@ -855,17 +855,18 @@ swtim_service_func(void *arg) sw->n_expired_timers); sw->n_expired_timers = 0; - event_buffer_flush(&sw->buffer, - adapter->data->event_dev_id, - adapter->data->event_port_id, - &nb_evs_flushed, - &nb_evs_invalid); - - sw->stats.ev_enq_count += nb_evs_flushed; - sw->stats.ev_inv_count += nb_evs_invalid; sw->stats.adapter_tick_count++; } + event_buffer_flush(&sw->buffer, + adapter->data->event_dev_id, + adapter->data->event_port_id, + &nb_evs_flushed, + &nb_evs_invalid); + + sw->stats.ev_enq_count += nb_evs_flushed; + sw->stats.ev_inv_count += nb_evs_invalid; + rte_event_maintain(adapter->data->event_dev_id, adapter->data->event_port_id, 0); -- 2.23.0