From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 52174A04B1; Mon, 7 Sep 2020 18:20:45 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 24E751C0D1; Mon, 7 Sep 2020 18:20:39 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 44D07255 for ; Mon, 7 Sep 2020 18:20:36 +0200 (CEST) IronPort-SDR: M1MHxSzaZM5vYwNJB02jaKCaixlmefBWJVdtIZAnCTxEgl4PjpyIh9NUChbtmMb4o9rTRDX0qD 8G1ghdvWIZ/A== X-IronPort-AV: E=McAfee;i="6000,8403,9737"; a="222229473" X-IronPort-AV: E=Sophos;i="5.76,402,1592895600"; d="scan'208";a="222229473" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Sep 2020 09:20:35 -0700 IronPort-SDR: 9MfnANViUJUxQGIY2z4zbJQYBEnn1fB8lQjUFyD3IoHbishrn4OoLZZDfixvL9lgIKrIwXQJUT +wJYa8A0KBnw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,402,1592895600"; d="scan'208";a="504076975" Received: from silpixa00399779.ir.intel.com (HELO silpixa00399779.ger.corp.intel.com) ([10.237.222.209]) by fmsmga006.fm.intel.com with ESMTP; 07 Sep 2020 09:20:34 -0700 From: Harry van Haaren To: dev@dpdk.org Cc: Harry van Haaren , jerinj@marvell.com Date: Mon, 7 Sep 2020 17:21:49 +0100 Message-Id: <20200907162149.31454-2-harry.van.haaren@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200907162149.31454-1-harry.van.haaren@intel.com> References: <20200907162149.31454-1-harry.van.haaren@intel.com> Subject: [dpdk-dev] [PATCH 2/2] event/sw: add useful work done attribute 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" This commit exposes if useful work is done to the service instance. The normal service_attr_get() API can be used to retrieve the value of the attribute. Signed-off-by: Harry van Haaren --- Cc: jerinj@marvell.com CC due to event/sw change, could be picked up by main tree as depends on 1/2? drivers/event/sw/sw_evdev_scheduler.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/event/sw/sw_evdev_scheduler.c b/drivers/event/sw/sw_evdev_scheduler.c index cff747da89..4e932612d5 100644 --- a/drivers/event/sw/sw_evdev_scheduler.c +++ b/drivers/event/sw/sw_evdev_scheduler.c @@ -5,6 +5,9 @@ #include #include #include + +#include + #include "sw_evdev.h" #include "iq_chunk.h" @@ -554,6 +557,10 @@ sw_event_schedule(struct rte_eventdev *dev) sw->sched_no_iq_enqueues += (in_pkts_total == 0); sw->sched_no_cq_enqueues += (out_pkts_total == 0); + uint64_t work_done = (in_pkts_total + out_pkts_total) != 0; + rte_service_component_attr_set(sw->service_id, + RTE_SERVICE_ATTR_USEFUL_WORK_LAST_ITER, work_done); + /* push all the internal buffered QEs in port->cq_ring to the * worker cores: aka, do the ring transfers batched. */ -- 2.17.1