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 4049BA0561; Wed, 3 Mar 2021 14:28:33 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2BF8440696; Wed, 3 Mar 2021 14:28:33 +0100 (CET) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id B925F40684 for ; Wed, 3 Mar 2021 14:28:31 +0100 (CET) IronPort-SDR: 2wRi7AQIe0OZ+SHYFi2ivczYS9SLtuEIHKQ822aoot0PkG9V8qL66cB0mUyTFxLfhgMS9RwBL7 p15mFQi1k4eg== X-IronPort-AV: E=McAfee;i="6000,8403,9911"; a="248596174" X-IronPort-AV: E=Sophos;i="5.81,220,1610438400"; d="scan'208";a="248596174" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Mar 2021 05:28:30 -0800 IronPort-SDR: Zp0xyse02nBn4Pb9ODyeaRL3bgX7atnugnEfboZn3H4jV4cuPXTrJ3u0hxlhlDGFOlD5y8ffO4 RaL+AfpgJE3Q== X-IronPort-AV: E=Sophos;i="5.81,220,1610438400"; d="scan'208";a="445247502" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.213.219.174]) ([10.213.219.174]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Mar 2021 05:28:27 -0800 To: Lijun Ou Cc: dev@dpdk.org, linuxarm@openeuler.org References: <1614130139-42926-1-git-send-email-oulijun@huawei.com> <1614693534-27620-1-git-send-email-oulijun@huawei.com> <1614693534-27620-5-git-send-email-oulijun@huawei.com> From: Ferruh Yigit X-User: ferruhy Message-ID: <09496901-e85a-5070-aa62-b91f0d2d4586@intel.com> Date: Wed, 3 Mar 2021 13:28:25 +0000 MIME-Version: 1.0 In-Reply-To: <1614693534-27620-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 V2 04/14] 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 3/2/2021 1:58 PM, 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 copy/paste from previous version: 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?