- if (mlx5_vdpa_nl_roce_disable(addr_name) == 0 ||
- mlx5_vdpa_sys_roce_disable(addr_name) == 0) {
- /*
- * Succeed to disable ROCE, wait for the IB device to appear
- * again after reload.
- */
- int r;
- struct ibv_device *ibv_new;
-
- for (r = MLX5_VDPA_MAX_RETRIES; r; r--) {
- ibv_new = mlx5_os_get_ibv_device(addr);
- if (ibv_new) {
- *ibv = ibv_new;
- return 0;
- }
- usleep(MLX5_VDPA_USEC);
- }
- DRV_LOG(ERR, "Cannot much device %s after ROCE disable, "
- "retries exceed %d", addr_name, MLX5_VDPA_MAX_RETRIES);
- rte_errno = EAGAIN;
- }
- return -rte_errno;