On Tue, Jan 19, 2021 at 10:58:42AM +0800, Min Hu (Connor) wrote: > Thank Stephen, > but in which the scenarios, it should wait link to up, in which > scenarios, it should not ? > By the way, how to define the "wait" time value ? >
I believe the documentation somewhere refers to a wait time of up to 9 seconds, but I don't think it's terribly well defined. Some Intel NICs will stall for a few seconds if the link is not yet stable or if the link is down. With the link up, I don't think any NIC fails to return immediately. However, if delays in the app are something you want to avoid, the _nowait varient is the one to call to be sure. /Bruce > > > 在 2021/1/19 10:26, Stephen Hemminger 写道: > > On Tue, 19 Jan 2021 09:06:48 +0800 > > "Min Hu (Connor)" <humi...@huawei.com> wrote: > > > > > Hi, Bruce and all, > > > Do you know the difference between "rte_eth_link_get" and > > > "rte_eth_link_get_nowait"? I know they call funciton "link_update" > > > with differenct parameter "wait_to_complete"(set 1 means wait, set 0 > > > means not wait). But how to define the "wait" time, and why it shoud > > > wait? > > > On the further, What are the application scenarios of the two > > > APIs? > > > > > > > The default behavior of rte_eth_link_get (in some drivers) is to wait > > for link to come up. Many drivers don't do this. It seems mostly the > > Intel ones that do. > > . > >