diff mbox series

net/virtio: report max/min/align Tx desc limits in dev info

Message ID 20210915122328.3873898-1-andrew.rybchenko@oktetlabs.ru (mailing list archive)
State Accepted
Delegated to: Maxime Coquelin
Headers show
Series net/virtio: report max/min/align Tx desc limits in dev info | expand

Checks

Context Check Description
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/intel-Testing fail Testing issues
ci/Intel-compilation success Compilation OK
ci/iol-x86_64-unit-testing success Testing PASS
ci/checkpatch success coding style OK

Commit Message

Andrew Rybchenko Sept. 15, 2021, 12:23 p.m. UTC
From: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>

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 <ivan.ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
---
 drivers/net/virtio/virtio_ethdev.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Maxime Coquelin Sept. 15, 2021, 3:48 p.m. UTC | #1
On 9/15/21 2:23 PM, Andrew Rybchenko wrote:
> From: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
> 
> 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 <ivan.ilchenko@oktetlabs.ru>
> Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
> ---
>  drivers/net/virtio/virtio_ethdev.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 

Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

Thanks,
Maxime
Maxime Coquelin Sept. 28, 2021, 3:34 p.m. UTC | #2
On 9/15/21 14:23, Andrew Rybchenko wrote:
> From: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
> 
> 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 <ivan.ilchenko@oktetlabs.ru>
> Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
> ---
>   drivers/net/virtio/virtio_ethdev.c | 4 ++++
>   1 file changed, 4 insertions(+)

Applied to dpdk-next-virtio/main.

Thanks,
Maxime
diff mbox series

Patch

diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index 6c7d9bf58d..be5e4c0011 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -2579,6 +2579,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:
@@ -2586,6 +2587,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,
@@ -2594,7 +2596,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;
 }