From patchwork Thu Oct 11 14:46:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lijun Ou X-Patchwork-Id: 10636729 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3FF1D69B1 for ; Thu, 11 Oct 2018 14:44:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 31EEE2B85A for ; Thu, 11 Oct 2018 14:44:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2647E2B8F1; Thu, 11 Oct 2018 14:44:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CCA002B85A for ; Thu, 11 Oct 2018 14:44:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728641AbeJKWLl (ORCPT ); Thu, 11 Oct 2018 18:11:41 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:35803 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728634AbeJKWLl (ORCPT ); Thu, 11 Oct 2018 18:11:41 -0400 Received: from DGGEMS409-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 1C7BE91CF1DC6; Thu, 11 Oct 2018 22:44:08 +0800 (CST) Received: from localhost.localdomain (10.67.212.75) by DGGEMS409-HUB.china.huawei.com (10.3.19.209) with Microsoft SMTP Server id 14.3.399.0; Thu, 11 Oct 2018 22:44:06 +0800 From: Lijun Ou To: , CC: , Subject: [PATCH V2 rdma-core 1/2] libhns: Add local invalidate MR support for hip08 Date: Thu, 11 Oct 2018 22:46:15 +0800 Message-ID: <1539269176-144961-2-git-send-email-oulijun@huawei.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1539269176-144961-1-git-send-email-oulijun@huawei.com> References: <1539269176-144961-1-git-send-email-oulijun@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.67.212.75] X-CFilter-Loop: Reflected Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch adds local invalidate memory region (MR) support in the user space driver. Signed-off-by: Yangyang Li Signed-off-by: Lijun Ou --- providers/hns/hns_roce_u_hw_v2.c | 10 ++++++++++ 1 file changed, 10 insertions(+) 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,