if (!nfp_mac_idx) {
                /* Assign a global index if non-repr or MAC is now shared. */
                if (entry || !port) {
-                       ida_idx = ida_simple_get(&priv->tun.mac_off_ids, 0,
-                                                NFP_MAX_MAC_INDEX, GFP_KERNEL);
+                       ida_idx = ida_alloc_max(&priv->tun.mac_off_ids,
+                                               NFP_MAX_MAC_INDEX, GFP_KERNEL);
                        if (ida_idx < 0)
                                return ida_idx;
 
        kfree(entry);
 err_free_ida:
        if (ida_idx != -1)
-               ida_simple_remove(&priv->tun.mac_off_ids, ida_idx);
+               ida_free(&priv->tun.mac_off_ids, ida_idx);
 
        return err;
 }
                }
 
                ida_idx = nfp_tunnel_get_ida_from_global_mac_idx(entry->index);
-               ida_simple_remove(&priv->tun.mac_off_ids, ida_idx);
+               ida_free(&priv->tun.mac_off_ids, ida_idx);
                entry->index = nfp_mac_idx;
                return 0;
        }
        /* If MAC has global ID then extract and free the ida entry. */
        if (nfp_tunnel_is_mac_idx_global(nfp_mac_idx)) {
                ida_idx = nfp_tunnel_get_ida_from_global_mac_idx(entry->index);
-               ida_simple_remove(&priv->tun.mac_off_ids, ida_idx);
+               ida_free(&priv->tun.mac_off_ids, ida_idx);
        }
 
        kfree(entry);