DPDK usage discussions
 help / color / mirror / Atom feed
From: Pavel Vazharov <freakpv@gmail.com>
To: users <users@dpdk.org>
Subject: Reading stats from XDP based device with number of queues > 16
Date: Tue, 21 Nov 2023 14:10:41 +0200	[thread overview]
Message-ID: <CAK9EM191LKy8FsXR-CZTh1pF4SP62NBj5wDngevmUwD8GD=PzA@mail.gmail.com> (raw)

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

Hi there,

Currently the `eth_stats_get` function in the
drivers/net/af_xdp/rte_eth_af_xdp.c loops to `dev->data->nb_rx_queues`.
This can cause silent stack/heap overflow if the
`RTE_ETHDEV_QUEUE_STAT_CNTRS` is smaller than `dev->data->nb_rx_queues`.
The `eth_kni_stats_get` from drivers/net/kni/rte_eth_kni.c deals with this
case looping to RTE_MIN(dev->data->nb_rx_queues,
RTE_ETHDEV_QUEUE_STAT_CNTRS).

So, I was wondering if the same should be done in
drivers/net/af_xdp/rte_eth_af_xdp.c?

Disclaimer, I just spent some time debugging stack overflow due to such a
call for an XDP based device with 48 queues but RTE_ETHDEV_QUEUE_STAT_CNTRS
is 16 (seems by default).
    rte_eth_stats stats;

    rte_eth_stats_get(port_id, &stats);

I'm also unable to find a meson option for controlling the
RTE_ETHDEV_QUEUE_STAT_CNTRS define. I suppose, if one needs a bigger number
it should modify it directly in config/rte_config.h before building?

Thanks,
Pavel.

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

                 reply	other threads:[~2023-11-21 12:10 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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='CAK9EM191LKy8FsXR-CZTh1pF4SP62NBj5wDngevmUwD8GD=PzA@mail.gmail.com' \
    --to=freakpv@gmail.com \
    --cc=users@dpdk.org \
    /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).