From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id E672E1B2F3 for ; Tue, 10 Oct 2017 17:47:34 +0200 (CEST) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga105.jf.intel.com with ESMTP; 10 Oct 2017 08:47:33 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.43,505,1503385200"; d="scan'208";a="137108228" Received: from silpixa00398672.ir.intel.com ([10.237.223.128]) by orsmga004.jf.intel.com with ESMTP; 10 Oct 2017 08:47:31 -0700 From: Harry van Haaren To: dev@dpdk.org Cc: jerin.jacob@caviumnetworks.com, Harry van Haaren , bruce.richardson@intel.com Date: Tue, 10 Oct 2017 16:47:57 +0100 Message-Id: <1507650477-74678-1-git-send-email-harry.van.haaren@intel.com> X-Mailer: git-send-email 2.7.4 Subject: [dpdk-dev] [PATCH] event/sw: fix get of single xstat value 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: Tue, 10 Oct 2017 15:47:35 -0000 This commit allows the xstats_get() API to return just a single value based on its ID. Previously, the "ret_n_lt_stats" value set to 1 ensured a check to take place that the array was larger than the available xstats. The xstats_get() API allows retriving of individual stats - hence this check should be removed - by setting "ret_n_lt_stats" to zero. Fixes: c1ad03df7ad5 ("event/sw: support xstats") Cc: bruce.richardson@intel.com Signed-off-by: Harry van Haaren --- drivers/event/sw/sw_evdev_xstats.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/event/sw/sw_evdev_xstats.c b/drivers/event/sw/sw_evdev_xstats.c index 8cb6d88..61a5c33 100644 --- a/drivers/event/sw/sw_evdev_xstats.c +++ b/drivers/event/sw/sw_evdev_xstats.c @@ -538,7 +538,7 @@ sw_xstats_get(const struct rte_eventdev *dev, { struct sw_evdev *sw = sw_pmd_priv(dev); const uint32_t reset = 0; - const uint32_t ret_n_lt_stats = 1; + const uint32_t ret_n_lt_stats = 0; return sw_xstats_update(sw, mode, queue_port_id, ids, values, n, reset, ret_n_lt_stats); } -- 2.7.4