From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6A2ADA04C7; Tue, 15 Sep 2020 21:08:36 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E672E1C132; Tue, 15 Sep 2020 21:07:57 +0200 (CEST) Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by dpdk.org (Postfix) with ESMTP id D52161C131 for ; Tue, 15 Sep 2020 21:07:55 +0200 (CEST) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20200915190755euoutp02ceeefb6694e594e0209416008de4bc78~1CpSF0trR0661006610euoutp02f; Tue, 15 Sep 2020 19:07:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20200915190755euoutp02ceeefb6694e594e0209416008de4bc78~1CpSF0trR0661006610euoutp02f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1600196875; bh=zbg2xoSaiDgck4H57R7Z3rwqX+vJJlCAoA2nccHDMek=; h=From:To:Subject:Date:In-Reply-To:Reply-To:References:From; b=UiGV6y0ov1bxN0JHO4CZqYv710TXGbal4u9kLYvi2jQQxv1XrzNBxdVfEFW9Bk+pa vgPjGRYXmA/kAcxlKwq0DDFF17QPePfW+8KGnPS+/k2ZoFi6OuW3fs2YI2S6pVpe/v hVsAXTlN3q5oCdIRKSt0IVncFtn5y2ESqbgnSRGw= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20200915190755eucas1p2b53b734765929a92c1e2b93e4b90cedf~1CpRnOnYJ2574925749eucas1p2t; Tue, 15 Sep 2020 19:07:55 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 60.DF.05997.A01116F5; Tue, 15 Sep 2020 20:07:54 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20200915190754eucas1p110b35ee7bbb1143e153f8f1469528fdb~1CpRJPEeP3097130971eucas1p1X; Tue, 15 Sep 2020 19:07:54 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20200915190754eusmtrp176df0165baccf37aac8080bcd14f5b1c~1CpRIcO3Q2872428724eusmtrp1M; Tue, 15 Sep 2020 19:07:54 +0000 (GMT) X-AuditID: cbfec7f4-65dff7000000176d-3d-5f61110a908d Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 4D.DB.06314.A01116F5; Tue, 15 Sep 2020 20:07:54 +0100 (BST) Received: from idyukov.rnd.samsung.ru (unknown [106.109.129.29]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20200915190752eusmtip26af1b68f95cd8ccdca741e4b02da7641~1CpPYBum-1712017120eusmtip2H; Tue, 15 Sep 2020 19:07:52 +0000 (GMT) From: Ivan Dyukov To: dev@dpdk.org, i.dyukov@samsung.com, v.kuramshin@samsung.com, thomas@monjalon.net, david.marchand@redhat.com, ferruh.yigit@intel.com, arybchenko@solarflare.com, wei.zhao1@intel.com, jia.guo@intel.com, beilei.xing@intel.com, qiming.yang@intel.com, wenzhuo.lu@intel.com, mb@smartsharesystems.com, stephen@networkplumber.org, nicolas.chautru@intel.com, bruce.richardson@intel.com, konstantin.ananyev@intel.com, cristian.dumitrescu@intel.com, radu.nicolau@intel.com, akhil.goyal@nxp.com, declan.doherty@intel.com, skori@marvell.com, pbhagavatula@marvell.com, jerinj@marvell.com, kirankumark@marvell.com, david.hunt@intel.com, anatoly.burakov@intel.com, xiaoyun.li@intel.com, jingjing.wu@intel.com, john.mcnamara@intel.com, jasvinder.singh@intel.com, byron.marohn@intel.com, yipeng1.wang@intel.com Date: Tue, 15 Sep 2020 22:07:00 +0300 Message-Id: <20200915190728.18143-6-i.dyukov@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200915190728.18143-1-i.dyukov@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA0VSa0xTZxj2O+f0nENHyWeR+Vqnbo3GzUTQOfXVOO/Zjj80y2KiMdmw0xM0 QiEtOMVMCSprSkUBdSudXQXlUowM6QUaMcoPLhblonhFx4yXiEIFMVGst3Iw+/e8z+V73rz5 RFZbyOvErcZ02WQ0JOt5NedrfNU2Uz3WkDjrYe4irGp1Erx3t4TFnsN3eMx9to/BG+4leNb/ lwoL/s1iMK9ggEF/uZXHpz3ZHPYP+hnsrg8KWNSZLeBgwyMBD7Q5CD4K97Jodz0n2Ob0qvDV hQCPoXAxh3nDXQQPepoJNtkGODxcV0swx0rxWUWZgCXdk3Gwp5nD4M0aAU+96GDR2/qGYH5T FcFLOe9US7+Qhl0nVVLJ2ceMVHi8g5Uabx4VJFuLk5Gq+2sZKXSui5fyPG4iXbyXy0qV91/y P6g3qBdtlpO3bpdNCYs3qrdYOm4Jae0xO3wBF5NFjkVbSZQI9BvoDN/irUQtamk5gYrQaT4i aOkQgcDBiYrwnMBdl539mCi/X80pQhkBe0sfqwwvCNh8QVXExdMvIWhxMhFhHK3mwR++zkSE WLoCLp5wjGCOTgOLzS9YiShq6ALot1OlYQpU/nN+pC2KLoTOui5BWWkyXP97aORNoK0iWP87 pVICK6H5gXcUx0Jvk0dQ8GcQLLRxSuB3Avm+GkEZDhHY6+gbdS0Bz5PLI1uw9CuoCiQo9DIY eNCiitBAY+BG39gIzX6ABb4/WIXWgCVHq7j1cL6lc5QGePM6WoESVDamKuepJ1DaXcMcIlOK /q9yEeIm4+UMc0qSbP7aKP8abzakmDOMSfGbUlPOkA9fNfi2aaiWBMK/NBAqEn20xnV7Y6JW Zdhu3pnSQEBk9eM0yy8Ff9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8kym4bCCSRLM4lFRTBNN/+cw2icwAy1RSDmR5hSf5j1Te+jYhDN+ wZyuMODIyvHOXe6Zjy5jb9jXG934vv0ut/NYsubAxUBl9QBmCFENXw+xc7Grmg0KW/DqEkfD 6E5t5dxpYVmUJePW9bXfd+9w5u2KLhhzRmeXDsfkBFUM9OD+1Tmn42KKRqP3BtG6iETl0qnc 7e84QkoW1OtwkyT8BR1fDi4IAwAA X-CMS-MailID: 20200915190754eucas1p110b35ee7bbb1143e153f8f1469528fdb X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200915190754eucas1p110b35ee7bbb1143e153f8f1469528fdb X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200915190754eucas1p110b35ee7bbb1143e153f8f1469528fdb References: <20200427095737.11082-1-i.dyukov@samsung.com> <20200915190728.18143-1-i.dyukov@samsung.com> Subject: [dpdk-dev] [PATCH v11 05/24] net/i40e: return unknown speed in status X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: i.dyukov@samsung.com List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" rte_ethdev has declared new NUM_UNKNOWN speed which could be used in case when no speed information is available and link is up. NUM_NONE should be returned, if link is down. Signed-off-by: Ivan Dyukov Acked-by: Jeff Guo --- drivers/net/i40e/i40e_ethdev.c | 5 ++++- drivers/net/i40e/i40e_ethdev_vf.c | 10 +++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index 472ce2a9e..f718356b5 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -2891,7 +2891,10 @@ update_link_aq(struct i40e_hw *hw, struct rte_eth_link *link, link->link_speed = ETH_SPEED_NUM_40G; break; default: - link->link_speed = ETH_SPEED_NUM_NONE; + if (link->link_status) + link->link_speed = ETH_SPEED_NUM_UNKNOWN; + else + link->link_speed = ETH_SPEED_NUM_NONE; break; } } diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c index eca716a6a..cf931bf9c 100644 --- a/drivers/net/i40e/i40e_ethdev_vf.c +++ b/drivers/net/i40e/i40e_ethdev_vf.c @@ -2163,15 +2163,15 @@ i40evf_dev_link_update(struct rte_eth_dev *dev, new_link.link_speed = ETH_SPEED_NUM_40G; break; default: - new_link.link_speed = ETH_SPEED_NUM_NONE; + if (vf->link_up) + new_link.link_speed = ETH_SPEED_NUM_UNKNOWN; + else + new_link.link_speed = ETH_SPEED_NUM_NONE; break; } /* full duplex only */ new_link.link_duplex = ETH_LINK_FULL_DUPLEX; - new_link.link_status = vf->link_up && - new_link.link_speed != ETH_SPEED_NUM_NONE - ? ETH_LINK_UP - : ETH_LINK_DOWN; + new_link.link_status = vf->link_up ? ETH_LINK_UP : ETH_LINK_DOWN; new_link.link_autoneg = !(dev->data->dev_conf.link_speeds & ETH_LINK_SPEED_FIXED); -- 2.17.1