From: Ivan Ilchenko Date: Wed, 15 Sep 2021 12:23:27 +0000 (+0300) Subject: net/virtio: report Tx descriptor limits in dev info X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=492a239cbfe35573d25341f18fb8169f7c07f25b;p=dpdk.git net/virtio: report Tx descriptor limits in dev info Report max/min/align Tx descriptors limits in device info get callback. Before calling the callback, rte_eth_dev_info_get() provides default values of nb_min as zero and nb_max as UINT16_MAX that are not correct for the driver, so one can't rely on them. Signed-off-by: Ivan Ilchenko Signed-off-by: Andrew Rybchenko Reviewed-by: Maxime Coquelin --- diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c index 3e3b42eaf6..a32c0c3a58 100644 --- a/drivers/net/virtio/virtio_ethdev.c +++ b/drivers/net/virtio/virtio_ethdev.c @@ -2582,6 +2582,7 @@ virtio_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) * The Queue Size value does not have to be a power of 2. */ dev_info->rx_desc_lim.nb_max = UINT16_MAX; + dev_info->tx_desc_lim.nb_max = UINT16_MAX; } else { /* * According to 2.6 Split Virtqueues: @@ -2589,6 +2590,7 @@ virtio_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) * Size value is 32768. */ dev_info->rx_desc_lim.nb_max = 32768; + dev_info->tx_desc_lim.nb_max = 32768; } /* * Actual minimum is not the same for virtqueues of different kinds, @@ -2597,7 +2599,9 @@ virtio_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) */ dev_info->rx_desc_lim.nb_min = RTE_MAX(DEFAULT_RX_FREE_THRESH, RTE_VIRTIO_VPMD_RX_REARM_THRESH); + dev_info->tx_desc_lim.nb_min = DEFAULT_TX_FREE_THRESH; dev_info->rx_desc_lim.nb_align = 1; + dev_info->tx_desc_lim.nb_align = 1; return 0; }