Skip to contentSkip to conversation

RDMA/rtrs-clt: Don't WARN on unexpected info-response opcode

PATCH Applied Quanye Yang 4 participants 4 messages Sep 22 – Sep 28

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 RDMA/rtrs-clt: Don't WARN on unexpected info-response opcode

The info-response receive is posted for a SEND. The completion opcode comes from the peer, so RDMA WRITE with Immediate is a legal WC on that WQE even though it violates the RTRS handshake.

WARN_ON(wc->opcode != IB_WC_RECV) treats that peer-controlled field as an internal invariant and panics with panic_on_warn. Treat a non-SEND completion as a handshake failure: log it and keep the existing CONNECTING_ERR cleanup.

---
 drivers/infiniband/ulp/rtrs/rtrs-clt.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/infiniband/ulp/rtrs/rtrs-clt.c +6 -1
index eac38b57b00d..3c23c27725a5 100644
@@ -2514,7 +2514,12 @@ static void rtrs_clt_info_rsp_done(struct ib_cq *cq, struct ib_wc *wc)
 			  ib_wc_status_msg(wc->status));
 		goto out;
 	}
-	WARN_ON(wc->opcode != IB_WC_RECV);
+	if (wc->opcode != IB_WC_RECV) {
+		rtrs_err(clt_path->clt,
+			 "Path info response has unexpected opcode %d\n",
+			 wc->opcode);
+		goto out;
+	}
 
 	if (wc->byte_len < sizeof(*msg)) {
 		rtrs_err(clt_path->clt, "Path info response is malformed: size %d\n",

---
base-commit: 93f51579e7df248780214094418f205253383cc5
change-id: 20260921-rtrs-fix-rtrs-clt-info-rsp-done-3e5d47cfdc44

Best regards,

Signature · 1 line
Quanye Yang <[email protected]>
#1 lore raw
Sashiko has reviewed this patch and found no issues. It looks great!
Quoted 11 lines

From: Quanye Yang <[email protected]>

The info-response receive is posted for a SEND. The completion opcode comes from the peer, so RDMA WRITE with Immediate is a legal WC on that WQE even though it violates the RTRS handshake.

WARN_ON(wc->opcode != IB_WC_RECV) treats that peer-controlled field as an internal invariant and panics with panic_on_warn. Treat a non-SEND completion as a handshake failure: log it and keep the existing CONNECTING_ERR cleanup.

Quoted 4 lines

Sashiko has reviewed this patch and found no issues. It looks great!

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/20260921-rtrs-fix-rtrs-clt-info-rsp-done-v1-1-c64281ed97c0@proton.me?part=1
Reviewed-by on v1 1/1
#2 lore raw
In reply to Quanye Yang
Quoted 30 lines · On Tue, Sep 22, 2026 at 6:25 AM Quanye Yang via B4 Relay…

From: Quanye Yang <[email protected]>

The info-response receive is posted for a SEND. The completion opcode comes from the peer, so RDMA WRITE with Immediate is a legal WC on that WQE even though it violates the RTRS handshake.

WARN_ON(wc->opcode != IB_WC_RECV) treats that peer-controlled field as an internal invariant and panics with panic_on_warn. Treat a non-SEND completion as a handshake failure: log it and keep the existing CONNECTING_ERR cleanup.

---
 drivers/infiniband/ulp/rtrs/rtrs-clt.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/infiniband/ulp/rtrs/rtrs-clt.c +1 -1
index eac38b57b00d..3c23c27725a5 100644
@@ -2514,7 +2514,12 @@ static void rtrs_clt_info_rsp_done(struct ib_cq *cq, struct ib_wc *wc)
                          ib_wc_status_msg(wc->status));
                goto out;
        }
-       WARN_ON(wc->opcode != IB_WC_RECV);
+       if (wc->opcode != IB_WC_RECV) {

drivers/infiniband/ulp/rtrs/rtrs-clt.c static void rtrs_clt_info_rsp_done(struct ib_cq *cq, struct ib_wc *wc)

Quoted 10 lines
drivers/infiniband/ulp/rtrs/rtrs-clt.c +5 -1
+               rtrs_err(clt_path->clt,
+                        "Path info response has unexpected opcode %d\n",
+                        wc->opcode);
+               goto out;
+       }
 
        if (wc->byte_len < sizeof(*msg)) {
                rtrs_err(clt_path->clt, "Path info response is malformed: size %d\n",
 
---

lgtm,

Quoted 8 lines

base-commit: 93f51579e7df248780214094418f205253383cc5
change-id: 20260921-rtrs-fix-rtrs-clt-info-rsp-done-3e5d47cfdc44

Best regards,
--
Quanye Yang <[email protected]>

maintainer Applied
#3 lore raw
In reply to Quanye Yang
Quoted 11 lines · Quanye Yang

From: Quanye Yang <[email protected]>

The info-response receive is posted for a SEND. The completion opcode comes from the peer, so RDMA WRITE with Immediate is a legal WC on that WQE even though it violates the RTRS handshake.

WARN_ON(wc->opcode != IB_WC_RECV) treats that peer-controlled field as an internal invariant and panics with panic_on_warn. Treat a non-SEND completion as a handshake failure: log it and keep the existing CONNECTING_ERR cleanup.

Quoted 8 lines
---
 drivers/infiniband/ulp/rtrs/rtrs-clt.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Applied to for-next

Thanks,
Jason