[v2] net/mlx5: fix link speed calculation on Windows
Checks
Commit Message
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: 6fbd73709ee4be32 ("net/mlx5: support link update on Windows")
Cc: stable@dpdk.org
Signed-off-by: Tal Shnaiderman <talshn@nvidia.com>
---
v2: fix commit message [Thomas]
---
drivers/net/mlx5/windows/mlx5_ethdev_os.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
From: Tal Shnaiderman
> 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: 6fbd73709ee4be32 ("net/mlx5: support link update on Windows")
> Cc: stable@dpdk.org
>
> Signed-off-by: Tal Shnaiderman <talshn@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
Hi,
> -----Original Message-----
> From: Tal Shnaiderman <talshn@nvidia.com>
> Sent: Tuesday, April 6, 2021 10:32 AM
> To: dev@dpdk.org
> Cc: NBU-Contact-Thomas Monjalon <thomas@monjalon.net>; Matan Azrad
> <matan@nvidia.com>; Raslan Darawsheh <rasland@nvidia.com>; Ophir
> Munk <ophirmu@nvidia.com>; stable@dpdk.org
> Subject: [PATCH v2] 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: 6fbd73709ee4be32 ("net/mlx5: support link update on Windows")
> Cc: stable@dpdk.org
>
> Signed-off-by: Tal Shnaiderman <talshn@nvidia.com>
> ---
> v2: fix commit message [Thomas]
> ---
Patch applied to next-net-mlx,
Kindest regards,
Raslan Darawsheh
@@ -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;