]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
RDS: Fix a bug in QoS protocol negotiation
authorBang Nguyen <bang.nguyen@oracle.com>
Fri, 19 Jul 2013 17:28:26 +0000 (10:28 -0700)
committerMukesh Kacker <mukesh.kacker@oracle.com>
Wed, 8 Jul 2015 20:59:38 +0000 (13:59 -0700)
 Fix bug that may cause the connection to downgrade to lower
 protocol. Also, don't negotiate protocol on reconnect.

Orabug: 17079972

Signed-off-by: Giri adari <giri.adari@oracle.com>
(cherry picked from commit 4962a6def99ce1b80212198ebc96700a51dee694)

net/rds/connection.c
net/rds/ib_cm.c
net/rds/rdma_transport.c

index e21fc5f0a9dcbd9f08811b1a8f8f17151d18fc3a..069ffcf1002b9e48155686b74e0f204fb81b0420 100644 (file)
@@ -589,11 +589,20 @@ void rds_conn_drop(struct rds_connection *conn)
                conn->c_reconnect_warn = 1;
                conn->c_reconnect_drops = 0;
                conn->c_reconnect_err = 0;
+               printk(KERN_INFO "RDS/IB: connection "
+                       "<%u.%u.%u.%u,%u.%u.%u.%u,%d> dropped\n",
+                       NIPQUAD(conn->c_laddr),
+                       NIPQUAD(conn->c_faddr),
+                       conn->c_tos);
        } else if ((conn->c_reconnect_warn) &&
                   (now - conn->c_reconnect_start > 60)) {
-               printk(KERN_INFO "RDS/IB: re-connect to %u.%u.%u.%u is "
-                       "stalling for more than 1 min...(drops=%u err=%d)\n",
-                       NIPQUAD(conn->c_faddr), conn->c_reconnect_drops,
+               printk(KERN_INFO "RDS/IB: re-connect "
+                       "<%u.%u.%u.%u,%u.%u.%u.%u,%d> stalling "
+                       "for more than 1 min...(drops=%u err=%d)\n",
+                       NIPQUAD(conn->c_laddr),
+                       NIPQUAD(conn->c_faddr),
+                       conn->c_tos,
+                       conn->c_reconnect_drops,
                        conn->c_reconnect_err);
                conn->c_reconnect_warn = 0;
        }
index 8ef5e4498b0a96f207d5398ce90a3a998ad0cb3d..ccb5d7f1791c2e55c885fb737db2c7f4429a14c7 100644 (file)
@@ -728,6 +728,22 @@ int rds_ib_cm_handle_connect(struct rdma_cm_id *cm_id,
                goto out;
        }
 
+       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",
+                       NIPQUAD(conn->c_laddr),
+                       NIPQUAD(conn->c_faddr),
+                       conn->c_tos,
+                       RDS_PROTOCOL_MAJOR(conn->c_version),
+                       RDS_PROTOCOL_MINOR(conn->c_version),
+                       RDS_PROTOCOL_MAJOR(version),
+                       RDS_PROTOCOL_MINOR(version));
+
+               conn = NULL;
+               goto out;
+       }
+
        /*
         * The connection request may occur while the
         * previous connection exist, e.g. in case of failover.
@@ -759,9 +775,12 @@ int rds_ib_cm_handle_connect(struct rdma_cm_id *cm_id,
                         */
                        if (now > conn->c_connection_start &&
                            now - conn->c_connection_start > 15) {
-                               printk(KERN_CRIT "rds connection racing for 15s, forcing reset "
-                                       "connection %u.%u.%u.%u->%u.%u.%u.%u\n",
-                                       NIPQUAD(conn->c_laddr), NIPQUAD(conn->c_faddr));
+                               printk(KERN_CRIT "RDS/IB: connection "
+                                       "<%u.%u.%u.%u,%u.%u.%u.%u,%d> "
+                                       "racing for 15s, forcing reset ",
+                                       NIPQUAD(conn->c_laddr),
+                                       NIPQUAD(conn->c_faddr),
+                                       conn->c_tos);
                                rds_conn_drop(conn);
                                rds_ib_stats_inc(s_ib_listen_closed_stale);
                        } else {
@@ -851,7 +870,7 @@ int rds_ib_cm_initiate_connect(struct rdma_cm_id *cm_id)
 
        /* If the peer doesn't do protocol negotiation, we must
         * default to RDSv3.0 */
-       rds_ib_set_protocol(conn, RDS_PROTOCOL_4_0);
+       rds_ib_set_protocol(conn, RDS_PROTOCOL_4_1);
        ic->i_flowctl = rds_ib_sysctl_flow_control;     /* advertise flow control */
 
        ret = rds_ib_setup_qp(conn);
index f7f87bb83b1602b3448cf50036955e53a95a6cc2..407e13166deb13122b7333098b1e1aa56b5f1b50 100644 (file)
@@ -40,7 +40,7 @@
 #include <net/sock.h>
 #include <net/inet_common.h>
 
-#define RDS_IB_REJ_CONSUMER_DEFINED 28
+#define RDS_REJ_CONSUMER_DEFINED 28
 
 static struct rdma_cm_id *rds_iw_listen_id;
 
@@ -186,18 +186,22 @@ 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 ((*err) == 0 &&
-                               event->status == RDS_IB_REJ_CONSUMER_DEFINED) {
-                               /* rejection from 3.x protocol */
-                               if (!conn->c_tos) {
-                                       /* retry the connect with a
-                                        * lower compatible protocol */
+                       if (!conn->c_reconnect) {
+                               if ((*err) == 0 &&
+                                       event->status == RDS_REJ_CONSUMER_DEFINED) {
+                                       /* rejection from 3.x protocol */
+                                       if (!conn->c_tos) {
+                                               /* retry the connect with a
+                                                  lower compatible protocol */
+                                               conn->c_proposed_version =
+                                                       RDS_PROTOCOL_COMPAT_VERSION;
+                                       }
+                               } else {
                                        conn->c_proposed_version =
-                                               RDS_PROTOCOL_COMPAT_VERSION;
-                                       rds_conn_drop(conn);
+                                               RDS_PROTOCOL_VERSION;
                                }
-                       } else
-                               rds_conn_drop(conn);
+                       }
+                       rds_conn_drop(conn);
                }
                break;