[openib-general] [Bug 172] New: Need an interface to load alternate path to RC QP
bugzilla-daemon at openib.org
bugzilla-daemon at openib.org
Mon Jul 10 16:55:32 PDT 2006
http://openib.org/bugzilla/show_bug.cgi?id=172
Summary: Need an interface to load alternate path to RC QP
Product: OpenFabrics Linux
Version: gen2
Platform: All
OS/Version: All
Status: NEW
Severity: critical
Priority: P2
Component: IB Core
AssignedTo: bugzilla at openib.org
ReportedBy: venkatesh.babu at 3leafnetworks.com
RC QP can be initially setup with primary and alternate paths, but after the
failover to load a new alternate path ib_modify_qp() needs to be used. This
interface requires address handle (struct ib_ah_attr) of the alternate path.
The user needs to get a address handle for the alternate path record (struct
ib_sa_path_rec). Only CM's internal function cm_init_av_by_path() can do this
and also initialize its internal data structure alt_av field of struct
cm_id_private.
So new interface needs to be defined to get this functionality.
I have implemented this interface similar to ib_cm_init_qp_attr() and tested
it.
I can simulate the failover back and forth between the two ports couple of
time.
*** cm.c 2006-09-30 15:52:44.000000000 -0700
---
/root/src/OFED-1.0/SOURCES/openib-1.0.orig/src/linux-kernel/infiniband/core/cm.c
2006-05-15 10:07:01.000000000 -0700
***************
*** 3241,3286 ****
}
EXPORT_SYMBOL(ib_cm_init_qp_attr);
- int ib_cm_init_rearm_attr(struct ib_cm_id *cm_id,
- struct ib_qp_attr *qp_attr,
- int *qp_attr_mask,
- struct ib_sa_path_rec *alternate_path)
- {
- struct cm_id_private *cm_id_priv;
- unsigned long flags;
- int ret;
-
- cm_id_priv = container_of(cm_id, struct cm_id_private, id);
-
- if (alternate_path) {
- ret = cm_init_av_by_path(alternate_path, &cm_id_priv->alt_av);
- if (ret)
- return ret;
- }
-
- spin_lock_irqsave(&cm_id_priv->lock, flags);
- switch (cm_id_priv->id.state) {
- case IB_CM_ESTABLISHED:
- if (cm_id_priv->alt_av.ah_attr.dlid) {
- qp_attr->alt_port_num =
- cm_id_priv->alt_av.port->port_num;
- qp_attr->alt_ah_attr = cm_id_priv->alt_av.ah_attr;
- qp_attr->path_mig_state = IB_MIG_REARM;
-
- *qp_attr_mask = IB_QP_ALT_PATH | IB_QP_PATH_MIG_STATE;
- }
- ret = 0;
- break;
- default:
- ret = -EINVAL;
- break;
- }
- spin_unlock_irqrestore(&cm_id_priv->lock, flags);
-
- return ret;
- }
- EXPORT_SYMBOL(ib_cm_init_rearm_attr);
-
static void cm_add_one(struct ib_device *device)
{
struct cm_device *cm_dev;
--- 3239,3244 ----
*** ib_cm.h 2006-09-30 16:05:05.000000000 -0700
---
/root/src/OFED-1.0/SOURCES/openib-1.0.orig/src/linux-kernel/infiniband/include/rdma/ib_cm.h
2006-04-10 10:50:19.000000000 -0700
***************
*** 521,547 ****
int *qp_attr_mask);
/**
- * ib_cm_init_rearm_attr - Initializes the QP attributes for use in
- * transitioning to rearm state.
- * @cm_id: Communication identifier associated with the QP attributes to
- * initialize.
- * @qp_attr: On input, specifies the desired QP state. On output, the
- * mandatory and desired optional attributes will be set in order to
- * modify the QP to the specified state.
- * @qp_attr_mask: The QP attribute mask that may be used to transition the
- * QP to the specified state.
- * @alternate_path: Rearm the QP with this alternate path.
- *
- * This call will set all required attributes for the given transition, along
- * with known optional attributes. Users may override the attributes
returned- * from this call before calling ib_modify_qp.
- */
- int ib_cm_init_rearm_attr(struct ib_cm_id *cm_id,
- struct ib_qp_attr *qp_attr,
- int *qp_attr_mask,
- struct ib_sa_path_rec *alternate_path);
-
- /**
* ib_send_cm_apr - Sends an alternate path response message in response to
* a load alternate path request.
* @cm_id: Connection identifier associated with the alternate path response.
--- 521,526 ----
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
More information about the general
mailing list