From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E01C9C43460 for ; Mon, 5 Apr 2021 16:19:13 +0000 (UTC) Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by mail.kernel.org (Postfix) with ESMTP id 72D07613AF for ; Mon, 5 Apr 2021 16:19:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 72D07613AF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nvidia.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dev-bounces@dpdk.org Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4D0C14068C; Mon, 5 Apr 2021 18:19:12 +0200 (CEST) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by mails.dpdk.org (Postfix) with ESMTP id E30C34014E for ; Mon, 5 Apr 2021 18:19:09 +0200 (CEST) Received: from Internal Mail-Server by MTLPINE1 (envelope-from talshn@nvidia.com) with SMTP; 5 Apr 2021 19:19:05 +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 135GJ5G2026006; Mon, 5 Apr 2021 19:19:05 +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: Mon, 5 Apr 2021 19:18:44 +0300 Message-Id: <20210405161844.9560-1-talshn@nvidia.com> X-Mailer: git-send-email 2.16.1.windows.4 Subject: [dpdk-dev] [PATCH] net/mlx5/windows: fix link speed calculation 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 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") Cc: stable@dpdk.org Signed-off-by: Tal Shnaiderman --- 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