diff options
author | Bart Van Assche <bvanassche@acm.org> | 2022-07-27 21:34:14 +0200 |
---|---|---|
committer | Jason Gunthorpe <jgg@nvidia.com> | 2022-07-29 21:45:37 +0200 |
commit | aa7dfbb41b5a60ab90e244d6f586b8cb5c791c3e (patch) | |
tree | f5a6a861b427d71b0cb815226f6e9b7e65a46d50 /drivers/infiniband/ulp/srpt/ib_srpt.h | |
parent | RDMA/srpt: Duplicate port name members (diff) | |
download | linux-aa7dfbb41b5a60ab90e244d6f586b8cb5c791c3e.tar.xz linux-aa7dfbb41b5a60ab90e244d6f586b8cb5c791c3e.zip |
RDMA/srpt: Introduce a reference count in struct srpt_device
This will be used to keep struct srpt_device around as long as either the
RDMA port exists or a LIO target port is associated with the struct
srpt_device.
Link: https://lore.kernel.org/r/20220727193415.1583860-3-bvanassche@acm.org
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Diffstat (limited to 'drivers/infiniband/ulp/srpt/ib_srpt.h')
-rw-r--r-- | drivers/infiniband/ulp/srpt/ib_srpt.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.h b/drivers/infiniband/ulp/srpt/ib_srpt.h index 3844a7058559..0cb867d580f1 100644 --- a/drivers/infiniband/ulp/srpt/ib_srpt.h +++ b/drivers/infiniband/ulp/srpt/ib_srpt.h @@ -434,6 +434,7 @@ struct srpt_port { /** * struct srpt_device - information associated by SRPT with a single HCA + * @refcnt: Reference count for this device. * @device: Backpointer to the struct ib_device managed by the IB core. * @pd: IB protection domain. * @lkey: L_Key (local key) with write access to all local memory. @@ -449,6 +450,7 @@ struct srpt_port { * @port: Information about the ports owned by this HCA. */ struct srpt_device { + struct kref refcnt; struct ib_device *device; struct ib_pd *pd; u32 lkey; |