summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMichael Margolin <mrgolin@amazon.com>2026-07-22 08:35:59 +0000
committerLeon Romanovsky <leon@kernel.org>2026-07-22 05:45:47 -0400
commit45e537bf580d540132bcabd8ae3af483461fa1c1 (patch)
tree47d17479088795398046fd26d8069d633553ef71 /include
parentb3818ea4ad1e2eff8472e8280daba0d2aabfe3c0 (diff)
downloadlinux-45e537bf580d540132bcabd8ae3af483461fa1c1.tar.gz
linux-45e537bf580d540132bcabd8ae3af483461fa1c1.zip
RDMA/core: Prevent destroying in-use completion counters
Reject comp_cntr destroy while it is attached to any QP. Track attachments using an xarray in ib_qp keyed by the attach op_mask. Use op bitmask to reject overlapping attaches early. Reviewed-by: Yonatan Nachum <ynachum@amazon.com> Signed-off-by: Michael Margolin <mrgolin@amazon.com> Link: https://patch.msgid.link/20260722083603.30334-3-mrgolin@amazon.com Signed-off-by: Leon Romanovsky <leon@kernel.org>
Diffstat (limited to 'include')
-rw-r--r--include/rdma/ib_verbs.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
index 9a952750f068..84a8904fbad4 100644
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@ -1758,6 +1758,7 @@ enum ib_qp_attach_comp_cntr_op {
struct ib_comp_cntr {
struct ib_device *device;
struct ib_uobject *uobject;
+ atomic_t usecnt;
};
enum ib_comp_cntr_entry {
@@ -1944,6 +1945,8 @@ struct ib_qp {
struct completion srq_completion;
struct ib_xrcd *xrcd; /* XRC TGT QPs only */
struct list_head xrcd_list;
+ struct xarray comp_cntrs; /* op_mask -> comp_cntr */
+ u32 comp_cntr_op_mask;
/* count times opened, mcast attaches, flow attaches */
atomic_t usecnt;