From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (unknown [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 803E3460AA; Fri, 17 Jan 2025 03:01:01 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 19ADE410DF; Fri, 17 Jan 2025 03:00:43 +0100 (CET) Received: from lf-1-18.ptr.blmpb.com (lf-1-18.ptr.blmpb.com [103.149.242.18]) by mails.dpdk.org (Postfix) with ESMTP id A4F7D4027A for ; Fri, 17 Jan 2025 03:00:40 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=feishu2403070942; d=yunsilicon.com; t=1737079233; h=from:subject: mime-version:from:date:message-id:subject:to:cc:reply-to:content-type: mime-version:in-reply-to:message-id; bh=IB6NR1ut3k3lpoUzzDKn7gMTEI1Kvqt6eYUxs31YsLs=; b=bnWwTEAfV/3jzBRCozKQDO3hG9KBO3aX+bKKwjiA2aeCyaJacRGrpV5DxiRZMjA2m7ZMMX u6N6wavVXmOGyIUMerKsSPzz+qwyLzJ4+aeKI9dyAWwsgJez3GcDYrGG3R7L/YskUEuV9F wldMat6r6E7heRqk7EfFFhUGQ3pdpccYpe3+CGT5NyjG1bwe/pk0E5oj4U8F212++/AVdT 1hzYO2K8kZJbDATZfnW3pNzKtXEMnJoB4HWVCwAEv0RVTPNJBAkQW4CsAVX881rxbo+8sG ZodYVzUN7F6DTNxBF66vs1R/60acOLSFcacF7FLRl1UXgqSCxxmLO2Gn58LMaQ== Cc: , , , , , , , , Received: from [127.0.0.1] ([218.1.137.133]) by smtp.feishu.cn with ESMTPS; Fri, 17 Jan 2025 10:00:29 +0800 User-Agent: Mozilla Thunderbird From: "WanRenyong" Mime-Version: 1.0 Message-Id: X-Original-From: WanRenyong Content-Type: text/plain; charset=UTF-8 In-Reply-To: <20250116095804.100e1e37@hermes.local> To: "Stephen Hemminger" Date: Fri, 17 Jan 2025 10:00:27 +0800 Content-Transfer-Encoding: quoted-printable References: <20250107024939.1962467-1-wanry@yunsilicon.com> <20250107025008.1962467-14-wanry@yunsilicon.com> <20250116095804.100e1e37@hermes.local> Subject: Re: [PATCH v5 13/15] net/xsc: add basic stats ops X-Lms-Return-Path: 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 2025/1/17 1:58, Stephen Hemminger wrote: > On Tue, 07 Jan 2025 10:50:09 +0800 > "WanRenyong" wrote: > >> Implement xsc ethdev basic statatics ops. >> >> Signed-off-by: WanRenyong >> --- >> doc/guides/nics/features/xsc.ini | 1 + >> drivers/net/xsc/xsc_ethdev.c | 75 ++++++++++++++++++++++++++++++++ >> 2 files changed, 76 insertions(+) >> >> diff --git a/doc/guides/nics/features/xsc.ini b/doc/guides/nics/features= /xsc.ini >> index 772c6418c4..eb88517104 100644 >> --- a/doc/guides/nics/features/xsc.ini >> +++ b/doc/guides/nics/features/xsc.ini >> @@ -11,6 +11,7 @@ L3 checksum offload =3D Y >> L4 checksum offload =3D Y >> Inner L3 checksum =3D Y >> Inner L4 checksum =3D Y >> +Basic stats =3D Y >> Linux =3D Y >> ARMv8 =3D Y >> x86-64 =3D Y > The driver is also doing per-queue stats. > Mind of I just add that here as well. > > The definition of what that means was updated to be: > > Stats per queue > --------------- > > Supports per queue stats: q_ipackets, q_opackets, q_ibytes, q_obytes, q_e= rrors. > Statistics only supplied for first ``RTE_ETHDEV_QUEUE_STAT_CNTRS`` (16) q= ueues. > Yes=EF=BC=8Cthanks for your reminder, I will add it next. >> diff --git a/drivers/net/xsc/xsc_ethdev.c b/drivers/net/xsc/xsc_ethdev.c >> index 9cfb07b023..000e27222d 100644 >> --- a/drivers/net/xsc/xsc_ethdev.c >> +++ b/drivers/net/xsc/xsc_ethdev.c >> @@ -444,6 +444,79 @@ xsc_ethdev_tx_queue_setup(struct rte_eth_dev *dev, = uint16_t idx, uint16_t desc, >> return 0; >> } >> =20 >> +static int >> +xsc_ethdev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *sta= ts) >> +{ >> + struct xsc_ethdev_priv *priv =3D TO_XSC_ETHDEV_PRIV(dev); >> + uint32_t rxqs_n =3D priv->num_rq; >> + uint32_t txqs_n =3D priv->num_sq; >> + uint32_t i, idx; >> + struct xsc_rxq_data *rxq; >> + struct xsc_txq_data *txq; >> + >> + for (i =3D 0; i < rxqs_n; ++i) { >> + rxq =3D xsc_rxq_get(priv, i); >> + if (unlikely(rxq =3D=3D NULL)) >> + continue; >> + >> + idx =3D rxq->idx; >> + if (idx < RTE_ETHDEV_QUEUE_STAT_CNTRS) { >> + stats->q_ipackets[idx] +=3D rxq->stats.rx_pkts; >> + stats->q_ibytes[idx] +=3D rxq->stats.rx_bytes; >> + stats->q_errors[idx] +=3D (rxq->stats.rx_errors + >> + rxq->stats.rx_nombuf); > Paren not needed here, but ok. OK, agree with you, I will remove them next. --=20 Thanks, WanRenyong