From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 13BCCA0A02; Tue, 6 Apr 2021 09:32:23 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 51CEC140F3F; Tue, 6 Apr 2021 09:32:22 +0200 (CEST) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by mails.dpdk.org (Postfix) with ESMTP id 498DF140F3C for ; Tue, 6 Apr 2021 09:32:21 +0200 (CEST) Received: from Internal Mail-Server by MTLPINE1 (envelope-from talshn@nvidia.com) with SMTP; 6 Apr 2021 10:32:15 +0300 Received: from nvidia.com (l-wincomp04-vm.mtl.labs.mlnx [10.237.1.5]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 1367WFW4021633; Tue, 6 Apr 2021 10:32:15 +0300 From: Tal Shnaiderman To: dev@dpdk.org Cc: thomas@monjalon.net, matan@nvidia.com, rasland@nvidia.com, ophirmu@nvidia.com, stable@dpdk.org Date: Tue, 6 Apr 2021 10:31:59 +0300 Message-Id: <20210406073159.3912-1-talshn@nvidia.com> X-Mailer: git-send-email 2.16.1.windows.4 In-Reply-To: <20210405161844.9560-1-talshn@nvidia.com> References: <20210405161844.9560-1-talshn@nvidia.com> Subject: [dpdk-dev] [PATCH v2] net/mlx5: fix link speed calculation on Windows X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 --- v2: fix commit message [Thomas] --- 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