Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <santosh.shilimkar@oracle.com>

+10 -4
+3
net/rds/ib.h
··· 181 181 182 182 /* Batched completions */ 183 183 unsigned int i_unsignaled_wrs; 184 + 185 + /* Endpoint role in connection */ 186 + bool i_active_side; 184 187 }; 185 188 186 189 /* This assumes that atomic_t is at least 32 bits */
+7 -4
net/rds/ib_cm.c
··· 120 120 rds_conn_destroy(conn); 121 121 return; 122 122 } 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", 124 125 &conn->c_laddr, &conn->c_faddr, 125 126 RDS_PROTOCOL_MAJOR(conn->c_version), 126 127 RDS_PROTOCOL_MINOR(conn->c_version), 127 128 ic->i_flowctl ? ", flow control" : ""); 128 129 } 129 130 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. 133 134 */ 134 135 rds_ib_send_init_ring(ic); 135 136 rds_ib_recv_init_ring(ic); ··· 686 685 if (ic->i_cm_id == cm_id) 687 686 ret = 0; 688 687 } 688 + ic->i_active_side = true; 689 689 return ret; 690 690 } 691 691 ··· 861 859 ic->i_sends = NULL; 862 860 vfree(ic->i_recvs); 863 861 ic->i_recvs = NULL; 862 + ic->i_active_side = false; 864 863 } 865 864 866 865 int rds_ib_conn_alloc(struct rds_connection *conn, gfp_t gfp)