Skip to contentSkip to conversation

RDMA: error code handling

PATCH In review Tong Zhang 3 participants 3 messages Aug 24, 2020 – Sep 9, 2020

Subsystems (2)
lore
Share & tools
lore

Tong Zhang

author
#0 lore raw

PATCH 1/1 RDMA: error code handling

ocrdma_qp_state_change() returns 1 when new and old state are the same, however caller is checking using <0

---
 drivers/infiniband/hw/ocrdma/ocrdma_verbs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c +1 -1
index c1751c9a0f62..518687c5e2cb 100644
@@ -1384,7 +1384,7 @@ int _ocrdma_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
 	/* if new and previous states are same hw doesn't need to
 	 * know about it.
 	 */
-	if (status < 0)
+	if (status == 1)
 		return status;
 	return ocrdma_mbx_modify_qp(dev, qp, attr, attr_mask);
 }
Signature · 1 line
2.25.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Tong Zhang

ocrdma_qp_state_change() returns 1 when new and old state are the same, however caller is checking using <0

---
 drivers/infiniband/hw/ocrdma/ocrdma_verbs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Fixes 057729cb2347 ("RDMA/ocrdma: Remove driver QP state machine")

Thanks,

maintainer
#2 lore raw
In reply to Tong Zhang
Quoted 11 lines · Tong Zhang

ocrdma_qp_state_change() returns 1 when new and old state are the same, however caller is checking using <0

 drivers/infiniband/hw/ocrdma/ocrdma_verbs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c +1 -0
index c1751c9a0f62..518687c5e2cb 100644
+++ b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c

drivers/infiniband/hw/ocrdma/ocrdma_verbs.c int _ocrdma_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, · line 1389

Quoted 7 lines
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c +1 -1
@@ -1384,7 +1384,7 @@ int _ocrdma_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
 	/* if new and previous states are same hw doesn't need to
 	 * know about it.
 	 */
-	if (status < 0)
+	if (status == 1)
 		return status;
 	return ocrdma_mbx_modify_qp(dev, qp, attr, attr_mask);

I'm not comfortable with this patch unless someone from Broadcom approves it.

Skipping the modify_qp just because the state is the same looks wrong to me in the first place, I would rather see the dead code removed as a no-change patch.

Jason