- *events = 0;
- /* Read all message and acknowledge them. */
- for (;;) {
- if (ibv_get_async_event(priv->ctx, &event))
- break;
- if ((event.event_type == IBV_EVENT_PORT_ACTIVE ||
- event.event_type == IBV_EVENT_PORT_ERR) &&
- intr_conf->lsc) {
- port_change = 1;
- ret++;
- } else if (event.event_type == IBV_EVENT_DEVICE_FATAL &&
- intr_conf->rmv) {
- *events |= (1 << RTE_ETH_EVENT_INTR_RMV);
- ret++;
- } else {
- DEBUG("event type %d on port %d not handled",
- event.event_type, event.element.port_num);
- }
- ibv_ack_async_event(&event);
- }
- if (!port_change)
- return ret;
- mlx4_link_update(priv->dev, 0);
- if (((link->link_speed == 0) && link->link_status) ||
- ((link->link_speed != 0) && !link->link_status)) {
- if (!priv->intr_alarm) {
- /* Inconsistent status, check again later. */
- priv->intr_alarm = 1;
- rte_eal_alarm_set(MLX4_INTR_ALARM_TIMEOUT,
- (void (*)(void *))
- mlx4_link_status_alarm,
- priv);
- }
- } else {
- *events |= (1 << RTE_ETH_EVENT_INTR_LSC);
- }
- return ret;
+ assert(priv->intr_alarm == 1);
+ priv->intr_alarm = 0;
+ if (intr_conf->lsc && !mlx4_link_status_check(priv))
+ _rte_eth_dev_callback_process(priv->dev,
+ RTE_ETH_EVENT_INTR_LSC,
+ NULL, NULL);