<div dir="ltr"><div><div><div><div><div><div><div>Hi there,<br><br></div>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`.<br></div>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).<br></div><br>So, I was wondering if the same should be done in drivers/net/af_xdp/rte_eth_af_xdp.c?<br><br></div>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).<br>    rte_eth_stats stats;                                                     <br>    rte_eth_stats_get(port_id, &stats);<br><br></div>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?<br><br></div>Thanks,<br></div>Pavel.</div>