forked from Minki/linux
RDMA/uverbs: Add an ioctl method to destroy an object
Add an ioctl method to destroy the PD, MR, MW, AH, flow, RWQ indirection table and XRCD objects by handle which doesn't require any output response during destruction. Signed-off-by: Parav Pandit <parav@mellanox.com> Signed-off-by: Leon Romanovsky <leonro@mellanox.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
This commit is contained in:
parent
149d3845f4
commit
bbc13cda37
@ -228,36 +228,84 @@ DECLARE_UVERBS_NAMED_OBJECT(
|
||||
UVERBS_OBJECT_QP,
|
||||
UVERBS_TYPE_ALLOC_IDR_SZ(sizeof(struct ib_uqp_object), uverbs_free_qp));
|
||||
|
||||
DECLARE_UVERBS_NAMED_METHOD_DESTROY(
|
||||
UVERBS_METHOD_MW_DESTROY,
|
||||
UVERBS_ATTR_IDR(UVERBS_ATTR_DESTROY_MW_HANDLE,
|
||||
UVERBS_OBJECT_MW,
|
||||
UVERBS_ACCESS_DESTROY,
|
||||
UA_MANDATORY));
|
||||
|
||||
DECLARE_UVERBS_NAMED_OBJECT(UVERBS_OBJECT_MW,
|
||||
UVERBS_TYPE_ALLOC_IDR(uverbs_free_mw));
|
||||
UVERBS_TYPE_ALLOC_IDR(uverbs_free_mw),
|
||||
&UVERBS_METHOD(UVERBS_METHOD_MW_DESTROY));
|
||||
|
||||
DECLARE_UVERBS_NAMED_OBJECT(
|
||||
UVERBS_OBJECT_SRQ,
|
||||
UVERBS_TYPE_ALLOC_IDR_SZ(sizeof(struct ib_usrq_object),
|
||||
uverbs_free_srq));
|
||||
|
||||
DECLARE_UVERBS_NAMED_METHOD_DESTROY(
|
||||
UVERBS_METHOD_AH_DESTROY,
|
||||
UVERBS_ATTR_IDR(UVERBS_ATTR_DESTROY_AH_HANDLE,
|
||||
UVERBS_OBJECT_AH,
|
||||
UVERBS_ACCESS_DESTROY,
|
||||
UA_MANDATORY));
|
||||
|
||||
DECLARE_UVERBS_NAMED_OBJECT(UVERBS_OBJECT_AH,
|
||||
UVERBS_TYPE_ALLOC_IDR(uverbs_free_ah));
|
||||
UVERBS_TYPE_ALLOC_IDR(uverbs_free_ah),
|
||||
&UVERBS_METHOD(UVERBS_METHOD_AH_DESTROY));
|
||||
|
||||
DECLARE_UVERBS_NAMED_METHOD_DESTROY(
|
||||
UVERBS_METHOD_FLOW_DESTROY,
|
||||
UVERBS_ATTR_IDR(UVERBS_ATTR_DESTROY_FLOW_HANDLE,
|
||||
UVERBS_OBJECT_FLOW,
|
||||
UVERBS_ACCESS_DESTROY,
|
||||
UA_MANDATORY));
|
||||
|
||||
DECLARE_UVERBS_NAMED_OBJECT(
|
||||
UVERBS_OBJECT_FLOW,
|
||||
UVERBS_TYPE_ALLOC_IDR_SZ(sizeof(struct ib_uflow_object),
|
||||
uverbs_free_flow));
|
||||
uverbs_free_flow),
|
||||
&UVERBS_METHOD(UVERBS_METHOD_FLOW_DESTROY));
|
||||
|
||||
DECLARE_UVERBS_NAMED_OBJECT(
|
||||
UVERBS_OBJECT_WQ,
|
||||
UVERBS_TYPE_ALLOC_IDR_SZ(sizeof(struct ib_uwq_object), uverbs_free_wq));
|
||||
|
||||
DECLARE_UVERBS_NAMED_METHOD_DESTROY(
|
||||
UVERBS_METHOD_RWQ_IND_TBL_DESTROY,
|
||||
UVERBS_ATTR_IDR(UVERBS_ATTR_DESTROY_RWQ_IND_TBL_HANDLE,
|
||||
UVERBS_OBJECT_RWQ_IND_TBL,
|
||||
UVERBS_ACCESS_DESTROY,
|
||||
UA_MANDATORY));
|
||||
|
||||
DECLARE_UVERBS_NAMED_OBJECT(UVERBS_OBJECT_RWQ_IND_TBL,
|
||||
UVERBS_TYPE_ALLOC_IDR(uverbs_free_rwq_ind_tbl));
|
||||
UVERBS_TYPE_ALLOC_IDR(uverbs_free_rwq_ind_tbl),
|
||||
&UVERBS_METHOD(UVERBS_METHOD_RWQ_IND_TBL_DESTROY));
|
||||
|
||||
DECLARE_UVERBS_NAMED_METHOD_DESTROY(
|
||||
UVERBS_METHOD_XRCD_DESTROY,
|
||||
UVERBS_ATTR_IDR(UVERBS_ATTR_DESTROY_XRCD_HANDLE,
|
||||
UVERBS_OBJECT_XRCD,
|
||||
UVERBS_ACCESS_DESTROY,
|
||||
UA_MANDATORY));
|
||||
|
||||
DECLARE_UVERBS_NAMED_OBJECT(
|
||||
UVERBS_OBJECT_XRCD,
|
||||
UVERBS_TYPE_ALLOC_IDR_SZ(sizeof(struct ib_uxrcd_object),
|
||||
uverbs_free_xrcd));
|
||||
uverbs_free_xrcd),
|
||||
&UVERBS_METHOD(UVERBS_METHOD_XRCD_DESTROY));
|
||||
|
||||
DECLARE_UVERBS_NAMED_METHOD_DESTROY(
|
||||
UVERBS_METHOD_PD_DESTROY,
|
||||
UVERBS_ATTR_IDR(UVERBS_ATTR_DESTROY_PD_HANDLE,
|
||||
UVERBS_OBJECT_PD,
|
||||
UVERBS_ACCESS_DESTROY,
|
||||
UA_MANDATORY));
|
||||
|
||||
DECLARE_UVERBS_NAMED_OBJECT(UVERBS_OBJECT_PD,
|
||||
UVERBS_TYPE_ALLOC_IDR(uverbs_free_pd));
|
||||
UVERBS_TYPE_ALLOC_IDR(uverbs_free_pd),
|
||||
&UVERBS_METHOD(UVERBS_METHOD_PD_DESTROY));
|
||||
|
||||
const struct uapi_definition uverbs_def_obj_intf[] = {
|
||||
UAPI_DEF_CHAIN_OBJ_TREE_NAMED(UVERBS_OBJECT_PD,
|
||||
|
@ -143,10 +143,18 @@ DECLARE_UVERBS_NAMED_METHOD(
|
||||
UVERBS_ATTR_TYPE(u32),
|
||||
UA_MANDATORY));
|
||||
|
||||
DECLARE_UVERBS_NAMED_METHOD_DESTROY(
|
||||
UVERBS_METHOD_MR_DESTROY,
|
||||
UVERBS_ATTR_IDR(UVERBS_ATTR_DESTROY_MR_HANDLE,
|
||||
UVERBS_OBJECT_MR,
|
||||
UVERBS_ACCESS_DESTROY,
|
||||
UA_MANDATORY));
|
||||
|
||||
DECLARE_UVERBS_NAMED_OBJECT(
|
||||
UVERBS_OBJECT_MR,
|
||||
UVERBS_TYPE_ALLOC_IDR(uverbs_free_mr),
|
||||
&UVERBS_METHOD(UVERBS_METHOD_DM_MR_REG));
|
||||
&UVERBS_METHOD(UVERBS_METHOD_DM_MR_REG),
|
||||
&UVERBS_METHOD(UVERBS_METHOD_MR_DESTROY));
|
||||
|
||||
const struct uapi_definition uverbs_def_obj_mr[] = {
|
||||
UAPI_DEF_CHAIN_OBJ_TREE_NAMED(UVERBS_OBJECT_MR,
|
||||
|
@ -146,6 +146,11 @@ enum uverbs_attrs_reg_dm_mr_cmd_attr_ids {
|
||||
|
||||
enum uverbs_methods_mr {
|
||||
UVERBS_METHOD_DM_MR_REG,
|
||||
UVERBS_METHOD_MR_DESTROY,
|
||||
};
|
||||
|
||||
enum uverbs_attrs_mr_destroy_ids {
|
||||
UVERBS_ATTR_DESTROY_MR_HANDLE,
|
||||
};
|
||||
|
||||
enum uverbs_attrs_create_counters_cmd_attr_ids {
|
||||
@ -174,4 +179,51 @@ enum uverbs_attrs_info_handles_id {
|
||||
UVERBS_ATTR_INFO_HANDLES_LIST,
|
||||
};
|
||||
|
||||
enum uverbs_methods_pd {
|
||||
UVERBS_METHOD_PD_DESTROY,
|
||||
};
|
||||
|
||||
enum uverbs_attrs_pd_destroy_ids {
|
||||
UVERBS_ATTR_DESTROY_PD_HANDLE,
|
||||
};
|
||||
|
||||
enum uverbs_methods_mw {
|
||||
UVERBS_METHOD_MW_DESTROY,
|
||||
};
|
||||
|
||||
enum uverbs_attrs_mw_destroy_ids {
|
||||
UVERBS_ATTR_DESTROY_MW_HANDLE,
|
||||
};
|
||||
|
||||
enum uverbs_methods_xrcd {
|
||||
UVERBS_METHOD_XRCD_DESTROY,
|
||||
};
|
||||
|
||||
enum uverbs_attrs_xrcd_destroy_ids {
|
||||
UVERBS_ATTR_DESTROY_XRCD_HANDLE,
|
||||
};
|
||||
|
||||
enum uverbs_methods_ah {
|
||||
UVERBS_METHOD_AH_DESTROY,
|
||||
};
|
||||
|
||||
enum uverbs_attrs_ah_destroy_ids {
|
||||
UVERBS_ATTR_DESTROY_AH_HANDLE,
|
||||
};
|
||||
|
||||
enum uverbs_methods_rwq_ind_tbl {
|
||||
UVERBS_METHOD_RWQ_IND_TBL_DESTROY,
|
||||
};
|
||||
|
||||
enum uverbs_attrs_rwq_ind_tbl_destroy_ids {
|
||||
UVERBS_ATTR_DESTROY_RWQ_IND_TBL_HANDLE,
|
||||
};
|
||||
|
||||
enum uverbs_methods_flow {
|
||||
UVERBS_METHOD_FLOW_DESTROY,
|
||||
};
|
||||
|
||||
enum uverbs_attrs_flow_destroy_ids {
|
||||
UVERBS_ATTR_DESTROY_FLOW_HANDLE,
|
||||
};
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user