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 7DC2DA04C7; Mon, 14 Sep 2020 16:36:28 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D03EF1C10F; Mon, 14 Sep 2020 16:36:23 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 1F2C31C0D2 for ; Mon, 14 Sep 2020 16:36:20 +0200 (CEST) IronPort-SDR: mCFnExa6sHuqyxb7pZbT+tlvPzLPgFFVmxRvs8EPmqB/TIkwJaBKnfOJnAqd40Ok0ZCqrIvvnd ZwViykcOaJGA== X-IronPort-AV: E=McAfee;i="6000,8403,9744"; a="223269467" X-IronPort-AV: E=Sophos;i="5.76,426,1592895600"; d="scan'208";a="223269467" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Sep 2020 07:36:17 -0700 IronPort-SDR: ffIWtG9z5wopn1KLV3r3vI9EHqtnqFt67SS4HweeJH58OzDs01DrspAzhmZ4BV8XLmZw2RjXjC urAvcO1whK3Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,426,1592895600"; d="scan'208";a="301770393" Received: from silpixa00399779.ir.intel.com (HELO silpixa00399779.ger.corp.intel.com) ([10.237.222.209]) by orsmga003.jf.intel.com with ESMTP; 14 Sep 2020 07:36:16 -0700 From: Harry van Haaren To: dev@dpdk.org Cc: david.marchand@dpdk.org, Harry van Haaren Date: Mon, 14 Sep 2020 15:37:32 +0100 Message-Id: <20200914143732.87907-2-harry.van.haaren@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200914143732.87907-1-harry.van.haaren@intel.com> References: <20200907162149.31454-1-harry.van.haaren@intel.com> <20200914143732.87907-1-harry.van.haaren@intel.com> Subject: [dpdk-dev] [PATCH v2 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 --- 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