Skip to content

Commit e93df01

Browse files
oulijunjgunthorpe
authored andcommitted
RDMA/hns: Support local invalidate for hip08 in kernel space
This patch adds local invalidate Memory Region (MR) support in the kernel space driver. Signed-off-by: Yangyang Li <liyangyang20@huawei.com> Signed-off-by: Lijun Ou <oulijun@huawei.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
1 parent 2362cce commit e93df01

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

drivers/infiniband/hw/hns/hns_roce_hw_v2.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,10 @@ static int hns_roce_v2_post_send(struct ib_qp *ibqp,
457457
break;
458458
case IB_WR_LOCAL_INV:
459459
hr_op = HNS_ROCE_V2_WQE_OP_LOCAL_INV;
460+
roce_set_bit(rc_sq_wqe->byte_4,
461+
V2_RC_SEND_WQE_BYTE_4_SO_S, 1);
462+
rc_sq_wqe->inv_key =
463+
cpu_to_le32(wr->ex.invalidate_rkey);
460464
break;
461465
case IB_WR_ATOMIC_CMP_AND_SWP:
462466
hr_op = HNS_ROCE_V2_WQE_OP_ATOM_CMP_AND_SWAP;
@@ -1722,7 +1726,7 @@ static int hns_roce_v2_write_mtpt(void *mb_buf, struct hns_roce_mr *mr,
17221726

17231727
roce_set_bit(mpt_entry->byte_8_mw_cnt_en, V2_MPT_BYTE_8_RA_EN_S, 0);
17241728
roce_set_bit(mpt_entry->byte_8_mw_cnt_en, V2_MPT_BYTE_8_R_INV_EN_S, 1);
1725-
roce_set_bit(mpt_entry->byte_8_mw_cnt_en, V2_MPT_BYTE_8_L_INV_EN_S, 0);
1729+
roce_set_bit(mpt_entry->byte_8_mw_cnt_en, V2_MPT_BYTE_8_L_INV_EN_S, 1);
17261730
roce_set_bit(mpt_entry->byte_8_mw_cnt_en, V2_MPT_BYTE_8_BIND_EN_S,
17271731
(mr->access & IB_ACCESS_MW_BIND ? 1 : 0));
17281732
roce_set_bit(mpt_entry->byte_8_mw_cnt_en, V2_MPT_BYTE_8_ATOMIC_EN_S,

0 commit comments

Comments
 (0)