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 61C7D459E8; Sat, 21 Sep 2024 09:22:13 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 45217402C0; Sat, 21 Sep 2024 09:22:08 +0200 (CEST) Received: from lf-2-32.ptr.blmpb.com (lf-2-32.ptr.blmpb.com [101.36.218.32]) by mails.dpdk.org (Postfix) with ESMTP id 638A240041 for ; Sat, 21 Sep 2024 09:22:04 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=feishu2403070942; d=yunsilicon.com; t=1726903319; h=from:subject: mime-version:from:date:message-id:subject:to:cc:reply-to:content-type: mime-version:in-reply-to:message-id; bh=AaFBcxY6RrSL4BHsgqOdoUQppjVeeaFoUjA2lbPyCVA=; b=Mt2p3rcLzcUQBRLdZwdK+53MaJIfVr+Ecn48xCsGvTZZZDD07VbocFd6zbONmEKuBOqzen FGnPzMPnR6B1p24sukujbdRe7aGrmH08qjfKn6m9OQFT06iEcnfofd5bm1ctWYKDvNIrh/ IJM+pgbXUI7I2GKEX4NFwea8W9MHNFtRHA0Hp8cSK6aHgwUY/p/Iv3DFnWon/P35iqTZPO JPCVHli5zXFMJDWB0DhlvZ0nL+m7OzASFA1ezE5FauaZo0Z/G8KV2x0jGZ7w73lM9rvuzP hc/nVolE9IE3t/gCCsXGzc5ZsoLSQuWFo4Rfp070IGDfMsBvsVFnhPnM+jCivg== Date: Sat, 21 Sep 2024 15:21:36 +0800 Message-Id: References: <20240918060936.1231758-20-wanry@yunsilicon.com> <20240919120539.04e41a87@hermes.local> Content-Transfer-Encoding: 7bit X-Original-From: WanRenyong To: "Stephen Hemminger" Cc: , Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Lms-Return-Path: From: "WanRenyong" Subject: Re: [PATCH v3 19/19] net/xsc: add dev basic stats ops User-Agent: Mozilla Thunderbird In-Reply-To: <20240919120539.04e41a87@hermes.local> Received: from [127.0.0.1] ([114.93.15.93]) by smtp.feishu.cn with ESMTPS; Sat, 21 Sep 2024 15:21:58 +0800 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 On 2024/9/20 3:05, Stephen Hemminger wrote: > On Wed, 18 Sep 2024 14:09:36 +0800 > "WanRenyong" wrote: > >> @@ -166,6 +169,7 @@ xsc_rx_burst(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t pkts_n) >> /* Fill wqe */ >> wqe->va = rte_cpu_to_le_64(rte_pktmbuf_iova(rep)); >> rte_pktmbuf_data_len(seg) = len; >> + rxq->stats.rx_bytes += rte_pktmbuf_pkt_len(pkt); >> >> *(pkts++) = pkt; >> pkt = NULL; >> @@ -200,6 +204,7 @@ xsc_rx_burst(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t pkts_n) >> rxq->nb_rx_hold = 0; >> } >> >> + rxq->stats.rx_pkts += nb_pkts; >> return nb_pkts; >> } > You can a small performance boost by keeping a total_bytes counter in rx_burst function > and only add it to rx_bytes after the loop. Hello, Stephen, Thanks for review. This a good suggestion, I'll take it. -- Thanks, WanRenyong