diff mbox series

[V2,rdma-core,1/2] libhns: Add local invalidate MR support for hip08

Message ID 1539269176-144961-2-git-send-email-oulijun@huawei.com (mailing list archive)
State Accepted
Headers show
Series two misc fixes for libhns | expand

Commit Message

Lijun Ou Oct. 11, 2018, 2:46 p.m. UTC
This patch adds local invalidate memory region (MR) support
in the user space driver.

Signed-off-by: Yangyang Li <liyangyang20@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
---
 providers/hns/hns_roce_u_hw_v2.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
diff mbox series

Patch

diff --git a/providers/hns/hns_roce_u_hw_v2.c b/providers/hns/hns_roce_u_hw_v2.c
index 4d1bd6c..1efd97f 100644
--- a/providers/hns/hns_roce_u_hw_v2.c
+++ b/providers/hns/hns_roce_u_hw_v2.c
@@ -687,6 +687,16 @@  static int hns_roce_u_v2_post_send(struct ibv_qp *ibvqp, struct ibv_send_wr *wr,
 					HNS_ROCE_WQE_OP_SEND_WITH_IMM);
 				break;
 
+			case IBV_WR_LOCAL_INV:
+				roce_set_field(rc_sq_wqe->byte_4,
+					       RC_SQ_WQE_BYTE_4_OPCODE_M,
+					       RC_SQ_WQE_BYTE_4_OPCODE_S,
+					       HNS_ROCE_WQE_OP_LOCAL_INV);
+				roce_set_bit(rc_sq_wqe->byte_4,
+					     RC_SQ_WQE_BYTE_4_SO_S, 1);
+				rc_sq_wqe->inv_key =
+						htole32(wr->invalidate_rkey);
+				break;
 			case IBV_WR_ATOMIC_CMP_AND_SWP:
 				roce_set_field(rc_sq_wqe->byte_4,
 					RC_SQ_WQE_BYTE_4_OPCODE_M,