Reading stats from XDP based device with number of queues > 16

Pavel Vazharov freakpv at gmail.com
Tue Nov 21 13:10:41 CET 2023


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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mails.dpdk.org/archives/users/attachments/20231121/e38cac25/attachment.htm>


More information about the users mailing list