From: "WanRenyong" <wanry@yunsilicon.com>
To: "Stephen Hemminger" <stephen@networkplumber.org>
Cc: <dev@dpdk.org>, <ferruh.yigit@amd.com>, <thomas@monjalon.net>,
<qianr@yunsilicon.com>, <nana@yunsilicon.com>,
<zhangxx@yunsilicon.com>, <xudw@yunsilicon.com>,
<jacky@yunsilicon.com>, <weihg@yunsilicon.com>
Subject: Re: [PATCH v5 13/15] net/xsc: add basic stats ops
Date: Fri, 17 Jan 2025 10:03:41 +0800 [thread overview]
Message-ID: <0152ed61-0955-4d29-8480-57cf97597aa6@yunsilicon.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 2978 bytes --]
On 2025/1/17 1:58, Stephen Hemminger wrote:
>
On Tue, 07 Jan 2025 10:50:09 +0800
> "WanRenyong" <wanry@yunsilicon.com><wanry@yunsilicon.com> wrote:
>
>
>
Implement xsc ethdev basic statatics ops.
>
>
> Signed-off-by: WanRenyong <wanry@yunsilicon.com><wanry@yunsilicon.com>
> ---
> 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.
>
>
>
Yes, thanks for your reminder, I will add it next time.
>
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.
>
Agree with you, I will remove it next time.
>
--
Thanks,
WanRenyong
[-- Attachment #2: Type: text/html, Size: 10692 bytes --]
next reply other threads:[~2025-01-17 2:04 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-17 2:03 WanRenyong [this message]
-- strict thread matches above, loose matches on Subject: below --
2025-01-07 2:50 [PATCH v5 00/15] XSC PMD for Yunsilicon NICs WanRenyong
2025-01-07 2:50 ` [PATCH v5 13/15] net/xsc: add basic stats ops WanRenyong
2025-01-16 17:58 ` Stephen Hemminger
2025-01-17 2:00 ` WanRenyong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0152ed61-0955-4d29-8480-57cf97597aa6@yunsilicon.com \
--to=wanry@yunsilicon.com \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@amd.com \
--cc=jacky@yunsilicon.com \
--cc=nana@yunsilicon.com \
--cc=qianr@yunsilicon.com \
--cc=stephen@networkplumber.org \
--cc=thomas@monjalon.net \
--cc=weihg@yunsilicon.com \
--cc=xudw@yunsilicon.com \
--cc=zhangxx@yunsilicon.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).