Thread (1 message) 1 message, 1 author, 2012-09-20
DORMANTno replies

[PATCH libmlx4 8/8] When calling ibv_modify_qp() return right value

From: Or Gerlitz <hidden>
Date: 2012-09-20 20:31:07
Subsystem: the rest · Maintainer: Linus Torvalds

From: Dotan Barak <redacted>

When the ibv_query_port() call made by mlx4_modify_qp() fails, the return
value from the latter should indicate the error status of the former and
not simply -1.

Signed-off-by: Dotan Barak <redacted>
Signed-off-by: Or Gerlitz <ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
---
 src/verbs.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/verbs.c b/src/verbs.c
index f629275..fb73fdc 100644
--- a/src/verbs.c
+++ b/src/verbs.c
@@ -534,8 +534,10 @@ int mlx4_modify_qp(struct ibv_qp *qp, struct ibv_qp_attr *attr,
 	int ret;
 
 	if (attr_mask & IBV_QP_PORT) {
-		if (ibv_query_port(qp->pd->context, attr->port_num, &port_attr))
-			return -1;
+		ret = ibv_query_port(qp->pd->context, attr->port_num,
+				     &port_attr);
+		if (ret)
+			return ret;
 		mqp->link_layer = port_attr.link_layer;
 	}
 
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help