diff mbox series

[v2] net/mlx5: fix link speed calculation on Windows

Message ID 20210406073159.3912-1-talshn@nvidia.com (mailing list archive)
State Accepted
Delegated to: Raslan Darawsheh
Headers show
Series [v2] net/mlx5: fix link speed calculation on Windows | expand

Checks

Context Check Description
ci/intel-Testing success Testing PASS
ci/github-robot success github build: passed
ci/travis-robot warning travis build: errored
ci/iol-testing success Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/Intel-compilation success Compilation OK
ci/checkpatch success coding style OK

Commit Message

Tal Shnaiderman April 6, 2021, 7:31 a.m. UTC
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

Matan Azrad April 6, 2021, 7:46 a.m. UTC | #1
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>
Raslan Darawsheh April 8, 2021, 10:59 a.m. UTC | #2
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
diff mbox series

Patch

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;