Skip to content

Commit 581d53c

Browse files
RDS: IB: track and log active side endpoint in connection
Useful to know the active and passive end points in a RDS IB connection. Signed-off-by: Santosh Shilimkar <[email protected]>
1 parent c536a06 commit 581d53c

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

net/rds/ib.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,9 @@ struct rds_ib_connection {
181181

182182
/* Batched completions */
183183
unsigned int i_unsignaled_wrs;
184+
185+
/* Endpoint role in connection */
186+
bool i_active_side;
184187
};
185188

186189
/* This assumes that atomic_t is at least 32 bits */

net/rds/ib_cm.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,16 +120,17 @@ void rds_ib_cm_connect_complete(struct rds_connection *conn, struct rdma_cm_even
120120
rds_conn_destroy(conn);
121121
return;
122122
} else {
123-
pr_notice("RDS/IB: connected <%pI4,%pI4> version %u.%u%s\n",
123+
pr_notice("RDS/IB: %s conn connected <%pI4,%pI4> version %u.%u%s\n",
124+
ic->i_active_side ? "Active" : "Passive",
124125
&conn->c_laddr, &conn->c_faddr,
125126
RDS_PROTOCOL_MAJOR(conn->c_version),
126127
RDS_PROTOCOL_MINOR(conn->c_version),
127128
ic->i_flowctl ? ", flow control" : "");
128129
}
129130

130-
/*
131-
* Init rings and fill recv. this needs to wait until protocol negotiation
132-
* is complete, since ring layout is different from 3.0 to 3.1.
131+
/* Init rings and fill recv. this needs to wait until protocol
132+
* negotiation is complete, since ring layout is different
133+
* from 3.1 to 4.1.
133134
*/
134135
rds_ib_send_init_ring(ic);
135136
rds_ib_recv_init_ring(ic);
@@ -685,6 +686,7 @@ int rds_ib_cm_initiate_connect(struct rdma_cm_id *cm_id)
685686
if (ic->i_cm_id == cm_id)
686687
ret = 0;
687688
}
689+
ic->i_active_side = true;
688690
return ret;
689691
}
690692

@@ -859,6 +861,7 @@ void rds_ib_conn_path_shutdown(struct rds_conn_path *cp)
859861
ic->i_sends = NULL;
860862
vfree(ic->i_recvs);
861863
ic->i_recvs = NULL;
864+
ic->i_active_side = false;
862865
}
863866

864867
int rds_ib_conn_alloc(struct rds_connection *conn, gfp_t gfp)

0 commit comments

Comments
 (0)