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 D53ACA09F6; Thu, 17 Dec 2020 16:20:20 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 85D5FCA24; Thu, 17 Dec 2020 16:20:19 +0100 (CET) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id EFCE3CA1E for ; Thu, 17 Dec 2020 16:20:16 +0100 (CET) IronPort-SDR: Bj/gVx/O+9F/Pi7Vvo9lsoxSbuCgBlEEnBEQv7CuQkTGpa2lPwaw+1/DnoPtNwTTz9U+/DgU5O +H78V+QwS3Rw== X-IronPort-AV: E=McAfee;i="6000,8403,9837"; a="193662722" X-IronPort-AV: E=Sophos;i="5.78,428,1599548400"; d="scan'208";a="193662722" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Dec 2020 07:20:15 -0800 IronPort-SDR: oCXgHveQMfbHn8c201Oh7ona0K/ngzloUENvuvKkw3Vk9MBopdAkS1iH73rBIQrponPTFbIV4f YkAtUMlFyLGA== X-IronPort-AV: E=Sophos;i="5.78,428,1599548400"; d="scan'208";a="369871936" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.213.233.164]) ([10.213.233.164]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Dec 2020 07:20:14 -0800 To: Lijun Ou Cc: dev@dpdk.org, linuxarm@huawei.com References: <1607846585-2381-1-git-send-email-oulijun@huawei.com> <1607846585-2381-3-git-send-email-oulijun@huawei.com> From: Ferruh Yigit Message-ID: <397115ae-a4be-6025-41dc-5bda358013cf@intel.com> Date: Thu, 17 Dec 2020 15:20:10 +0000 MIME-Version: 1.0 In-Reply-To: <1607846585-2381-3-git-send-email-oulijun@huawei.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [PATCH 2/7] net/hns3: fix xstats statistics with id 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" On 12/13/2020 8:03 AM, Lijun Ou wrote: > From: Huisong Li > > Number of xstats item in rte_eth_xstats_get_by_id is obtained > by the eth_dev_get_xstats_count API, and the xstats_get_by_id > ops of the driver only needs to report the corresponding stats > item result. > However, a redundant code for reporting the number of stats items > in the hns3_dev_xstats_get_by_id API causes a problem. Namely, if > the ID range of the xstats stats item does not include the basic > stats item, the app can not obtain the corresponding xstats > statistics in hns3_dev_xstats_get_by_id. > > Fixes: 8839c5e202f3 ("net/hns3: support device stats") > Cc: stable@dpdk.org > > Signed-off-by: Huisong Li > Signed-off-by: Lijun Ou > --- > drivers/net/hns3/hns3_stats.c | 3 --- > 1 file changed, 3 deletions(-) > > diff --git a/drivers/net/hns3/hns3_stats.c b/drivers/net/hns3/hns3_stats.c > index 91168ac..b43143b 100644 > --- a/drivers/net/hns3/hns3_stats.c > +++ b/drivers/net/hns3/hns3_stats.c > @@ -933,9 +933,6 @@ hns3_dev_xstats_get_by_id(struct rte_eth_dev *dev, const uint64_t *ids, > uint32_t i; > int ret; > > - if (ids == NULL || size < cnt_stats) > - return cnt_stats; > - Hi Lijun, Above check seems wrong, but just removing it also wrong. Following checks should be there: ids==NULL && values==NULL ? return cnt_stats ids==NULL ? return all values Also 'hns3_dev_xstats_get_names_by_id()' seems wrong in that manner.