[ofw] PATCH: Fix Support for APM on the low level drivers

Tzachi Dar tzachid at mellanox.co.il
Wed Sep 16 08:28:53 PDT 2009


Signed off by: leonid at mellanox.co.il

[HW] fixes to APM support: missed some lines and apm_state was not
converted into low-driver format

Index: Q:/projinf4/trunk/hw/mlx4/kernel/hca/data.c
===================================================================
--- Q:/projinf4/trunk/hw/mlx4/kernel/hca/data.c (revision 4811)
+++ Q:/projinf4/trunk/hw/mlx4/kernel/hca/data.c (revision 4812)
@@ -551,6 +551,14 @@
  return ib_qps;
 }
 
+enum ib_mig_state to_apm_state(ib_apm_state_t apm)
+{
+ if (apm == IB_APM_MIGRATED) return IB_MIG_MIGRATED;
+ if (apm == IB_APM_REARM) return IB_MIG_REARM;
+ if (apm == IB_APM_ARMED) return IB_MIG_ARMED;
+ return 0xffffffff;
+}
+
 ib_api_status_t
 to_qp_attr(
  IN  const struct ib_qp *p_ib_qp,
@@ -794,7 +802,7 @@
     // IB_QP_PATH_MIG_STATE
     if (p_ib_qp_mod->state.rts.opts & IB_MOD_QP_APM_STATE) {
      *p_qp_attr_mask |= IB_QP_PATH_MIG_STATE; 
-     p_ib_qp_attr->path_mig_state =  p_ib_qp_mod->state.rts.apm_state;
+     p_ib_qp_attr->path_mig_state =
to_apm_state(p_ib_qp_mod->state.rts.apm_state);
     }
 
     // IB_QP_ACCESS_FLAGS
@@ -812,7 +820,8 @@
       status = IB_ERROR;
       break;
      }
-     p_ib_qp_attr->alt_timeout   =
p_ib_qp_mod->state.rts.alternate_av.conn.local_ack_timeout; // XXX: conv
+     p_ib_qp_attr->alt_timeout  =
p_ib_qp_mod->state.rts.alternate_av.conn.local_ack_timeout; // XXX: conv
+     p_ib_qp_attr->alt_port_num  =
p_ib_qp_mod->state.rts.alternate_av.port_num;
     }
     break;
     
@@ -841,7 +850,7 @@
     // IB_QP_PATH_MIG_STATE
     if (p_ib_qp_mod->state.rts.opts & IB_MOD_QP_APM_STATE) {
      *p_qp_attr_mask |= IB_QP_PATH_MIG_STATE; 
-     p_ib_qp_attr->path_mig_state =  p_ib_qp_mod->state.rts.apm_state;
+     p_ib_qp_attr->path_mig_state =
to_apm_state(p_ib_qp_mod->state.rts.apm_state);
     }
 
     // IB_QP_ACCESS_FLAGS
@@ -859,6 +868,8 @@
       status = IB_ERROR;
       break;
      }
+     p_ib_qp_attr->alt_timeout  =
p_ib_qp_mod->state.rts.alternate_av.conn.local_ack_timeout; // XXX: conv
+     p_ib_qp_attr->alt_port_num  =
p_ib_qp_mod->state.rts.alternate_av.port_num;
     }
     break;
      
Index: Q:/projinf4/trunk/hw/mthca/kernel/hca_data.c
===================================================================
--- Q:/projinf4/trunk/hw/mthca/kernel/hca_data.c (revision 4811)
+++ Q:/projinf4/trunk/hw/mthca/kernel/hca_data.c (revision 4812)
@@ -409,6 +409,14 @@
  return qps;
 }
 
+enum ib_mig_state to_apm_state(ib_apm_state_t apm)
+{
+ if (apm == IB_APM_MIGRATED) return IB_MIG_MIGRATED;
+ if (apm == IB_APM_REARM) return IB_MIG_REARM;
+ if (apm == IB_APM_ARMED) return IB_MIG_ARMED;
+ return 0xffffffff;
+}
+
 ib_api_status_t
 mlnx_conv_qp_modify_attr(
  IN  const struct ib_qp *ib_qp_p,
@@ -644,7 +652,7 @@
     // IB_QP_PATH_MIG_STATE
     if (modify_attr_p->state.rts.opts & IB_MOD_QP_APM_STATE) {
      *qp_attr_mask_p |= IB_QP_PATH_MIG_STATE; 
-     qp_attr_p->path_mig_state =  modify_attr_p->state.rts.apm_state;
+     qp_attr_p->path_mig_state =
to_apm_state(modify_attr_p->state.rts.apm_state);
     }
 
     // IB_QP_ACCESS_FLAGS
@@ -691,7 +699,7 @@
     // IB_QP_PATH_MIG_STATE
     if (modify_attr_p->state.rts.opts & IB_MOD_QP_APM_STATE) {
      *qp_attr_mask_p |= IB_QP_PATH_MIG_STATE; 
-     qp_attr_p->path_mig_state =  modify_attr_p->state.rts.apm_state;
+     qp_attr_p->path_mig_state =
to_apm_state(modify_attr_p->state.rts.apm_state);
     }
 
     // IB_QP_ACCESS_FLAGS


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20090916/b2825b31/attachment.html>


More information about the ofw mailing list