MCPcopy Create free account
hub / github.com/F-Stack/f-stack / ixgbe_wait_for_link_up

Function ixgbe_wait_for_link_up

dpdk/drivers/net/ixgbe/ixgbe_ethdev.c:4290–4313  ·  view source on GitHub ↗

* In freebsd environment, nic_uio drivers do not support interrupts, * rte_intr_callback_register() will fail to register interrupts. * We can not make link status to change from down to up by interrupt * callback. So we need to wait for the controller to acquire link * when ports start. * It returns 0 on link up. */

Source from the content-addressed store, hash-verified

4288 * It returns 0 on link up.
4289 */
4290static int
4291ixgbe_wait_for_link_up(struct ixgbe_hw *hw)
4292{
4293#ifdef RTE_EXEC_ENV_FREEBSD
4294 int err, i;
4295 bool link_up = false;
4296 uint32_t speed = 0;
4297 const int nb_iter = 25;
4298
4299 for (i = 0; i < nb_iter; i++) {
4300 err = ixgbe_check_link(hw, &speed, &link_up, 0);
4301 if (err)
4302 return err;
4303 if (link_up)
4304 return 0;
4305 msec_delay(200);
4306 }
4307
4308 return 0;
4309#else
4310 RTE_SET_USED(hw);
4311 return 0;
4312#endif
4313}
4314
4315/* return 0 means link status changed, -1 means not changed */
4316int

Callers 1

ixgbe_dev_startFunction · 0.85

Calls 1

ixgbe_check_linkFunction · 0.85

Tested by

no test coverage detected