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 2F39FA04FA; Mon, 3 Feb 2020 21:29:02 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A5D7B1BFB4; Mon, 3 Feb 2020 21:29:01 +0100 (CET) Received: from mail-ot1-f66.google.com (mail-ot1-f66.google.com [209.85.210.66]) by dpdk.org (Postfix) with ESMTP id DE2D21BFAF for ; Mon, 3 Feb 2020 21:28:59 +0100 (CET) Received: by mail-ot1-f66.google.com with SMTP id j20so6495264otq.3 for ; Mon, 03 Feb 2020 12:28:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=infinite-io.20150623.gappssmtp.com; s=20150623; h=from:mime-version:subject:date:references:cc:to:message-id; bh=VSCmpwL2nCHC1tz+jx4Ku0ytnsASl6Sb/QZPlnoRA4Y=; b=MQUf00Uz+BWqw1xcrw649gMsbkCvi7IlAxkXpuJUXRBTZN/+AyEK7Yfz/kGMUYNvxZ 0gTuJSoQvIqOUoItYc7C0OvnWh1I67Whn3Y9bg5J01OCB4Xzm9HkKmW9bD5kTaVgpqAe 59lT3mtR6qFYxDfab7Q/yY8MeOBnIz+lLnjjkVxJ+YylOIBWlnD8ftIxBxRZ6CtHD3k1 QwIxRyDPweXQ33GcZH50LFbb01BdCY4x3h5Gjd9o+QT9vtnJPVDoQ1fJiYI3q0an+so3 t+2MMbK4Fy/4/P3bmb6Akhmb5jo+acCt5YiKPXfc7isrGXNirp5aG1VWRqXJFQAScvwy kj0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:mime-version:subject:date:references:cc:to :message-id; bh=VSCmpwL2nCHC1tz+jx4Ku0ytnsASl6Sb/QZPlnoRA4Y=; b=AR6omZ3yjvVFdVR+CcUvF2ueFHiYP4cKRWIMKcn06AjvkczxA/ND/9+cocfhrOXhd5 brfBEDwNbq0Zrto/Mp/qKr4iRpJUrvA/cTFbDKzbxnHqjVKm0BFVMoqwMpRqopgzs26q IjubQGZeZkP6oE+ZiRrQ86ypRFEjdYIxMY2mhLkvygbdRr4LQbAlzGx0f1i15wXU20ty T48bazLX5x3CWoFxotWi5bO3ZwiRxrXlRcBYdPkszDR1SpbTzxeFwQJSUSt4q9ClgZDv alX/GcxI4Sp+Q7grJ15VFHQdDtJfH8NP/bfRAO9sN6hZrXaOQ+nMl8e59ST4jsuuQwVX p8nQ== X-Gm-Message-State: APjAAAVLrizHeS5cbAmUDnsDuHUWJm0C/6zA3dX7uweYWrPrjq0v2qQF GxTcbQvN4m0t6+yNxKo8BRrlSU+Rv9lVHg== X-Google-Smtp-Source: APXvYqzuTf43gIekpqUcLLJhZJoMPIHUaT0Hc1rbXNGgUNoojgiby3XFZ7aAcptX6SLQv39K0BLPRg== X-Received: by 2002:a9d:7852:: with SMTP id c18mr18070014otm.247.1580761738622; Mon, 03 Feb 2020 12:28:58 -0800 (PST) Received: from [10.3.1.67] (INFINITE-IO.bear2.Houston1.Level3.net. [4.14.61.118]) by smtp.gmail.com with ESMTPSA id l12sm6965100oth.9.2020.02.03.12.28.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Feb 2020 12:28:58 -0800 (PST) From: Dave Burton Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Date: Mon, 3 Feb 2020 14:28:57 -0600 References: <20200116172947.45353-1-daveb@infinite.io> Cc: wenzhuo.lu@intel.com, konstantin.ananyev@intel.com To: dev@dpdk.org, stable@dpdk.org Message-Id: X-Mailer: Apple Mail (2.3445.104.11) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: [dpdk-dev] [PATCH] ixgbe: reset need link config flag on start X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" Begin forwarded message: From: Dave Burton Subject: [PATCH] ixgbe: reset need link config flag on start Date: January 16, 2020 at 11:29:47 AM CST To: dev@dpdk.org Cc: stable@dpdk.org, Dave Burton [Resending; original sent on Jan 16, 2020, never seen on public lists] [NB: I do not have DPDK 19.x on my systems, and I understand some = context may have changed in 19.08.x, although not the diffs] There is a race condition in the ixgbe PMD between = ixgbe_dev_link_update_share() and ixgbe_dev_stop(). If this is a fiber phy and the link goes down, = the IXGBE_FLAG_NEED_LINK_CONFIG flag is set and a callback is set for 10us = later. If ixgbe_dev_stop() is called prior to this alarm firing, it cancels the = alarm, but does not reset the flag. Thereafter, the link is forever reported = down, since the short-circuit flag remains set. This patch resets the flag in ixgbe_dev_start (when it matters) just = after it has done the same work as the alarm callback would have. This was tested on DPDK 18.11.3. Signed-off-by: Dave Burton --- drivers/net/ixgbe/ixgbe_ethdev.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c = b/drivers/net/ixgbe/ixgbe_ethdev.c index 2c6fd0f13..64d7928ce 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/ixgbe/ixgbe_ethdev.c @@ -2543,6 +2543,8 @@ ixgbe_dev_start(struct rte_eth_dev *dev) *IXGBE_DEV_PRIVATE_TO_P_VFDATA(dev->data->dev_private); struct rte_pci_device *pci_dev =3D RTE_ETH_DEV_TO_PCI(dev); struct rte_intr_handle *intr_handle =3D &pci_dev->intr_handle; + struct ixgbe_interrupt *intr =3D + IXGBE_DEV_PRIVATE_TO_INTR(dev->data->dev_private); uint32_t intr_vector =3D 0; int err, link_up =3D 0, negotiate =3D 0; uint32_t speed =3D 0; @@ -2768,6 +2770,14 @@ ixgbe_dev_start(struct rte_eth_dev *dev) skip_link_setup: + /* + * There is a race between ixgbe_dev_link_update_share + * and ixgbe_dev_stop: if ixgbe_dev_stop is called before + * the alarm callback, this flag remains set, and + * ixgbe_dev_link_update_share will no longer sample status. + */ + intr->flags &=3D ~IXGBE_FLAG_NEED_LINK_CONFIG; + if (rte_intr_allow_others(intr_handle)) { /* check if lsc interrupt is enabled */ if (dev->data->dev_conf.intr_conf.lsc !=3D 0) --=20 2.19.1