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 B54EFA055D; Wed, 3 Mar 2021 15:24:48 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 48EBF40683; Wed, 3 Mar 2021 15:24:48 +0100 (CET) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id C2D184067B for ; Wed, 3 Mar 2021 15:24:46 +0100 (CET) IronPort-SDR: YUiB3EVY0wyPfOdWZtkAtMxP0JlK1QR5yfjLxGnADAUrZqcrwvRkjwRjQQ8/rzXDhH5tbVc2vx FwY5d67GvOjg== X-IronPort-AV: E=McAfee;i="6000,8403,9912"; a="167099402" X-IronPort-AV: E=Sophos;i="5.81,220,1610438400"; d="scan'208";a="167099402" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Mar 2021 06:24:45 -0800 IronPort-SDR: JN+QBacFrUj0TY9oThmIEXT4kIcBE5GywK7FiypGn2vxeIWa07eSOMKwmpS1gGv4O7AkhGdppl VtIkO4z8X6eg== X-IronPort-AV: E=Sophos;i="5.81,220,1610438400"; d="scan'208";a="445287191" 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 06:24:44 -0800 To: oulijun , linuxarm@openeuler.org, dev 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> <09496901-e85a-5070-aa62-b91f0d2d4586@intel.com> <1b7a1a3d-0763-5af3-de9f-8b67919c964f@huawei.com> From: Ferruh Yigit X-User: ferruhy Message-ID: Date: Wed, 3 Mar 2021 14:24:40 +0000 MIME-Version: 1.0 In-Reply-To: <1b7a1a3d-0763-5af3-de9f-8b67919c964f@huawei.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [Linuxarm] Re: [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/3/2021 2:08 PM, oulijun wrote: > > > 在 2021/3/3 21:28, Ferruh Yigit 写道: >> 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? > I'm sorry. I thought it was a success. >  Firstly, the macro is used to control the statistics to ensure performance and > facilitate flexible usage. For example, the macro needs to be disabled when high > performance is required. > secondly the byte statistics of other vendors are implemented by reading and > writing registers. Therefore, macros are not used.By the way, the MLX driver has > a precedent (code snippets can be intercepted here). It is not convenient for a user re-compile the DPDK to be able to get the ethdev byte statistics, stats are not developer/debug information, end user may need them. And this recompilation may not be an option for the distributed software. How much performance affect it has if you enable it always? And just to double check, isn't there a way to get this information from HW without calculating it in the driver? The compile time flags, specially after meson switch, hard to enable and a little hidden, it is very easy to have broken code there, that is why it better to prevent compile time flags as much as possible.