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 CFFE4460A4; Thu, 16 Jan 2025 18:58:26 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7033440DDB; Thu, 16 Jan 2025 18:58:08 +0100 (CET) Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) by mails.dpdk.org (Postfix) with ESMTP id 5604C402D6 for ; Thu, 16 Jan 2025 18:58:07 +0100 (CET) Received: by mail-pl1-f175.google.com with SMTP id d9443c01a7336-216395e151bso18517775ad.0 for ; Thu, 16 Jan 2025 09:58:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1737050286; x=1737655086; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=4z6cK3V1P/u102BONLvcTDvKvfFEilXFvCUPLld1lKc=; b=PO7Pc15d0VcLyiNCLLNW074Ek9ED6pibM13heaHhUSBL1Cd1PIMq9DeC/k/eAxjMev 08wajxdCzuFE0uEpuJPrdqIqwKKMQKqpZs+8Jmc5yTdVm0+a1GNFcpbcRZsaxDRP0sgx LJn8hPTPDLQ2rU1/fijEhVP093h9dm08yO5q9C4oIrSl7Qg1N+u0u+PW/6SXuGIXuWEk ZdNBo2oXmh6+Zypv2N47Fcsgq9XHI1CGyeOa8qb12vQgJplWaleqhZneEcsiv6Ka8zw+ 0k31z9TdmqRvpv5ABkGx3bWQer0zSWE2eUPs4jEPrwjgoieDFkyIvAjD2Zlf3Y9OmBP+ BCZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737050286; x=1737655086; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4z6cK3V1P/u102BONLvcTDvKvfFEilXFvCUPLld1lKc=; b=JmZ1mChR1W/5yRaW5swFix9ODunKhScA+FiOtoP5Hufahp/fIsXJKNvTs8Cq2bTOxZ 8AIpoZktuBO9F+lHtRSZ7n02tsHayJprmF5Xzf6Hua91ogsxDERouwgjQP73jhnn59mB q9RWNod8+7n4fzOYUi0AlkPtVwjy8Ypx2RIXr4q6DNRhXX5rp+G7hhRv6g40xpfzmBEL Pq5xJadIXzk4ErZCMdJknuhsPlJCYd5DjKB1Or3u7c8FOiaHiuEbdZwkPQzc5KcILpUb TazUdToqpVwL1P5AttuXkNjwJdpE012Kh5ZobcIYBcD4up9UbaTjI4E0csElYnRxdCRJ vxqA== X-Gm-Message-State: AOJu0YwEMC1nL/7s19zyiwpGBJZD6yBnpPzuaWHZRLp1UfWKPQbGXHIo cyy5YSKbLmni4AWWSxURpU/mRgOiJzeenorYUuk7v4RVcUvFkc51C032nkIWrcWWytOjDayn2F0 yQj8= X-Gm-Gg: ASbGncvW3ReMqe8fYUBoErVwx6j0WL+QmejOrvts8PD7x1vylaiudulEfLrnehVPBJ4 xNFTny2OhPwmqM2E8kVUmr40mYMXnxe8W0uix1mlwmyNqWQfYtY/c25Jd0XqdxGlc8Sph2R1pab Z00kTSc34d3gJ73c2gnCVlASYvKBnirk1g7+OnX5eGZu76AZQ27PypZxHpU2N5CoitR9TI9ycsp EufHJNcxmi1gSgyIWm6zTmmbg7YtdVWn82QwSeMbzyVAwZ6a2vra3IAa9qZBFmJiU8eaGrbyby8 KBaR6ohyoz9oF1D/xmwrqwsT+0CbQW4wng== X-Google-Smtp-Source: AGHT+IEHB25PmkE9Rp4EZN25HoVGyR/rn5a7P511qipWyz9vntICpfgALXbLKPLHVW+9c45DSUIRGA== X-Received: by 2002:a17:903:238e:b0:216:311e:b1c4 with SMTP id d9443c01a7336-21bf029e049mr104652525ad.4.1737050286392; Thu, 16 Jan 2025 09:58:06 -0800 (PST) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-a9bcc32027dsm339291a12.21.2025.01.16.09.58.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Jan 2025 09:58:06 -0800 (PST) Date: Thu, 16 Jan 2025 09:58:04 -0800 From: Stephen Hemminger To: "WanRenyong" Cc: , , , , , , , , Subject: Re: [PATCH v5 13/15] net/xsc: add basic stats ops Message-ID: <20250116095804.100e1e37@hermes.local> In-Reply-To: <20250107025008.1962467-14-wanry@yunsilicon.com> References: <20250107024939.1962467-1-wanry@yunsilicon.com> <20250107025008.1962467-14-wanry@yunsilicon.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 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 = Y > L4 checksum offload = Y > Inner L3 checksum = Y > Inner L4 checksum = Y > +Basic stats = Y > Linux = Y > ARMv8 = Y > x86-64 = 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_errors. Statistics only supplied for first ``RTE_ETHDEV_QUEUE_STAT_CNTRS`` (16) queues. > 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; > } > > +static int > +xsc_ethdev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats) > +{ > + struct xsc_ethdev_priv *priv = TO_XSC_ETHDEV_PRIV(dev); > + uint32_t rxqs_n = priv->num_rq; > + uint32_t txqs_n = priv->num_sq; > + uint32_t i, idx; > + struct xsc_rxq_data *rxq; > + struct xsc_txq_data *txq; > + > + for (i = 0; i < rxqs_n; ++i) { > + rxq = xsc_rxq_get(priv, i); > + if (unlikely(rxq == NULL)) > + continue; > + > + idx = rxq->idx; > + if (idx < RTE_ETHDEV_QUEUE_STAT_CNTRS) { > + stats->q_ipackets[idx] += rxq->stats.rx_pkts; > + stats->q_ibytes[idx] += rxq->stats.rx_bytes; > + stats->q_errors[idx] += (rxq->stats.rx_errors + > + rxq->stats.rx_nombuf); Paren not needed here, but ok.