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 C8441A034F; Fri, 26 Feb 2021 16:25:27 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 46ED2407FF; Fri, 26 Feb 2021 16:25:27 +0100 (CET) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id 69AA440692 for ; Fri, 26 Feb 2021 16:25:25 +0100 (CET) IronPort-SDR: FwiNzZayCI+mI+vYFbA5NM9c4VCze+CJ8EM5bOB+S6WwtZx0isvqzfSagykBHULog9INHyiA7/ LgTqf55dv8JA== X-IronPort-AV: E=McAfee;i="6000,8403,9907"; a="173549061" X-IronPort-AV: E=Sophos;i="5.81,208,1610438400"; d="scan'208";a="173549061" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Feb 2021 07:25:23 -0800 IronPort-SDR: mEk9t+50BzI/LrDg2LJPG90+faMJs5K9nj4CIDa/elybYNfyNXAHrXkxznD7ZLUvuKljZyiFLv YaIR665nUHpA== X-IronPort-AV: E=Sophos;i="5.81,208,1610438400"; d="scan'208";a="404941704" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.252.17.170]) ([10.252.17.170]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Feb 2021 07:25:22 -0800 To: Lijun Ou Cc: dev@dpdk.org, linuxarm@openeuler.org References: <1614130139-42926-1-git-send-email-oulijun@huawei.com> <1614130139-42926-5-git-send-email-oulijun@huawei.com> From: Ferruh Yigit X-User: ferruhy Message-ID: <1f327bef-f6e5-3f2d-d7f5-03eec6623eed@intel.com> Date: Fri, 26 Feb 2021 15:25:17 +0000 MIME-Version: 1.0 In-Reply-To: <1614130139-42926-5-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 04/13] net/hns3: add Rx and Tx bytes stats X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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 2/24/2021 1:28 AM, Lijun Ou wrote: > From: "Min Hu (Connor)" > > In current HNS3 PMD, Rx/Tx bytes from packet stats are not > implemented. > > This patch implemented Rx/Tx bytes using soft counters. > Rx/Tx bytes stats will be enabled if the macro > RTE_LIBRTE_HNS3_PMD_SOFT_COUNTERS is defined. > > Signed-off-by: Min Hu (Connor) > Signed-off-by: Lijun Ou > --- > drivers/net/hns3/hns3_rxtx.c | 24 ++++++++++++++++++++++++ > drivers/net/hns3/hns3_rxtx_vec_neon.h | 15 +++++++++++++++ > drivers/net/hns3/hns3_rxtx_vec_sve.c | 11 +++++++++++ > drivers/net/hns3/hns3_stats.c | 22 ++++++++++++++++++---- > 4 files changed, 68 insertions(+), 4 deletions(-) > > diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c > index 5e79177..a8bd2cc 100644 > --- a/drivers/net/hns3/hns3_rxtx.c > +++ b/drivers/net/hns3/hns3_rxtx.c > @@ -2181,6 +2181,10 @@ hns3_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) > cksum_err); > hns3_rxd_to_vlan_tci(rxq, rxm, l234_info, &rxd); > > +#ifdef RTE_LIBRTE_HNS3_PMD_SOFT_COUNTERS > + /* Increment bytes counter */ > + rxq->basic_stats.bytes += rxm->pkt_len; > +#endif Why statistics enabled only with macro? It is not common to use macro to enable the stats, what do you think to remove it, to be consistent with rest of the PMDs?