Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932311AbcLGEHL (ORCPT ); Tue, 6 Dec 2016 23:07:11 -0500 Received: from userp1040.oracle.com ([156.151.31.81]:23832 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753674AbcLGECv (ORCPT ); Tue, 6 Dec 2016 23:02:51 -0500 From: Santosh Shilimkar To: netdev@vger.kernel.org, davem@davemloft.net Cc: linux-kernel@vger.kernel.org, santosh.shilimkar@oracle.com Subject: [net-next][PATCH v2 10/18] RDS: IB: track and log active side endpoint in connection Date: Tue, 6 Dec 2016 20:01:48 -0800 Message-Id: <1481083316-11648-11-git-send-email-santosh.shilimkar@oracle.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1481083316-11648-1-git-send-email-santosh.shilimkar@oracle.com> References: <1481083316-11648-1-git-send-email-santosh.shilimkar@oracle.com> X-Source-IP: userv0022.oracle.com [156.151.31.74] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2008 Lines: 67 Useful to know the active and passive end points in a RDS IB connection. Signed-off-by: Santosh Shilimkar --- net/rds/ib.h | 3 +++ net/rds/ib_cm.c | 11 +++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/net/rds/ib.h b/net/rds/ib.h index f14c26d..97e7696 100644 --- a/net/rds/ib.h +++ b/net/rds/ib.h @@ -181,6 +181,9 @@ struct rds_ib_connection { /* Batched completions */ unsigned int i_unsignaled_wrs; + + /* Endpoint role in connection */ + int i_active_side; }; /* This assumes that atomic_t is at least 32 bits */ diff --git a/net/rds/ib_cm.c b/net/rds/ib_cm.c index 3002acf..4d1bf04 100644 --- a/net/rds/ib_cm.c +++ b/net/rds/ib_cm.c @@ -120,16 +120,17 @@ void rds_ib_cm_connect_complete(struct rds_connection *conn, struct rdma_cm_even rds_conn_destroy(conn); return; } else { - pr_notice("RDS/IB: connected <%pI4,%pI4> version %u.%u%s\n", + pr_notice("RDS/IB: %s conn connected <%pI4,%pI4> version %u.%u%s\n", + ic->i_active_side ? "Active" : "Passive", &conn->c_laddr, &conn->c_faddr, RDS_PROTOCOL_MAJOR(conn->c_version), RDS_PROTOCOL_MINOR(conn->c_version), ic->i_flowctl ? ", flow control" : ""); } - /* - * Init rings and fill recv. this needs to wait until protocol negotiation - * is complete, since ring layout is different from 3.0 to 3.1. + /* Init rings and fill recv. this needs to wait until protocol + * negotiation is complete, since ring layout is different + * from 3.1 to 4.1. */ rds_ib_send_init_ring(ic); rds_ib_recv_init_ring(ic); @@ -685,6 +686,7 @@ int rds_ib_cm_initiate_connect(struct rdma_cm_id *cm_id) if (ic->i_cm_id == cm_id) ret = 0; } + ic->i_active_side = true; return ret; } @@ -859,6 +861,7 @@ void rds_ib_conn_path_shutdown(struct rds_conn_path *cp) ic->i_sends = NULL; vfree(ic->i_recvs); ic->i_recvs = NULL; + ic->i_active_side = false; } int rds_ib_conn_alloc(struct rds_connection *conn, gfp_t gfp) -- 1.9.1