[azure][PATCH] RDMA/core: Initialize port_num in qp_attr

Marcelo Henrique Cerri marcelo.cerri at canonical.com
Fri Aug 11 18:40:16 UTC 2017

From: Ismail, Mustafa <mustafa.ismail at intel.com>

BugLink: http://bugs.launchpad.net/bugs/1709681

Initialize the port_num for iWARP in rdma_init_qp_attr.

Fixes: 5ecce4c9b17b("Check port number supplied by user verbs cmds")
Cc: <stable at vger.kernel.org> # v2.6.14+
Reviewed-by: Steve Wise <swise at opengridcomputing.com>
Signed-off-by: Mustafa Ismail <mustafa.ismail at intel.com>
Tested-by: Mike Marciniszyn <mike.marciniszyn at intel.com>
Signed-off-by: Doug Ledford <dledford at redhat.com>
(cherry picked from commit a62ab66b13a0f9bcb17b7b761f6670941ed5cd62)
Signed-off-by: Marcelo Henrique Cerri <marcelo.cerri at canonical.com>
 drivers/infiniband/core/cma.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c
index acd10d666f1c..087e9a7ca326 100644
--- a/drivers/infiniband/core/cma.c
+++ b/drivers/infiniband/core/cma.c
@@ -1043,6 +1043,8 @@ int rdma_init_qp_attr(struct rdma_cm_id *id, struct ib_qp_attr *qp_attr,
 		} else
 			ret = iw_cm_init_qp_attr(id_priv->cm_id.iw, qp_attr,
+		qp_attr->port_num = id_priv->id.port_num;
+		*qp_attr_mask |= IB_QP_PORT;
 	} else
 		ret = -ENOSYS;

More information about the kernel-team mailing list