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 F0D51A04F5 for ; Wed, 11 Dec 2019 22:29:23 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id DFFDF1BDFD; Wed, 11 Dec 2019 22:29:23 +0100 (CET) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by dpdk.org (Postfix) with ESMTP id 7F53C374C for ; Wed, 11 Dec 2019 22:29:23 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576099762; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XZ/tzaaE4iXWMZOnmF+4N7qAy3ex3Js9tKyl76dikpU=; b=B6foKQcrFJarA7BFxIhyImkmbT3s1fCxZs8twczeK+UFsnpCQO2EzzI83tImOWmKa4yxKl gyoP5VM42yUhOaDIrP1RNUnTbowxl5XxsXrOT25b0CIYGaJamAY2lsEjaceUmNTsUZQjte F3rBIjjRsABYBol6VISkae9FPTrjPS4= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-226-VaXlNu5uNRupGgGXMjRFhQ-1; Wed, 11 Dec 2019 16:29:19 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 898681005516; Wed, 11 Dec 2019 21:29:17 +0000 (UTC) Received: from rh.redhat.com (ovpn-116-64.ams2.redhat.com [10.36.116.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5961910013A1; Wed, 11 Dec 2019 21:29:16 +0000 (UTC) From: Kevin Traynor To: Lunyuan Cui Cc: Xiaolong Ye , Wenzhuo Lu , dpdk stable Date: Wed, 11 Dec 2019 21:26:54 +0000 Message-Id: <20191211212702.27851-62-ktraynor@redhat.com> In-Reply-To: <20191211212702.27851-1-ktraynor@redhat.com> References: <20191211212702.27851-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-MC-Unique: VaXlNu5uNRupGgGXMjRFhQ-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Subject: [dpdk-stable] patch 'net/e1000: fix link status update' has been queued to LTS release 18.11.6 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to LTS release 18.11.6 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 12/17/19. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasi= ng (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/kevintraynor/dpdk-stable-queue This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable-queue/commit/14f605715a720372da= b34c4ba9d38cd46942e3b3 Thanks. Kevin. --- >From 14f605715a720372dab34c4ba9d38cd46942e3b3 Mon Sep 17 00:00:00 2001 From: Lunyuan Cui Date: Wed, 20 Nov 2019 09:22:03 +0000 Subject: [PATCH] net/e1000: fix link status update [ upstream commit e7c1d6b2d8f320732780783ce0999367e9b86957 ] Meaningless to judge the link state according to the memset'ed link variable, this patch fixes this logical issue. In addition, this patch changes the variable from link_check to link_up according to its real meaning. Fixes: 80ba61115e77 ("net/e1000: use link status helper functions") Signed-off-by: Lunyuan Cui Acked-by: Xiaolong Ye Acked-by: Wenzhuo Lu --- drivers/net/e1000/em_ethdev.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/net/e1000/em_ethdev.c b/drivers/net/e1000/em_ethdev.c index 123c73053..28637c494 100644 --- a/drivers/net/e1000/em_ethdev.c +++ b/drivers/net/e1000/em_ethdev.c @@ -1116,7 +1116,7 @@ eth_em_link_update(struct rte_eth_dev *dev, int wait_= to_complete) =09=09E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private); =09struct rte_eth_link link; -=09int link_check, count; +=09int link_up, count; =20 -=09link_check =3D 0; +=09link_up =3D 0; =09hw->mac.get_link_status =3D 1; =20 @@ -1128,10 +1128,10 @@ eth_em_link_update(struct rte_eth_dev *dev, int wai= t_to_complete) =09=09=09/* Do the work to read phy */ =09=09=09e1000_check_for_link(hw); -=09=09=09link_check =3D !hw->mac.get_link_status; +=09=09=09link_up =3D !hw->mac.get_link_status; =09=09=09break; =20 =09=09case e1000_media_type_fiber: =09=09=09e1000_check_for_link(hw); -=09=09=09link_check =3D (E1000_READ_REG(hw, E1000_STATUS) & +=09=09=09link_up =3D (E1000_READ_REG(hw, E1000_STATUS) & =09=09=09=09=09E1000_STATUS_LU); =09=09=09break; @@ -1139,5 +1139,5 @@ eth_em_link_update(struct rte_eth_dev *dev, int wait_= to_complete) =09=09case e1000_media_type_internal_serdes: =09=09=09e1000_check_for_link(hw); -=09=09=09link_check =3D hw->mac.serdes_has_link; +=09=09=09link_up =3D hw->mac.serdes_has_link; =09=09=09break; =20 @@ -1145,5 +1145,5 @@ eth_em_link_update(struct rte_eth_dev *dev, int wait_= to_complete) =09=09=09break; =09=09} -=09=09if (link_check || wait_to_complete =3D=3D 0) +=09=09if (link_up || wait_to_complete =3D=3D 0) =09=09=09break; =09=09rte_delay_ms(EM_LINK_UPDATE_CHECK_INTERVAL); @@ -1152,5 +1152,5 @@ eth_em_link_update(struct rte_eth_dev *dev, int wait_= to_complete) =20 =09/* Now we check if a transition has happened */ -=09if (link_check && (link.link_status =3D=3D ETH_LINK_DOWN)) { +=09if (link_up) { =09=09uint16_t duplex, speed; =09=09hw->mac.ops.get_link_up_info(hw, &speed, &duplex); @@ -1162,5 +1162,5 @@ eth_em_link_update(struct rte_eth_dev *dev, int wait_= to_complete) =09=09link.link_autoneg =3D !(dev->data->dev_conf.link_speeds & =09=09=09=09ETH_LINK_SPEED_FIXED); -=09} else if (!link_check && (link.link_status =3D=3D ETH_LINK_UP)) { +=09} else { =09=09link.link_speed =3D ETH_SPEED_NUM_NONE; =09=09link.link_duplex =3D ETH_LINK_HALF_DUPLEX; --=20 2.21.0 --- Diff of the applied patch vs upstream commit (please double-check if non-= empty: --- --- -=092019-12-11 21:24:17.543208913 +0000 +++ 0062-net-e1000-fix-link-status-update.patch=092019-12-11 21:24:12.72764= 9978 +0000 @@ -1 +1 @@ -From e7c1d6b2d8f320732780783ce0999367e9b86957 Mon Sep 17 00:00:00 2001 +From 14f605715a720372dab34c4ba9d38cd46942e3b3 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit e7c1d6b2d8f320732780783ce0999367e9b86957 ] + @@ -13 +14,0 @@ -Cc: stable@dpdk.org @@ -23 +24 @@ -index 9a88b50b2..080cbe2df 100644 +index 123c73053..28637c494 100644 @@ -26 +27 @@ -@@ -1122,7 +1122,7 @@ eth_em_link_update(struct rte_eth_dev *dev, int wait= _to_complete) +@@ -1116,7 +1116,7 @@ eth_em_link_update(struct rte_eth_dev *dev, int wait= _to_complete) @@ -36 +37 @@ -@@ -1134,10 +1134,10 @@ eth_em_link_update(struct rte_eth_dev *dev, int wa= it_to_complete) +@@ -1128,10 +1128,10 @@ eth_em_link_update(struct rte_eth_dev *dev, int wa= it_to_complete) @@ -49 +50 @@ -@@ -1145,5 +1145,5 @@ eth_em_link_update(struct rte_eth_dev *dev, int wait= _to_complete) +@@ -1139,5 +1139,5 @@ eth_em_link_update(struct rte_eth_dev *dev, int wait= _to_complete) @@ -56 +57 @@ -@@ -1151,5 +1151,5 @@ eth_em_link_update(struct rte_eth_dev *dev, int wait= _to_complete) +@@ -1145,5 +1145,5 @@ eth_em_link_update(struct rte_eth_dev *dev, int wait= _to_complete) @@ -63 +64 @@ -@@ -1158,5 +1158,5 @@ eth_em_link_update(struct rte_eth_dev *dev, int wait= _to_complete) +@@ -1152,5 +1152,5 @@ eth_em_link_update(struct rte_eth_dev *dev, int wait= _to_complete) @@ -70 +71 @@ -@@ -1168,5 +1168,5 @@ eth_em_link_update(struct rte_eth_dev *dev, int wait= _to_complete) +@@ -1162,5 +1162,5 @@ eth_em_link_update(struct rte_eth_dev *dev, int wait= _to_complete)