mirror of
https://kernel.googlesource.com/pub/scm/linux/kernel/git/torvalds/linux
synced 2025-09-14 08:36:46 +10:00
ice: alloc id for RDMA using xa_array
Use xa_array instead of deprecated ida to alloc id for RDMA aux driver. Signed-off-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
This commit is contained in:
parent
2b8db6afbc
commit
2be29286ed
@ -6,7 +6,7 @@
|
|||||||
#include "ice_lib.h"
|
#include "ice_lib.h"
|
||||||
#include "ice_dcb_lib.h"
|
#include "ice_dcb_lib.h"
|
||||||
|
|
||||||
static DEFINE_IDA(ice_aux_ida);
|
static DEFINE_XARRAY_ALLOC1(ice_aux_id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ice_get_auxiliary_drv - retrieve iidc_auxiliary_drv struct
|
* ice_get_auxiliary_drv - retrieve iidc_auxiliary_drv struct
|
||||||
@ -349,8 +349,9 @@ int ice_init_rdma(struct ice_pf *pf)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
pf->aux_idx = ida_alloc(&ice_aux_ida, GFP_KERNEL);
|
ret = xa_alloc(&ice_aux_id, &pf->aux_idx, NULL, XA_LIMIT(1, INT_MAX),
|
||||||
if (pf->aux_idx < 0) {
|
GFP_KERNEL);
|
||||||
|
if (ret) {
|
||||||
dev_err(dev, "Failed to allocate device ID for AUX driver\n");
|
dev_err(dev, "Failed to allocate device ID for AUX driver\n");
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
@ -371,7 +372,7 @@ err_plug_aux_dev:
|
|||||||
ice_free_rdma_qvector(pf);
|
ice_free_rdma_qvector(pf);
|
||||||
err_reserve_rdma_qvector:
|
err_reserve_rdma_qvector:
|
||||||
pf->adev = NULL;
|
pf->adev = NULL;
|
||||||
ida_free(&ice_aux_ida, pf->aux_idx);
|
xa_erase(&ice_aux_id, pf->aux_idx);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -386,5 +387,5 @@ void ice_deinit_rdma(struct ice_pf *pf)
|
|||||||
|
|
||||||
ice_unplug_aux_dev(pf);
|
ice_unplug_aux_dev(pf);
|
||||||
ice_free_rdma_qvector(pf);
|
ice_free_rdma_qvector(pf);
|
||||||
ida_free(&ice_aux_ida, pf->aux_idx);
|
xa_erase(&ice_aux_id, pf->aux_idx);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user