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 5ACE1A0093; Mon, 15 Jun 2020 11:03:19 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 87C0F54AE; Mon, 15 Jun 2020 11:02:21 +0200 (CEST) Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by dpdk.org (Postfix) with ESMTP id 2F0131B9BF for ; Mon, 15 Jun 2020 11:02:19 +0200 (CEST) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20200615090218euoutp02744cb4b9e87796ca4ee484d66bba7666~YrCQFlIOI3274832748euoutp02C for ; Mon, 15 Jun 2020 09:02:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20200615090218euoutp02744cb4b9e87796ca4ee484d66bba7666~YrCQFlIOI3274832748euoutp02C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1592211739; bh=RnlYD+Sn70PZMzCtJxYR4w9oEJDvYzwy6GYddb6sZF8=; h=From:To:Subject:Date:In-Reply-To:Reply-To:References:From; b=NGDEx3bPfg4Ndz2Glmo0ANG8Wb45afqTAzEiW+JxjytV/bAM/4yIhFnodq3exDho9 jZK7WQR9mkfEV5VDUDYCmzGILei8Von2HhGu5BM2uzO/Jkq5UWXROjr4qX/teVS1uv Scm0sCmxIubes66+GtmQlc71yUo2Sa7Zml8fL2mI= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20200615090218eucas1p1f52f2d8d7aa6f80957bb2842af89ac9e~YrCPzVs5K1961519615eucas1p16; Mon, 15 Jun 2020 09:02:18 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id C7.E0.60698.A1937EE5; Mon, 15 Jun 2020 10:02:18 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20200615090218eucas1p10282f1948a11d170ca0cec20ed3c7ad9~YrCPYJgE10030200302eucas1p1s; Mon, 15 Jun 2020 09:02:18 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20200615090218eusmtrp2f41e9023cde63a140068eff72a781124~YrCPXWluC0283002830eusmtrp2g; Mon, 15 Jun 2020 09:02:18 +0000 (GMT) X-AuditID: cbfec7f5-a0fff7000001ed1a-92-5ee7391aeaca Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id B9.D3.07950.A1937EE5; Mon, 15 Jun 2020 10:02:18 +0100 (BST) Received: from idyukov.rnd.samsung.ru (unknown [106.109.129.29]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200615090217eusmtip1fb89e5a0e73184eb4e72e4fa95d33032~YrCOlmEp73117731177eusmtip1B; Mon, 15 Jun 2020 09:02:17 +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 Date: Mon, 15 Jun 2020 12:01:54 +0300 Message-Id: <20200615090158.18912-7-i.dyukov@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200615090158.18912-1-i.dyukov@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprOKsWRmVeSWpSXmKPExsWy7djP87pSls/jDP48UrN4MOUum0X3hxYm i+0rutgs3n3azmRxZ+9pdotZl5rYLZ7/ecVsMW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WpWdTlF9akqqQkV9cYqsUbWhh pGdoaaFnZGKpZ2hsHmtlZKqkb2eTkpqTWZZapG+XoJfxaLFRwQq+irtfOpkbGH9xdzFyckgI mEh0X13O3MXIxSEksJRRYsfJN0AOB1BCQuL1E2aIGmGJP9e62CBqPjNK3GxuYARJsAloSJzu mMcEkhARWMIksXfVObCEsICDxOI/t9lBbBYBVYk33WdZQGxeAUuJi82LmCCmykus3nAAbAOn gJXExYMzwOqFBDIlXs2/wwphy0lcn/+FaQIj3wJGhlWMIqmlxbnpucVGesWJucWleel6yfm5 mxiBAb/t2M8tOxi73gUfYhTgYFTi4bUIfRYnxJpYVlyZe4hRgoNZSYTX6ezpOCHelMTKqtSi /Pii0pzU4kOMpkAHTmSWEk3OB0ZjXkm8oamhuYWlobmxubGZhZI4b4fAwRghgfTEktTs1NSC 1CKYPiYOTqkGxs0H2qyvR97ra7/5aLvocV+2S5prpfO7z059fWt6RYv3HZ2uu5k/DlZMTKgo EL5v8laN9+fUw7bX1hybudNynZHsUjGn9Vm7hNl+ruyetGrb7Vr+w3rix4PDww3CiytO3wv8 a6WsxqJVc9DyZpjg0ixhKZf67tNFCrdmch389u3AsfKA1c8/NSixFGckGmoxFxUnAgBbKCaD jgIAAA== X-CMS-MailID: 20200615090218eucas1p10282f1948a11d170ca0cec20ed3c7ad9 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200615090218eucas1p10282f1948a11d170ca0cec20ed3c7ad9 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200615090218eucas1p10282f1948a11d170ca0cec20ed3c7ad9 References: <20200427095737.11082-1-i.dyukov@samsung.com> <20200615090158.18912-1-i.dyukov@samsung.com> Subject: [dpdk-dev] [PATCH v3 6/7] 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 --- 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 749d85f54..d09b77674 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -2889,7 +2889,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 bb5d28a44..1da185485 100644 --- a/drivers/net/i40e/i40e_ethdev_vf.c +++ b/drivers/net/i40e/i40e_ethdev_vf.c @@ -2165,15 +2165,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