17/03/2021 12:30, oulijun: > 2021/3/12 19:21, Thomas Monjalon: > > 12/03/2021 11:29, oulijun: > >> 2021/3/10 15:59, Thomas Monjalon: > >>> 10/03/2021 02:48, oulijun: > >>>> Can we add an API such as rte_eth_get_device(pord_id) > >>>> > >>>> for example: > >>>> struct rte_eth_dev * > >>>> rte_eth_get_device(uint16_t port_id) > >>>> { > >>>> return &rte_eth_devices[port_id]; > >>>> } > >>> An application is not supposed to access the struct rte_eth_dev. > >>> Which info do you need from this struct? > >> > >> Applications cannot directly access the global variable > >> rte_eth_devices[]. To obtain information about rte_eth_dev, they need to > >> access the global variable through APIs instead of directly. > > > > That's not the question. > > Which device info do you need, which is not already provided by > > one of the function rte_eth_*info* ? > > rte_eth_dev_get_dcb_info > > rte_eth_dev_get_reg_info > > rte_eth_dev_info_get > > rte_eth_rx_queue_info_get > > rte_eth_tx_queue_info_get > > rte_eth_dev_get_module_info > > > Hi, Thomas > I think dev->data->nb_tx_queues can be obtained through > rte_eth_info_get, but dev->data->tx_queue_state[queue_id] has nowhere to > be obtained. I think a patch needs to be added to obtain > tx_queue_state[queue_id] through rte_eth_tx_queue_info_get. What do you > think?
Yes it looks OK to add more queue info in rte_eth_*x_queue_info_get.