From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [PATCH v2] net/bonding: fix link status check Date: Fri, 16 Feb 2018 12:13:02 -0800 Message-ID: <20180216121302.01f5ba2b@xeon-e3> References: <20171129145349.43448-1-tomaszx.kulasek@intel.com> <20171129154200.14436-1-tomaszx.kulasek@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org, declan.doherty@intel.com To: Tomasz Kulasek Return-path: Received: from mail-pg0-f46.google.com (mail-pg0-f46.google.com [74.125.83.46]) by dpdk.org (Postfix) with ESMTP id 4DBF11B1B0 for ; Fri, 16 Feb 2018 21:13:05 +0100 (CET) Received: by mail-pg0-f46.google.com with SMTP id w17so3263966pgv.6 for ; Fri, 16 Feb 2018 12:13:05 -0800 (PST) In-Reply-To: <20171129154200.14436-1-tomaszx.kulasek@intel.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" On Wed, 29 Nov 2017 16:42:00 +0100 Tomasz Kulasek wrote: > + /* Some devices needs more time to initialize and bring interface up. > + * While link status up is preferable we wait some time to be sure that > + * link status of slave is valid. > + */ > + if (slave_eth_dev->data->dev_link.link_status == ETH_LINK_DOWN) { > + rte_delay_ms(100); > + rte_eth_link_get_nowait(slave_port_id, &link_props); > + while ((link_props.link_status == ETH_LINK_DOWN) && > + (retries > 0)) { > + rte_delay_ms(100); > + rte_eth_link_get_nowait(slave_port_id, &link_props); > + retries--; > + } > + } > + Why use nowait and a loop, when there is already a waiting version of eth_link_get?