From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f194.google.com (mail-wr0-f194.google.com [209.85.128.194]) by dpdk.org (Postfix) with ESMTP id 46D0844C7 for ; Thu, 31 May 2018 10:34:17 +0200 (CEST) Received: by mail-wr0-f194.google.com with SMTP id d2-v6so16651691wrm.10 for ; Thu, 31 May 2018 01:34:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=nVYfBddXAZmlIAI6oRU2WNB0Ym3WS+z5mqPdMH/Qy5g=; b=Q310lkLxuFhXFePiuM2u6rRPe/dklMDP39biQoBSzjEph7hXeQjsrYm9rOt5KT/I3g EebVdDNHkgg2+qqKgQ3zM9PfXjlGSHRhYfEcEiUMGYyUhQONsBTyTfBRkBkeAUKyy4XB cib/OQWDyuRGiFVt/1iv75P6Y2x3eIj68KmaXUwuixSDpVVjKkutA5uH7w9YKoX/kpmy i6fi0O0/3pOGDepxxkhcf6myPyhKT6cjv8vzhJM9glTIiaSlA1ID8vUDeA+ZNIzKdrrP c+HCHo8mdUYe75DPQ9Fg77CzUCeGhqkoIwjYfoNaG4tSAfU8JhCiix2iXX1CPj6uvvoD OX1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=nVYfBddXAZmlIAI6oRU2WNB0Ym3WS+z5mqPdMH/Qy5g=; b=JM7ZPpheVkCoSRq9L2VnwzWHk5ee2vYw64rFnwwLcx5RXJPmzK+n/n88ayWQVTNDE1 6rP9UORrtu76f19oGJ+O9bo5oa3xmRhHwlQBCXNrXpEUsjykFVV5+oywB+In/TSk+dHx x9iaCdrv3xVck6jmpacbxi1RiY8M61WDvGcKg8gNQYO2Vz+DBth6uI7RMwTaTr6LIU3/ JvMmlbGLaBL2/L3cfde1O4s2umeyeojRYrD4lKG4UVJg/xNsKRZSYbFP7D9YiugCOO87 YdS9IzlTZAnS6/wXkLfOkDMUZfWaCo99oLwrgYYM3wPN+3vWvl8/+rgofZ3syTTeMVkX vlmg== X-Gm-Message-State: ALKqPwcTT4BJmeUdiujT7ri1XOQ0IJsiXZVCo2SLFirKnsfiwLWhRZ/h 6EJI9cGcGZeHp++zCoLwXds= X-Google-Smtp-Source: ADUXVKJwkGuW7o3QpvSmDiuILGMwRemp13/yAzWxmPb0MLsx/81M0agGx6qER/fiVlhl7NJnPyx7kg== X-Received: by 2002:adf:ad2f:: with SMTP id p44-v6mr4787965wrc.164.1527755656939; Thu, 31 May 2018 01:34:16 -0700 (PDT) Received: from localhost ([2a00:23c5:be9a:5200:ce4c:82c0:d567:ecbb]) by smtp.gmail.com with ESMTPSA id v12-v6sm30865169wrm.68.2018.05.31.01.34.15 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 31 May 2018 01:34:15 -0700 (PDT) From: luca.boccassi@gmail.com To: Fan Zhang Cc: Qi Zhang , Pablo de Lara , dpdk stable Date: Thu, 31 May 2018 09:34:07 +0100 Message-Id: <20180531083408.23210-1-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180529102553.23431-5-luca.boccassi@gmail.com> References: <20180529102553.23431-5-luca.boccassi@gmail.com> Subject: [dpdk-stable] patch 'net/i40e: fix link status update' has been queued to stable release 18.02.2 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: , X-List-Received-Date: Thu, 31 May 2018 08:34:17 -0000 Hi, FYI, your patch has been queued to stable release 18.02.2 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 06/02/18. So please shout if anyone has objections. Thanks. Luca Boccassi --- >>From f10ff9d64a0785881e62a6bcd29af3d79c3482db Mon Sep 17 00:00:00 2001 From: Fan Zhang Date: Wed, 30 May 2018 09:30:47 +0100 Subject: [PATCH] net/i40e: fix link status update [ upstream commit c60869e2b742d2d0b7c5d568ad31f67f29d4f450 ] This patch fixes link status update problem in interrupt mode. Previously, directly reading link status register instead of accessing via admin queue command may cause the link status change interrupt callback inactive. This patch fixes the problem by making the driver only read the register in "no wait" and polling mode. Bugzilla ID: 54 Fixes: eef2daf2e199 ("net/i40e: fix link update no wait") Signed-off-by: Fan Zhang Acked-by: Qi Zhang Tested-by: Pablo de Lara --- drivers/net/i40e/i40e_ethdev.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index 1ebda8dbd..ccfd6069d 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -2480,7 +2480,7 @@ i40e_dev_set_link_down(struct rte_eth_dev *dev) } static __rte_always_inline void -update_link_no_wait(struct i40e_hw *hw, struct rte_eth_link *link) +update_link_reg(struct i40e_hw *hw, struct rte_eth_link *link) { /* Link status registers and values*/ #define I40E_PRTMAC_LINKSTA 0x001E2420 @@ -2534,8 +2534,8 @@ update_link_no_wait(struct i40e_hw *hw, struct rte_eth_link *link) } static __rte_always_inline void -update_link_wait(struct i40e_hw *hw, struct rte_eth_link *link, - bool enable_lse) +update_link_aq(struct i40e_hw *hw, struct rte_eth_link *link, + bool enable_lse, int wait_to_complete) { #define CHECK_INTERVAL 100 /* 100ms */ #define MAX_REPEAT_TIME 10 /* 1s (10 * 100ms) in total */ @@ -2557,7 +2557,7 @@ update_link_wait(struct i40e_hw *hw, struct rte_eth_link *link, } link->link_status = link_status.link_info & I40E_AQ_LINK_UP; - if (unlikely(link->link_status != 0)) + if (!wait_to_complete || link->link_status) break; rte_delay_ms(CHECK_INTERVAL); @@ -2607,10 +2607,10 @@ i40e_dev_link_update(struct rte_eth_dev *dev, link.link_autoneg = !(dev->data->dev_conf.link_speeds & ETH_LINK_SPEED_FIXED); - if (!wait_to_complete) - update_link_no_wait(hw, &link); + if (!wait_to_complete && !enable_lse) + update_link_reg(hw, &link); else - update_link_wait(hw, &link, enable_lse); + update_link_aq(hw, &link, enable_lse, wait_to_complete); rte_i40e_dev_atomic_write_link_status(dev, &link); if (link.link_status == old.link_status) -- 2.17.1