From: Bang Nguyen Date: Thu, 29 Aug 2013 23:14:48 +0000 (-0700) Subject: RDS: protocol negotiation fails during reconnect X-Git-Tag: v4.1.12-92~293^2^2~45 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=da6b3c6610e40bcda65d5a1727ed71ac95a389be;p=users%2Fjedix%2Flinux-maple.git RDS: protocol negotiation fails during reconnect RDS fails to realize the negotiated version and keeps rejecting the peer's connect request, causing the connection to stall during reconnect. Orabug: 17375389 Signed-off-by: Giri Adari (cherry picked from commit 34a2edd27ec65cbeb003a3d2e22cb6da57e90798) --- diff --git a/net/rds/ib_cm.c b/net/rds/ib_cm.c index 8be0141b4b56..083425602e0d 100644 --- a/net/rds/ib_cm.c +++ b/net/rds/ib_cm.c @@ -732,7 +732,7 @@ int rds_ib_cm_handle_connect(struct rdma_cm_id *cm_id, goto out; } - if (conn->c_reconnect && (conn->c_version != version)) { + if (conn->c_reconnect && (conn->c_version > version)) { printk(KERN_WARNING "RDS/IB: connection " "<%u.%u.%u.%u,%u.%u.%u.%u,%d,%u.%u> rejecting version " "(%u/%u)\n", diff --git a/net/rds/rdma_transport.c b/net/rds/rdma_transport.c index 812d1da86d7d..a97c862aa54b 100644 --- a/net/rds/rdma_transport.c +++ b/net/rds/rdma_transport.c @@ -186,7 +186,8 @@ int rds_rdma_cm_event_handler(struct rdma_cm_id *cm_id, case RDMA_CM_EVENT_REJECTED: err = (int *)event->param.conn.private_data; if (conn) { - if (!conn->c_reconnect) { + if (!conn->c_reconnect || conn->c_committed_version == + RDS_PROTOCOL_COMPAT_VERSION) { if ((*err) == 0 && event->status == RDS_REJ_CONSUMER_DEFINED) { /* rejection from 3.x protocol */ diff --git a/net/rds/rds.h b/net/rds/rds.h index 0e1eb2dfd109..7c1a06ea2b45 100644 --- a/net/rds/rds.h +++ b/net/rds/rds.h @@ -142,6 +142,7 @@ struct rds_connection { /* Protocol version */ unsigned int c_proposed_version; + unsigned int c_committed_version; unsigned int c_version; /* Re-connect stall diagnostics */ diff --git a/net/rds/threads.c b/net/rds/threads.c index c9a4ba55cb45..01a864ea3bb0 100644 --- a/net/rds/threads.c +++ b/net/rds/threads.c @@ -99,6 +99,8 @@ void rds_connect_complete(struct rds_connection *conn) conn->c_connection_start = get_seconds(); conn->c_reconnect = 1; + conn->c_committed_version = conn->c_version; + conn->c_proposed_version = RDS_PROTOCOL_VERSION; } EXPORT_SYMBOL_GPL(rds_connect_complete);