aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorParav Pandit <parav@mellanox.com>2018-06-19 03:59:18 -0400
committerJason Gunthorpe <jgg@mellanox.com>2018-06-25 16:19:57 -0400
commit815d456ef21a132b60ce67908d289235e9bb896c (patch)
tree53b372a38d13b5dc5d6d1378f121b0e2c7346c13
parent4ed13a5f2d606d2e6bcc5b8adbf08ed52e76cbb5 (diff)
IB/cm: Pass the sgid_attr through various events
Make the sgid_attr available along with path information to the event consumer, this allows the consumer to keep using the same GID table entry as the event is related to. Signed-off-by: Parav Pandit <parav@mellanox.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com> Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
-rw-r--r--drivers/infiniband/core/cm.c6
-rw-r--r--drivers/infiniband/core/cma.c3
-rw-r--r--include/rdma/ib_cm.h3
3 files changed, 10 insertions, 2 deletions
diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c
index fe1171226c13..00c90d4f27bb 100644
--- a/drivers/infiniband/core/cm.c
+++ b/drivers/infiniband/core/cm.c
@@ -3671,7 +3671,8 @@ error: spin_unlock_irqrestore(&cm_id_priv->lock, flags);
3671} 3671}
3672EXPORT_SYMBOL(ib_send_cm_sidr_rep); 3672EXPORT_SYMBOL(ib_send_cm_sidr_rep);
3673 3673
3674static void cm_format_sidr_rep_event(struct cm_work *work) 3674static void cm_format_sidr_rep_event(struct cm_work *work,
3675 const struct cm_id_private *cm_id_priv)
3675{ 3676{
3676 struct cm_sidr_rep_msg *sidr_rep_msg; 3677 struct cm_sidr_rep_msg *sidr_rep_msg;
3677 struct ib_cm_sidr_rep_event_param *param; 3678 struct ib_cm_sidr_rep_event_param *param;
@@ -3684,6 +3685,7 @@ static void cm_format_sidr_rep_event(struct cm_work *work)
3684 param->qpn = be32_to_cpu(cm_sidr_rep_get_qpn(sidr_rep_msg)); 3685 param->qpn = be32_to_cpu(cm_sidr_rep_get_qpn(sidr_rep_msg));
3685 param->info = &sidr_rep_msg->info; 3686 param->info = &sidr_rep_msg->info;
3686 param->info_len = sidr_rep_msg->info_length; 3687 param->info_len = sidr_rep_msg->info_length;
3688 param->sgid_attr = cm_id_priv->av.ah_attr.grh.sgid_attr;
3687 work->cm_event.private_data = &sidr_rep_msg->private_data; 3689 work->cm_event.private_data = &sidr_rep_msg->private_data;
3688} 3690}
3689 3691
@@ -3707,7 +3709,7 @@ static int cm_sidr_rep_handler(struct cm_work *work)
3707 ib_cancel_mad(cm_id_priv->av.port->mad_agent, cm_id_priv->msg); 3709 ib_cancel_mad(cm_id_priv->av.port->mad_agent, cm_id_priv->msg);
3708 spin_unlock_irq(&cm_id_priv->lock); 3710 spin_unlock_irq(&cm_id_priv->lock);
3709 3711
3710 cm_format_sidr_rep_event(work); 3712 cm_format_sidr_rep_event(work, cm_id_priv);
3711 cm_process_work(cm_id_priv, work); 3713 cm_process_work(cm_id_priv, work);
3712 return 0; 3714 return 0;
3713out: 3715out:
diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c
index de7d2501a740..f0eeb43b388f 100644
--- a/drivers/infiniband/core/cma.c
+++ b/drivers/infiniband/core/cma.c
@@ -3581,6 +3581,7 @@ static int cma_resolve_ib_udp(struct rdma_id_private *id_priv,
3581 id_priv->cm_id.ib = id; 3581 id_priv->cm_id.ib = id;
3582 3582
3583 req.path = id_priv->id.route.path_rec; 3583 req.path = id_priv->id.route.path_rec;
3584 req.sgid_attr = id_priv->id.route.addr.dev_addr.sgid_attr;
3584 req.service_id = rdma_get_service_id(&id_priv->id, cma_dst_addr(id_priv)); 3585 req.service_id = rdma_get_service_id(&id_priv->id, cma_dst_addr(id_priv));
3585 req.timeout_ms = 1 << (CMA_CM_RESPONSE_TIMEOUT - 8); 3586 req.timeout_ms = 1 << (CMA_CM_RESPONSE_TIMEOUT - 8);
3586 req.max_cm_retries = CMA_MAX_CM_RETRIES; 3587 req.max_cm_retries = CMA_MAX_CM_RETRIES;
@@ -3642,6 +3643,8 @@ static int cma_connect_ib(struct rdma_id_private *id_priv,
3642 if (route->num_paths == 2) 3643 if (route->num_paths == 2)
3643 req.alternate_path = &route->path_rec[1]; 3644 req.alternate_path = &route->path_rec[1];
3644 3645
3646 req.ppath_sgid_attr = id_priv->id.route.addr.dev_addr.sgid_attr;
3647 /* Alternate path SGID attribute currently unsupported */
3645 req.service_id = rdma_get_service_id(&id_priv->id, cma_dst_addr(id_priv)); 3648 req.service_id = rdma_get_service_id(&id_priv->id, cma_dst_addr(id_priv));
3646 req.qp_num = id_priv->qp_num; 3649 req.qp_num = id_priv->qp_num;
3647 req.qp_type = id_priv->id.qp_type; 3650 req.qp_type = id_priv->id.qp_type;
diff --git a/include/rdma/ib_cm.h b/include/rdma/ib_cm.h
index 7979cb04f529..c98d603c0b63 100644
--- a/include/rdma/ib_cm.h
+++ b/include/rdma/ib_cm.h
@@ -246,6 +246,7 @@ struct ib_cm_sidr_rep_event_param {
246 u32 qkey; 246 u32 qkey;
247 u32 qpn; 247 u32 qpn;
248 void *info; 248 void *info;
249 const struct ib_gid_attr *sgid_attr;
249 u8 info_len; 250 u8 info_len;
250}; 251};
251 252
@@ -365,6 +366,7 @@ struct ib_cm_id *ib_cm_insert_listen(struct ib_device *device,
365struct ib_cm_req_param { 366struct ib_cm_req_param {
366 struct sa_path_rec *primary_path; 367 struct sa_path_rec *primary_path;
367 struct sa_path_rec *alternate_path; 368 struct sa_path_rec *alternate_path;
369 const struct ib_gid_attr *ppath_sgid_attr;
368 __be64 service_id; 370 __be64 service_id;
369 u32 qp_num; 371 u32 qp_num;
370 enum ib_qp_type qp_type; 372 enum ib_qp_type qp_type;
@@ -566,6 +568,7 @@ int ib_send_cm_apr(struct ib_cm_id *cm_id,
566 568
567struct ib_cm_sidr_req_param { 569struct ib_cm_sidr_req_param {
568 struct sa_path_rec *path; 570 struct sa_path_rec *path;
571 const struct ib_gid_attr *sgid_attr;
569 __be64 service_id; 572 __be64 service_id;
570 int timeout_ms; 573 int timeout_ms;
571 const void *private_data; 574 const void *private_data;