>>>How about looping on min(nb_tx, RTE_ETHDEV_QUEUE_STAT_CNTRS) ? This would lead to incomplete tx_total (and other total) stats. Maybe I could just add commentary, why it is written like this and leave it be?
On Mon, Mar 4, 2019 at 1:48 PM David Marchand <david.march...@redhat.com> wrote: > On Mon, Mar 4, 2019 at 1:35 PM David Marchand <david.march...@redhat.com> > wrote: > >> >> >> On Mon, Mar 4, 2019 at 1:30 PM Rastislav Černay <cer...@netcope.com> >> wrote: >> >>> >>> What is the point of adding when i >= RTE_ETHDEV_QUEUE_STAT_CNTRS ? >>> >>> struct rte_eth_stats { >>> ... >>> uint64_t q_opackets[RTE_ETHDEV_QUEUE_STAT_CNTRS] >>> ... >>> } >>> >>> As there can be more queues (nb_tx) then RTE_ETHDEV_QUEUE_STAT_CNTRS >>> (16) and struct rte_eth_stats eth_stats is allocated statically, >>> there is need to check so it does not write garbage somewhere. >>> >> >> How about looping on min(nb_tx, RTE_ETHDEV_QUEUE_STAT_CNTRS) ? >> > > Or add the tx_queue[i].tx_xxx; to the associated global stats and only > fills q_xxx depending on the check. > > > -- > David Marchand >