diff mbox series

[1/3] ib_srp: Add more documentation

Message ID 20220215182650.19839-2-bvanassche@acm.org (mailing list archive)
State Superseded
Headers show
Series Fix a deadlock in the ib_srp driver | expand

Commit Message

Bart Van Assche Feb. 15, 2022, 6:26 p.m. UTC
Make it more clear what the different ib_srp data structures represent.

Cc: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/infiniband/ulp/srp/ib_srp.h | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

Comments

Leon Romanovsky Feb. 15, 2022, 6:42 p.m. UTC | #1
On Tue, Feb 15, 2022 at 10:26:48AM -0800, Bart Van Assche wrote:
> Make it more clear what the different ib_srp data structures represent.
> 
> Cc: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
> Signed-off-by: Bart Van Assche <bvanassche@acm.org>
> ---
>  drivers/infiniband/ulp/srp/ib_srp.h | 11 ++++++++++-
>  1 file changed, 10 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/infiniband/ulp/srp/ib_srp.h b/drivers/infiniband/ulp/srp/ib_srp.h
> index abccddeea1e3..55a575e2cace 100644
> --- a/drivers/infiniband/ulp/srp/ib_srp.h
> +++ b/drivers/infiniband/ulp/srp/ib_srp.h
> @@ -92,6 +92,9 @@ enum srp_iu_type {
>  };
>  
>  /*
> + * RDMA adapter in the initiator system.
> + *
> + * @dev_list: List of RDMA ports associated with this RDMA adapter (srp_host).

Isn't this list of RDMA devices and not ports?

>   * @mr_page_mask: HCA memory registration page mask.
>   * @mr_page_size: HCA memory registration page size.
>   * @mr_max_size: Maximum size in bytes of a single FR registration request.
> @@ -109,6 +112,12 @@ struct srp_device {
>  	bool			use_fast_reg;
>  };
>  
> +/*
> + * One port of an RDMA adapter in the initiator system.
> + *
> + * @target_list: List of connected target ports (struct srp_target_port).
> + * @target_lock: Protects @target_list.
> + */
>  struct srp_host {
>  	struct srp_device      *srp_dev;
>  	u8			port;
> @@ -183,7 +192,7 @@ struct srp_rdma_ch {
>  };
>  
>  /**
> - * struct srp_target_port
> + * struct srp_target_port - RDMA port in the SRP target system
>   * @comp_vector: Completion vector used by the first RDMA channel created for
>   *   this target port.
>   */
Bart Van Assche Feb. 15, 2022, 8:34 p.m. UTC | #2
On 2/15/22 10:42, Leon Romanovsky wrote:
> On Tue, Feb 15, 2022 at 10:26:48AM -0800, Bart Van Assche wrote:
>>   /*
>> + * RDMA adapter in the initiator system.
>> + *
>> + * @dev_list: List of RDMA ports associated with this RDMA adapter (srp_host).
> 
> Isn't this list of RDMA devices and not ports?

Please take a look at srp_add_port(). I think that function establishes 
a 1:1 relationship between an RDMA port and struct srp_host.

Thanks,

Bart.
Leon Romanovsky Feb. 16, 2022, 7:02 a.m. UTC | #3
On Tue, Feb 15, 2022 at 12:34:27PM -0800, Bart Van Assche wrote:
> On 2/15/22 10:42, Leon Romanovsky wrote:
> > On Tue, Feb 15, 2022 at 10:26:48AM -0800, Bart Van Assche wrote:
> > >   /*
> > > + * RDMA adapter in the initiator system.
> > > + *
> > > + * @dev_list: List of RDMA ports associated with this RDMA adapter (srp_host).
> > 
> > Isn't this list of RDMA devices and not ports?
> 
> Please take a look at srp_add_port(). I think that function establishes a
> 1:1 relationship between an RDMA port and struct srp_host.

Right, but this list contains devices and not ports.

Anyway, it is not important.

Thanks

> 
> Thanks,
> 
> Bart.
>
diff mbox series

Patch

diff --git a/drivers/infiniband/ulp/srp/ib_srp.h b/drivers/infiniband/ulp/srp/ib_srp.h
index abccddeea1e3..55a575e2cace 100644
--- a/drivers/infiniband/ulp/srp/ib_srp.h
+++ b/drivers/infiniband/ulp/srp/ib_srp.h
@@ -92,6 +92,9 @@  enum srp_iu_type {
 };
 
 /*
+ * RDMA adapter in the initiator system.
+ *
+ * @dev_list: List of RDMA ports associated with this RDMA adapter (srp_host).
  * @mr_page_mask: HCA memory registration page mask.
  * @mr_page_size: HCA memory registration page size.
  * @mr_max_size: Maximum size in bytes of a single FR registration request.
@@ -109,6 +112,12 @@  struct srp_device {
 	bool			use_fast_reg;
 };
 
+/*
+ * One port of an RDMA adapter in the initiator system.
+ *
+ * @target_list: List of connected target ports (struct srp_target_port).
+ * @target_lock: Protects @target_list.
+ */
 struct srp_host {
 	struct srp_device      *srp_dev;
 	u8			port;
@@ -183,7 +192,7 @@  struct srp_rdma_ch {
 };
 
 /**
- * struct srp_target_port
+ * struct srp_target_port - RDMA port in the SRP target system
  * @comp_vector: Completion vector used by the first RDMA channel created for
  *   this target port.
  */