[dpdk-dev] [PATCH] net/mlx5/windows: fix link speed calculation

Tal Shnaiderman talshn at nvidia.com
Mon Apr 5 18:18:44 CEST 2021


In Windows DevX returns the value of the current link speed
in bps rate, the conversion to the Mbps rate expected by DPDK
is incorrect and fixed.

Fixes: 6fbd73709ee4be32 ("net/mlx5: support link update on Windows")
Cc: stable at dpdk.org

Signed-off-by: Tal Shnaiderman <talshn at nvidia.com>
---
 drivers/net/mlx5/windows/mlx5_ethdev_os.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/windows/mlx5_ethdev_os.c b/drivers/net/mlx5/windows/mlx5_ethdev_os.c
index 8609d38eca..c709dd19be 100644
--- a/drivers/net/mlx5/windows/mlx5_ethdev_os.c
+++ b/drivers/net/mlx5/windows/mlx5_ethdev_os.c
@@ -254,7 +254,7 @@ mlx5_link_update(struct rte_eth_dev *dev, int wait_to_complete)
 	}
 	priv = dev->data->dev_private;
 	context_obj = (mlx5_context_st *)priv->sh->ctx;
-	dev_link.link_speed = context_obj->mlx5_dev.link_speed / (1024 * 1024);
+	dev_link.link_speed = context_obj->mlx5_dev.link_speed / (1000 * 1000);
 	dev_link.link_status =
 	      (context_obj->mlx5_dev.link_state == 1 && !mlx5_is_removed(dev))
 	      ? 1 : 0;
-- 
2.16.1.windows.4



More information about the dev mailing list