DPDK usage discussions
 help / color / mirror / Atom feed
* Reading stats from XDP based device with number of queues > 16
@ 2023-11-21 12:10 Pavel Vazharov
  0 siblings, 0 replies; only message in thread
From: Pavel Vazharov @ 2023-11-21 12:10 UTC (permalink / raw)
  To: users

[-- 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 --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-11-21 12:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-21 12:10 Reading stats from XDP based device with number of queues > 16 Pavel Vazharov

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).