]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
RDS: IB: Remove unused PATH migration event code
authorSantosh Shilimkar <santosh.shilimkar@oracle.com>
Fri, 22 Jul 2016 18:45:24 +0000 (11:45 -0700)
committerSantosh Shilimkar <santosh.shilimkar@oracle.com>
Wed, 12 Oct 2016 17:20:24 +0000 (10:20 -0700)
These events were used for APM which is removed already from the code.
Remove this remainder '#if 0' code and migrate handler.

Orabug: 22347191

Tested-by: Michael Nowak <michael.nowak@oracle.com>
Tested-by: Rafael Alejandro Peralez <rafael.peralez@oracle.com>
Tested-by: Liwen Huang <liwen.huang@oracle.com>
Tested-by: Hong Liu <hong.x.liu@oracle.com>
Reviewed-by: Mukesh Kacker <mukesh.kacker@oracle.com>
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
net/rds/ib.h
net/rds/ib_cm.c

index 95b7e857a2a5f00acee94e2ef18b1c1901da7196..fc71b8acda07819d64748cb61885645406cbb174 100644 (file)
@@ -139,11 +139,6 @@ struct rds_ib_path {
        union ib_gid    p_dgid;
 };
 
-struct rds_ib_migrate_work {
-       struct delayed_work             work;
-       struct rds_ib_connection        *ic;
-};
-
 struct rds_ib_rx_work {
        struct delayed_work             work;
        struct rds_ib_connection        *ic;
@@ -227,15 +222,7 @@ struct rds_ib_connection {
 
        struct completion       i_last_wqe_complete;
 
-#if 0
-       /* APM support */
-       struct rds_ib_path      i_pri_path;
-       struct rds_ib_path      i_cur_path;
-       unsigned int            i_alt_path_index;
-       unsigned long           i_last_migration;
-#endif
        /* Active Bonding */
-       struct rds_ib_migrate_work      i_migrate_w;
        unsigned int            i_active_side;
 
        int                     i_scq_vector;
index 36f6a7d7f568cfec9dd0340da4ae8eff0c554fa8..caa69911d7f2d43f647f0176fbdbf16634525e66 100644 (file)
@@ -574,47 +574,6 @@ static void rds_ib_qp_event_handler(struct ib_event *event, void *data)
        case IB_EVENT_QP_LAST_WQE_REACHED:
                complete(&ic->i_last_wqe_complete);
                break;
-       case IB_EVENT_PATH_MIG:
-#if 0
-               memcpy(&ic->i_cur_path.p_sgid,
-                       &ic->i_cm_id->route.path_rec[ic->i_alt_path_index].sgid,
-                       sizeof(union ib_gid));
-
-               memcpy(&ic->i_cur_path.p_dgid,
-                       &ic->i_cm_id->route.path_rec[ic->i_alt_path_index].dgid,
-                       sizeof(union ib_gid));
-
-               if (!memcmp(&ic->i_pri_path.p_sgid, &ic->i_cur_path.p_sgid,
-                               sizeof(union ib_gid)) &&
-                       !memcmp(&ic->i_pri_path.p_dgid, &ic->i_cur_path.p_dgid,
-                               sizeof(union ib_gid))) {
-                       printk(KERN_NOTICE
-                               "RDS/IB: connection "
-                               "<%u.%u.%u.%u,%u.%u.%u.%u,%d> migrated back to path "
-                               "<"RDS_IB_GID_FMT","RDS_IB_GID_FMT">\n",
-                               NIPQUAD(conn->c_laddr),
-                               NIPQUAD(conn->c_faddr),
-                               conn->c_tos,
-                               RDS_IB_GID_ARG(ic->i_cur_path.p_sgid),
-                               RDS_IB_GID_ARG(ic->i_cur_path.p_dgid));
-               } else {
-                       printk(KERN_NOTICE
-                               "RDS/IB: connection "
-                               "<%u.%u.%u.%u,%u.%u.%u.%u,%d> migrated over to path "
-                               "<"RDS_IB_GID_FMT","RDS_IB_GID_FMT">\n",
-                               NIPQUAD(conn->c_laddr),
-                               NIPQUAD(conn->c_faddr),
-                               conn->c_tos,
-                               RDS_IB_GID_ARG(ic->i_cur_path.p_sgid),
-                               RDS_IB_GID_ARG(ic->i_cur_path.p_dgid));
-               }
-               ic->i_last_migration = get_seconds();
-#endif
-
-               break;
-       case IB_EVENT_PATH_MIG_ERR:
-               rds_rtd(RDS_RTD_ERR, "RDS: Path migration error\n");
-               break;
        default:
                rds_rtd(RDS_RTD_ERR,
                        "Fatal QP Event %u (%s) - connection %pI4->%pI4 tos %d, reconnecting\n",
@@ -1136,44 +1095,6 @@ out:
        return ret;
 }
 
-static void rds_ib_migrate(struct work_struct *_work)
-{
-       struct rds_ib_migrate_work *work =
-               container_of(_work, struct rds_ib_migrate_work, work.work);
-       struct rds_ib_connection *ic = work->ic;
-       struct ib_qp_attr qp_attr;
-       struct ib_qp_init_attr  qp_init_attr;
-       enum ib_mig_state path_mig_state;
-       struct rdma_cm_id *cm_id = ic->i_cm_id;
-       int ret = 0;
-
-       if (!ic->i_active_side) {
-               ret = ib_query_qp(cm_id->qp, &qp_attr, IB_QP_PATH_MIG_STATE,
-                               &qp_init_attr);
-               if (ret) {
-                       printk(KERN_ERR "RDS/IB: failed to query QP\n");
-                       return;
-               }
-
-               path_mig_state = qp_attr.path_mig_state;
-               if (!path_mig_state) {
-                       printk(KERN_NOTICE
-                               "RDS/IB: Migration in progress..skip\n");
-                       return;
-               }
-
-               qp_attr.path_mig_state = 0;
-               ret = ib_modify_qp(cm_id->qp, &qp_attr, IB_QP_PATH_MIG_STATE);
-               if (ret) {
-                       printk(KERN_ERR "RDS/IB: failed to modify QP from %s"
-                               " to  MIGRATED state\n",
-                               (!path_mig_state) ? "MIGRATED" :
-                               (path_mig_state == 1) ? "REARM" :
-                       (path_mig_state == 2) ? "ARMED" : "UNKNOWN");
-               }
-       }
-}
-
 int rds_ib_conn_connect(struct rds_connection *conn)
 {
        struct rds_ib_connection *ic = conn->c_transport_data;
@@ -1413,7 +1334,6 @@ int rds_ib_conn_alloc(struct rds_connection *conn, gfp_t gfp)
 
        init_completion(&ic->i_last_wqe_complete);
 
-       INIT_DELAYED_WORK(&ic->i_migrate_w.work, rds_ib_migrate);
        INIT_DELAYED_WORK(&ic->i_rx_w.work, rds_ib_rx_handler);
 
        spin_lock_irqsave(&ib_nodev_conns_lock, flags);