[ofa-general] [RFC PATCH 3/4] rdma/cma: add high availability mode attribute to IDs
Or Gerlitz
ogerlitz at voltaire.com
Tue May 13 07:13:14 PDT 2008
RDMA_ALIGN_WITH_NETDEVICE high availability (ha) mode means that the consumer
of the rdma-cm wants that RDMA sessions would always use the same links (eg <hca/port>)
as the IP stack does. In the current code, this does not happen when bonding did
fail-over but the IB link used by an already existing session is operating fine.
For now this mode is supported only for the connected services of the rdma-cm.
More ha modes can be added in the future.
Signed-off-by: Or Gerlitz <ogerlitz at voltaire.com>
Index: linux-2.6.26-rc2/drivers/infiniband/core/addr.c
===================================================================
Index: linux-2.6.26-rc2/include/rdma/rdma_cm.h
===================================================================
--- linux-2.6.26-rc2.orig/include/rdma/rdma_cm.h 2008-04-17 05:49:44.000000000 +0300
+++ linux-2.6.26-rc2/include/rdma/rdma_cm.h 2008-05-13 13:52:53.000000000 +0300
@@ -328,4 +328,10 @@ void rdma_leave_multicast(struct rdma_cm
*/
void rdma_set_service_type(struct rdma_cm_id *id, int tos);
+enum rdma_ha_mode {
+ RDMA_ALIGN_WITH_NETDEVICE = 1
+};
+
+int rdma_set_high_availability_mode(struct rdma_cm_id *id, enum rdma_ha_mode mode);
+
#endif /* RDMA_CM_H */
Index: linux-2.6.26-rc2/drivers/infiniband/core/cma.c
===================================================================
--- linux-2.6.26-rc2.orig/drivers/infiniband/core/cma.c 2008-05-13 11:57:02.000000000 +0300
+++ linux-2.6.26-rc2/drivers/infiniband/core/cma.c 2008-05-13 14:57:12.000000000 +0300
@@ -143,6 +143,7 @@ struct rdma_id_private {
u32 qp_num;
u8 srq;
u8 tos;
+ enum rdma_ha_mode ha_mode;
};
struct cma_multicast {
@@ -1523,6 +1524,19 @@ void rdma_set_service_type(struct rdma_c
}
EXPORT_SYMBOL(rdma_set_service_type);
+int rdma_set_high_availability_mode(struct rdma_cm_id *id, enum rdma_ha_mode mode)
+{
+ struct rdma_id_private *id_priv;
+
+ if ((mode == RDMA_ALIGN_WITH_NETDEVICE) && cma_is_ud_ps(id->ps))
+ return -ENOTSUPP;
+
+ id_priv = container_of(id, struct rdma_id_private, id);
+ id_priv->ha_mode = mode;
+ return 0;
+}
+EXPORT_SYMBOL(rdma_set_high_availability_mode);
+
static void cma_query_handler(int status, struct ib_sa_path_rec *path_rec,
void *context)
{
More information about the general
mailing list