src/dpdk/drivers/net/ixgbe/ixgbe_ethdev.c
static int
ixgbe_dev_wait_setup_link_complete(struct rte_eth_dev *dev, uint32_t timeout_ms)
{
#define WARNING_TIMEOUT    9000 /* 9s  in total */
	struct ixgbe_adapter *ad = dev->data->dev_private;
	uint32_t timeout = timeout_ms ? timeout_ms : WARNING_TIMEOUT;

	while (rte_atomic32_read(&ad->link_thread_running)) {
		msec_delay(1);
		timeout--;

		if (timeout_ms) {
			if (!timeout)
				return 0;
		} else if (!timeout) {
			/* It will not return until link complete */
			timeout = WARNING_TIMEOUT;
			PMD_DRV_LOG(ERR, "IXGBE link thread not complete too long time!");
		}
	}

	return 1;
}
/*
 * If @timeout_ms was 0, it means that it will not return until link complete.
 * It returns 1 on complete, return 0 on timeout.
 */
If @timeout_ms was 0, it means that it will not return until link complete.
It returns 1 on complete, return 0 on timeout.
If @timeout_ms was 0 it means that it will not return until link complete . It returns 1 on complete return 0 on timeout .
static int
ixgbe_dev_wait_setup_link_complete(struct rte_eth_dev *dev, uint32_t timeout_ms)
{
#define WARNING_TIMEOUT    9000 /* 9s  in total */
	struct ixgbe_adapter *ad = dev->data->dev_private;
	uint32_t timeout = timeout_ms ? timeout_ms : WARNING_TIMEOUT;
	while (rte_atomic32_read(&ad->link_thread_running)) {
		msec_delay(1);
		timeout--;
		if (timeout_ms) {
			if (!timeout)
				return 0;
		} else if (!timeout) {
			timeout = WARNING_TIMEOUT;
			PMD_DRV_LOG(ERR, "IXGBE link thread not complete too long time!");
		}
	}
	return 1;
}
static int ixgbe_dev_wait_setup_link_complete ( struct rte_eth_dev * dev , uint32_t timeout_ms ) { #define WARNING_TIMEOUT     9000 /* 9s  in total */ struct ixgbe_adapter * ad = dev -> data -> dev_private ; uint32_t timeout = timeout_ms ? timeout_ms : WARNING_TIMEOUT ; while ( rte_atomic32_read ( & ad -> link_thread_running ) ) { msec_delay ( 1 ) ; timeout -- ; if ( timeout_ms ) { if ( ! timeout ) return 0 ; } else if ( ! timeout ) { timeout = WARNING_TIMEOUT ; PMD_DRV_LOG ( ERR , " " ) ; } } return 1 ; }
If @timeout_ms was 0, it means that it will not return until link complete.
If @timeout_ms was 0 it means that it will not return until link complete .
/* It will not return until link complete */