From: Tal Shnaiderman Date: Tue, 6 Apr 2021 07:31:59 +0000 (+0300) Subject: net/mlx5: fix link speed calculation on Windows X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=d5003573ac8e27c159f16fef38c8734a7d366aba;p=dpdk.git net/mlx5: fix link speed calculation on Windows In Windows DevX returns the rate of the current link speed in bit/s, this rate was converted to Mibit/s instead of the Mbit/s rate expected by DPDK resulting in wrong link speed reporting. Fixes: 6fbd73709ee4 ("net/mlx5: support link update on Windows") Cc: stable@dpdk.org Signed-off-by: Tal Shnaiderman Acked-by: Matan Azrad --- 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;