Skip to contentSkip to conversation

net/mlx5/windows: fix link speed calculation

PATCH Superseded Tal Shnaiderman 4 participants 6 messages Apr 5, 2021 – Apr 8, 2021 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/mlx5/windows: fix link speed calculation

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")
---
 drivers/net/mlx5/windows/mlx5_ethdev_os.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/mlx5/windows/mlx5_ethdev_os.c +1 -1
index 8609d38eca..c709dd19be 100644
@@ -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;
Signature · 1 line
2.16.1.windows.4
#1 lore raw

There is no previous commit with net/mlx5/windows as title prefix. In general, there is "on Windows" at the end of the title. This way we can have the same formatting when fixing the common code for a Windows case.

05/04/2021 18:18, Tal Shnaiderman:

Quoted 3 lines

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.

"was" incorrect.

I think you should explain the confusion between Mbit/s and Mibit/s.

Quoted 2 lines
drivers/net/mlx5/windows/mlx5_ethdev_os.c +1 -1
-	dev_link.link_speed = context_obj->mlx5_dev.link_speed / (1024 * 1024);
+	dev_link.link_speed = context_obj->mlx5_dev.link_speed / (1000 * 1000);
#2 lore raw
Quoted 10 lines

Subject: Re: [PATCH] net/mlx5/windows: fix link speed calculation

External email: Use caution opening links or attachments

There is no previous commit with net/mlx5/windows as title prefix. In general, there is "on Windows" at the end of the title. This way we can have the same formatting when fixing the common code for a Windows case.

Quoted 14 lines

05/04/2021 18:18, Tal Shnaiderman:

Quoted 3 lines

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.

"was" incorrect.

I think you should explain the confusion between Mbit/s and Mibit/s.

Quoted 3 lines
(quoted diff) +2 -1
-     dev_link.link_speed = context_obj->mlx5_dev.link_speed / (1024 * 1024);
+     dev_link.link_speed = context_obj->mlx5_dev.link_speed / (1000 *
+ 1000);

Thanks Thomas for the review, will address the comments in v2.

#3 lore raw

PATCH v2 1/1 net/mlx5: fix link speed calculation on Windows

In reply to 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")

---
v2: fix commit message [Thomas]

---
 drivers/net/mlx5/windows/mlx5_ethdev_os.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/mlx5/windows/mlx5_ethdev_os.c +1 -1
index 8609d38eca..c709dd19be 100644
@@ -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;
Signature · 1 line
2.16.1.windows.4
Acked-by on v2 1/1
#4 lore raw

Re: [dpdk-dev] [PATCH v2] net/mlx5: fix link speed calculation on Windows

From: Tal Shnaiderman

Quoted 8 lines

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")
#5 lore raw

Re: [dpdk-dev] [PATCH v2] net/mlx5: fix link speed calculation on Windows

In reply to Tal Shnaiderman

Hi,

Quoted 13 lines

-----Original Message-----
From: Tal Shnaiderman <[email protected]>
Sent: Tuesday, April 6, 2021 10:32 AM
To: [email protected]
Cc: NBU-Contact-Thomas Monjalon <[email protected]>; Matan Azrad <[email protected]>; Raslan Darawsheh <[email protected]>; Ophir Munk <[email protected]>; [email protected]
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.

Quoted 7 lines
Fixes 6fbd73709ee4be32 ("net/mlx5: support link update on Windows")

---
v2: fix commit message [Thomas]
---

Patch applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh