diff options
author | Bart Van Assche <bvanassche@acm.org> | 2019-09-30 16:17:06 -0700 |
---|---|---|
committer | Jason Gunthorpe <jgg@mellanox.com> | 2019-10-04 15:35:07 -0300 |
commit | 3236fd61ee92487322982726f63cbe8355f6636e (patch) | |
tree | e12b0fc47705beac94810ddd659f4a10ffc4e50f /drivers/infiniband/ulp/srpt/ib_srpt.h | |
parent | RDMA/srpt: Rework the code that waits until an RDMA port is no longer in use (diff) | |
download | linux-dev-3236fd61ee92487322982726f63cbe8355f6636e.tar.xz linux-dev-3236fd61ee92487322982726f63cbe8355f6636e.zip |
RDMA/srpt: Make the code for handling port identities more systematic
Introduce a new data structure for the information about an RDMA port
name. This patch does not change any functionality.
Link: https://lore.kernel.org/r/20190930231707.48259-15-bvanassche@acm.org
Cc: Honggang LI <honli@redhat.com>
Cc: Laurence Oberman <loberman@redhat.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'drivers/infiniband/ulp/srpt/ib_srpt.h')
-rw-r--r-- | drivers/infiniband/ulp/srpt/ib_srpt.h | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.h b/drivers/infiniband/ulp/srpt/ib_srpt.h index f3df791dd877..f8bd95302ac0 100644 --- a/drivers/infiniband/ulp/srpt/ib_srpt.h +++ b/drivers/infiniband/ulp/srpt/ib_srpt.h @@ -364,12 +364,25 @@ struct srpt_port_attrib { }; /** + * struct srpt_port_id - information about an RDMA port name + * @tpg: TPG associated with the RDMA port. + * @wwn: WWN associated with the RDMA port. + * @name: ASCII representation of the port name. + * + * Multiple sysfs directories can be associated with a single RDMA port. This + * data structure represents a single (port, name) pair. + */ +struct srpt_port_id { + struct se_portal_group tpg; + struct se_wwn wwn; + char name[64]; +}; + +/** * struct srpt_port - information associated by SRPT with a single IB port * @sdev: backpointer to the HCA information. * @mad_agent: per-port management datagram processing information. * @enabled: Whether or not this target port is enabled. - * @port_guid: ASCII representation of Port GUID - * @port_gid: ASCII representation of Port GID * @port: one-based port number. * @sm_lid: cached value of the port's sm_lid. * @lid: cached value of the port's lid. @@ -390,17 +403,13 @@ struct srpt_port { struct srpt_device *sdev; struct ib_mad_agent *mad_agent; bool enabled; - u8 port_guid[24]; - u8 port_gid[64]; u8 port; u32 sm_lid; u32 lid; union ib_gid gid; struct work_struct work; - struct se_portal_group port_guid_tpg; - struct se_wwn port_guid_wwn; - struct se_portal_group port_gid_tpg; - struct se_wwn port_gid_wwn; + struct srpt_port_id port_guid_id; + struct srpt_port_id port_gid_id; struct srpt_port_attrib port_attrib; atomic_t refcount; struct completion *freed_channels; |