IB/srpt: Preparations for adding RDMA/CM support

Introduce a union in struct srpt_rdma_ch for member variables that
depend on the type of connection manager. Avoid that error messages
report the IB/CM ID.

Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
This commit is contained in:
Bart Van Assche
2018-01-16 16:14:16 -08:00
committed by Doug Ledford
parent fcf589364f
commit 090fa24bf2
2 changed files with 22 additions and 18 deletions

View File

@@ -243,8 +243,8 @@ enum rdma_ch_state {
/**
* struct srpt_rdma_ch - RDMA channel
* @nexus: I_T nexus this channel is associated with.
* @cm_id: IB CM ID associated with the channel.
* @qp: IB queue pair used for communicating over this channel.
* @cm_id: IB CM ID associated with the channel.
* @cq: IB completion queue for this channel.
* @zw_cqe: Zero-length write CQE.
* @rcu: RCU head.
@@ -275,8 +275,12 @@ enum rdma_ch_state {
*/
struct srpt_rdma_ch {
struct srpt_nexus *nexus;
struct ib_cm_id *cm_id;
struct ib_qp *qp;
union {
struct {
struct ib_cm_id *cm_id;
} ib_cm;
};
struct ib_cq *cq;
struct ib_cqe zw_cqe;
struct rcu_head rcu;