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 43543A04A2 for ; Mon, 11 May 2020 04:57:22 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 27EBB1D159; Mon, 11 May 2020 04:57:22 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id E486C1C10B; Mon, 11 May 2020 04:57:18 +0200 (CEST) IronPort-SDR: L5t6lZrI5x5MwKFpEg+CdAWwoW3GpcDF6zikNtdMPIAwtRc8HKk09G/hInWwG7b+FwvfuBfise i2p2fjajz99A== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 May 2020 19:57:17 -0700 IronPort-SDR: Ho7a4ERbIIkN56v07fyRF/4qIjN5WEHfvhzRpoLCytmrwpIXSqXLWWGwNr7dpSZhMhh1bGcJuH z/O/WIUNP5RQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,378,1583222400"; d="scan'208";a="436507167" Received: from yexl-server.sh.intel.com (HELO localhost) ([10.67.116.183]) by orsmga005.jf.intel.com with ESMTP; 10 May 2020 19:57:15 -0700 Date: Mon, 11 May 2020 10:49:15 +0800 From: Ye Xiaolong To: Phil Yang Cc: dev@dpdk.org, wei.zhao1@intel.com, jia.guo@intel.com, Lijian.Zhang@arm.com, nd@arm.com, stable@dpdk.org Message-ID: <20200511024915.GI75514@intel.com> References: <1584600111-17412-1-git-send-email-phil.yang@arm.com> <1588933707-4672-1-git-send-email-phil.yang@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1588933707-4672-1-git-send-email-phil.yang@arm.com> User-Agent: Mutt/1.9.4 (2018-02-28) Subject: Re: [dpdk-stable] [PATCH v2] net/ixgbe: fix link state timing issue on fiber ports 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" On 05/08, Phil Yang wrote: >In ixgbe_dev_link_update_share(), if the media type is fiber and the >link is down, a flag (IXGBE_FLAG_NEED_LINK_CONFIG) is set. A callback >to ixgbe_dev_setup_link_thread_handler() is scheduled which should >try to set up the link and clear the flag afterwards. This flag works >as a guard variable between threads. > >To avoid potential race condition between threads, set the >IXGBE_FLAG_NEED_LINK_CONFIG flag only when there is no link thread >running. > >Fixes: 819d0d1d57f1 ("net/ixgbe: fix blocking system events") >Cc: stable@dpdk.org > >Bugzilla ID: 388 > >Signed-off-by: Phil Yang >Reviewed-by: Lijian Zhang >--- >v2: >1. rebase code. > > drivers/net/ixgbe/ixgbe_ethdev.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > >diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c >index aa1e8aa..dc19f0c 100644 >--- a/drivers/net/ixgbe/ixgbe_ethdev.c >+++ b/drivers/net/ixgbe/ixgbe_ethdev.c >@@ -4276,9 +4276,13 @@ ixgbe_dev_link_update_share(struct rte_eth_dev *dev, > > if (link_up == 0) { > if (ixgbe_get_media_type(hw) == ixgbe_media_type_fiber) { >- intr->flags |= IXGBE_FLAG_NEED_LINK_CONFIG; > ixgbe_dev_wait_setup_link_complete(dev, 0); > if (rte_atomic32_test_and_set(&ad->link_thread_running)) { >+ /* To avoid race condition between threads, set >+ * the IXGBE_FLAG_NEED_LINK_CONFIG flag only >+ * when there is no link thread running. >+ */ >+ intr->flags |= IXGBE_FLAG_NEED_LINK_CONFIG; > if (rte_ctrl_thread_create(&ad->link_thread_tid, > "ixgbe-link-handler", > NULL, >-- >2.7.4 > Acked-by: Xiaolong Ye Applied to dpdk-next-net-intel, Thanks.