net/netvsc: support per-queue info requests

There is not a lot of info here from this driver.
But worth supporting these additional info queries.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
This commit is contained in:
Stephen Hemminger 2020-05-19 09:52:24 -07:00 committed by Ferruh Yigit
parent 83b4bf39ec
commit c7b82b14e3
3 changed files with 24 additions and 0 deletions

View File

@ -860,6 +860,8 @@ static const struct eth_dev_ops hn_eth_dev_ops = {
.dev_stop = hn_dev_stop, .dev_stop = hn_dev_stop,
.dev_close = hn_dev_close, .dev_close = hn_dev_close,
.dev_infos_get = hn_dev_info_get, .dev_infos_get = hn_dev_info_get,
.txq_info_get = hn_dev_tx_queue_info,
.rxq_info_get = hn_dev_rx_queue_info,
.dev_supported_ptypes_get = hn_vf_supported_ptypes, .dev_supported_ptypes_get = hn_vf_supported_ptypes,
.promiscuous_enable = hn_dev_promiscuous_enable, .promiscuous_enable = hn_dev_promiscuous_enable,
.promiscuous_disable = hn_dev_promiscuous_disable, .promiscuous_disable = hn_dev_promiscuous_disable,

View File

@ -319,6 +319,15 @@ hn_dev_tx_queue_setup(struct rte_eth_dev *dev,
return err; return err;
} }
void
hn_dev_tx_queue_info(struct rte_eth_dev *dev, uint16_t queue_id,
struct rte_eth_txq_info *qinfo)
{
struct hn_tx_queue *txq = dev->data->tx_queues[queue_id];
qinfo->nb_desc = txq->txdesc_pool->size;
qinfo->conf.offloads = dev->data->dev_conf.txmode.offloads;
}
static struct hn_txdesc *hn_txd_get(struct hn_tx_queue *txq) static struct hn_txdesc *hn_txd_get(struct hn_tx_queue *txq)
{ {
@ -859,6 +868,17 @@ struct hn_rx_queue *hn_rx_queue_alloc(struct hn_data *hv,
return rxq; return rxq;
} }
void
hn_dev_rx_queue_info(struct rte_eth_dev *dev, uint16_t queue_id,
struct rte_eth_rxq_info *qinfo)
{
struct hn_rx_queue *rxq = dev->data->rx_queues[queue_id];
qinfo->mp = rxq->mb_pool;
qinfo->nb_desc = rxq->rx_ring->size;
qinfo->conf.offloads = dev->data->dev_conf.rxmode.offloads;
}
int int
hn_dev_rx_queue_setup(struct rte_eth_dev *dev, hn_dev_rx_queue_setup(struct rte_eth_dev *dev,
uint16_t queue_idx, uint16_t nb_desc, uint16_t queue_idx, uint16_t nb_desc,

View File

@ -178,6 +178,8 @@ int hn_dev_rx_queue_setup(struct rte_eth_dev *dev,
unsigned int socket_id, unsigned int socket_id,
const struct rte_eth_rxconf *rx_conf, const struct rte_eth_rxconf *rx_conf,
struct rte_mempool *mp); struct rte_mempool *mp);
void hn_dev_rx_queue_info(struct rte_eth_dev *dev, uint16_t queue_id,
struct rte_eth_rxq_info *qinfo);
void hn_dev_rx_queue_release(void *arg); void hn_dev_rx_queue_release(void *arg);
void hn_dev_free_queues(struct rte_eth_dev *dev); void hn_dev_free_queues(struct rte_eth_dev *dev);