DPDK patches and discussions
 help / color / mirror / Atom feed
From: Rushil Gupta <rushilg@google.com>
To: Ferruh Yigit <ferruh.yigit@amd.com>
Cc: junfeng.guo@intel.com, jeroendb@google.com, joshwash@google.com,
	 dev@dpdk.org
Subject: Re: [PATCH] net/gve: Enable stats reporting for GQ format
Date: Tue, 16 Jan 2024 11:48:07 +0530	[thread overview]
Message-ID: <CANzqiF7z4O++1q5E4bbqVA7VmiD-g0q03pJ0AsPn=gPzNvUd5g@mail.gmail.com> (raw)
In-Reply-To: <9a9e3d4c-f0f1-4192-bd92-1b4a7a2c9c20@amd.com>

[-- Attachment #1: Type: text/plain, Size: 2370 bytes --]

On Fri, Jan 12, 2024 at 8:36 PM Ferruh Yigit <ferruh.yigit@amd.com> wrote:

> On 12/22/2023 3:39 PM, Rushil Gupta wrote:
> > Read from shared region to retrieve imissed statistics for GQ from
> device.
> > Tested using `show port xstats <port-id>` in interactive mode.
> > This metric can be triggered by using queues > cores.
> >
>
> Looks good but please check following comments:
>
> Checkpatch gives warning on the patch title, and this patch adds
> 'imissed' support so it can be added to the patch title, something like:
> "net/gve: enable imissed stats for GQ format"
>
> <...>
>
> > +static int gve_alloc_stats_report(struct gve_priv *priv,
> > +             uint16_t nb_tx_queues, uint16_t nb_rx_queues)
> > +{
> > +     char z_name[RTE_MEMZONE_NAMESIZE];
> > +     int tx_stats_cnt;
> > +     int rx_stats_cnt;
> > +
> > +     tx_stats_cnt = (GVE_TX_STATS_REPORT_NUM + NIC_TX_STATS_REPORT_NUM)
> *
> > +             nb_tx_queues;
> > +     rx_stats_cnt = (GVE_RX_STATS_REPORT_NUM + NIC_RX_STATS_REPORT_NUM)
> *
> > +             nb_rx_queues;
> > +     priv->stats_report_len = sizeof(struct gve_stats_report) +
> > +             sizeof(struct stats) * (tx_stats_cnt + rx_stats_cnt);
> > +
> > +     snprintf(z_name, sizeof(z_name), "stats_report_%s", priv->pci_dev->
> device.name);
> >
>
> Can you please add 'gve_' prefix to the memzone name, to prevent any
> possible collision.
>
Done.

>
> <...>
>
> > +static void gve_free_stats_report(struct rte_eth_dev *dev)
> > +{
> > +     struct gve_priv *priv = dev->data->dev_private;
> > +     rte_memzone_free(priv->stats_report_mem);
> >
>
> What will happen if user asks stats/xstats after port stopped?
>
Good catch. I have added a null check so that the driver doesn't try to
read stats from memory region that doesn't exist.

>
> <...>
>
> >  gve_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
> >  {
> >       uint16_t i;
> > +     if (gve_is_gqi(dev->data->dev_private))
> > +             gve_get_imissed_from_nic(dev);
> >
>
> This updates imissed in RxQ struct for all queues for basic stats, but
> what if user only calls xstats, I guess in that case stat won't be updated.
>

Yes; that is expected. Since imissed is a member of rte_eth_stats; calling
gve_dev_stats_get is the right way to get this stat.

[-- Attachment #2: Type: text/html, Size: 3409 bytes --]

  reply	other threads:[~2024-01-16  6:18 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-22 15:39 Rushil Gupta
2024-01-12 15:06 ` Ferruh Yigit
2024-01-16  6:18   ` Rushil Gupta [this message]
2024-01-17  7:06     ` Joshua Washington
2024-01-17  9:40     ` Ferruh Yigit
2024-01-19 13:37       ` Rushil Gupta
2024-01-16  6:43 ` [v2] net/gve: enable imissed stats " Rushil Gupta
2024-01-19 14:26 ` [v3] " Rushil Gupta
2024-01-19 15:25   ` Ferruh Yigit
2024-01-19 16:30     ` Rushil Gupta
2024-01-19 17:09 ` [v4] " Rushil Gupta
2024-01-22 10:56   ` Ferruh Yigit
  -- strict thread matches above, loose matches on Subject: below --
2023-12-22 15:30 [PATCH] net/gve: Enable stats reporting " Rushil Gupta
2023-12-22 15:23 Rushil Gupta
2023-12-22 15:05 Rushil Gupta
2023-12-19  2:16 Rushil Gupta
2023-12-20  2:51 ` Guo, Junfeng
2023-12-19  2:13 Rushil Gupta

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='CANzqiF7z4O++1q5E4bbqVA7VmiD-g0q03pJ0AsPn=gPzNvUd5g@mail.gmail.com' \
    --to=rushilg@google.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@amd.com \
    --cc=jeroendb@google.com \
    --cc=joshwash@google.com \
    --cc=junfeng.guo@intel.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).