Skip to contentSkip to conversation

IB/rdmavt: Eliminate redundant opcode test in mr ref clear

PATCH Applied ira.weiny 2 participants 2 messages Jul 28, 2016 – Aug 3, 2016 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

ira.weiny

author
#0 lore raw

PATCH 1/1 IB/rdmavt: Eliminate redundant opcode test in mr ref clear

The use of the specific opcode test is redundant since all ack entry users correctly manipulate the mr pointer to selectively trigger the reference clearing.

The overly specific test hinders the use of implementation specific operations.

The change needs to get rid of the union to insure that an atomic value is not seen as an MR pointer.

---
 drivers/infiniband/sw/rdmavt/qp.c |  3 +--
 include/rdma/rdmavt_qp.h          | 10 ++++------
 2 files changed, 5 insertions(+), 8 deletions(-)
drivers/infiniband/sw/rdmavt/qp.c +1 -2
index 8ccf1b970b2c..bdb540f25a88 100644
@@ -435,8 +435,7 @@ static void rvt_clear_mr_refs(struct rvt_qp *qp, int clr_sends)
 	for (n = 0; n < rvt_max_atomic(rdi); n++) {
 		struct rvt_ack_entry *e = &qp->s_ack_queue[n];
 
-		if (e->opcode == IB_OPCODE_RC_RDMA_READ_REQUEST &&
-		    e->rdma_sge.mr) {
+		if (e->rdma_sge.mr) {
 			rvt_put_mr(e->rdma_sge.mr);
 			e->rdma_sge.mr = NULL;
 		}
include/rdma/rdmavt_qp.h +4 -6
index 13902dd319a9..bd34d0b56bf7 100644
@@ -222,14 +222,12 @@ struct rvt_mmap_info {
  * to send a RDMA read response or atomic operation.
  */
 struct rvt_ack_entry {
-	u8 opcode;
-	u8 sent;
+	struct rvt_sge rdma_sge;
+	u64 atomic_data;
 	u32 psn;
 	u32 lpsn;
-	union {
-		struct rvt_sge rdma_sge;
-		u64 atomic_data;
-	};
+	u8 opcode;
+	u8 sent;
 };
 
 #define	RC_QP_SCALING_INTERVAL	5
Signature · 6 lines
1.8.2

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 20160728010735.GB3158-W4f6Xiosr+yv7QzWx2u06xL4W9x8LtSr@public.gmane.org

Applied
#2 lore raw
Quoted 7 lines · ira.weiny

The use of the specific opcode test is redundant since all ack entry users correctly manipulate the mr pointer to selectively trigger the reference clearing.

The overly specific test hinders the use of implementation specific operations.

Quoted 7 lines

The change needs to get rid of the union to insure that an atomic value is not seen as an MR pointer.

Thanks, applied.

Signature · 2 lines
Doug Ledford <[email protected]>
              GPG KeyID: 0E572FDD