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 69312A055D; Wed, 3 Mar 2021 15:08:08 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DEA5540683; Wed, 3 Mar 2021 15:08:07 +0100 (CET) Received: from szxga07-in.huawei.com (szxga07-in.huawei.com [45.249.212.35]) by mails.dpdk.org (Postfix) with ESMTP id EB2CF4067B for ; Wed, 3 Mar 2021 15:08:06 +0100 (CET) Received: from DGGEMS404-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4DrG4t2K0jz7s9W; Wed, 3 Mar 2021 22:06:22 +0800 (CST) Received: from [10.78.49.194] (10.78.49.194) by DGGEMS404-HUB.china.huawei.com (10.3.19.204) with Microsoft SMTP Server id 14.3.498.0; Wed, 3 Mar 2021 22:08:02 +0800 To: , Ferruh Yigit , 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> From: oulijun Message-ID: <1b7a1a3d-0763-5af3-de9f-8b67919c964f@huawei.com> Date: Wed, 3 Mar 2021 22:08:02 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0 MIME-Version: 1.0 In-Reply-To: <09496901-e85a-5070-aa62-b91f0d2d4586@intel.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.78.49.194] X-CFilter-Loop: Reflected 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" 在 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). > _______________________________________________ > Linuxarm mailing list -- linuxarm@openeuler.org > To unsubscribe send an email to linuxarm-leave@openeuler.org