From patchwork Wed Nov 1 10:00:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lijun Ou X-Patchwork-Id: 10036039 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6D4A3600C5 for ; Wed, 1 Nov 2017 09:14:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 66F6E28A60 for ; Wed, 1 Nov 2017 09:14:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5719128A4B; Wed, 1 Nov 2017 09:14:07 +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=-6.9 required=2.0 tests=BAYES_00,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 B184E28A4B for ; Wed, 1 Nov 2017 09:14:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751590AbdKAJOE (ORCPT ); Wed, 1 Nov 2017 05:14:04 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:59298 "EHLO huawei.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1751390AbdKAJOD (ORCPT ); Wed, 1 Nov 2017 05:14:03 -0400 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 7CD1B6A5A47C5; Wed, 1 Nov 2017 17:13:50 +0800 (CST) Received: from localhost.localdomain (10.67.212.75) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.361.1; Wed, 1 Nov 2017 17:13:39 +0800 From: Lijun Ou To: , , CC: Subject: [PATCH rdma-core 1/3] libhns: Set owner bit of SQWQE in user mode Date: Wed, 1 Nov 2017 18:00:38 +0800 Message-ID: <1509530440-164400-2-git-send-email-oulijun@huawei.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1509530440-164400-1-git-send-email-oulijun@huawei.com> References: <1509530440-164400-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 In hip08, it needs to set owner field of sqwqe when posting send wr. The owner field will be used by hardware. The set algorithm as follows: The value of owner should be 1 in the first lap, it should be 0 in the second lap and in turn. Signed-off-by: Lijun Ou --- providers/hns/hns_roce_u_hw_v2.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/providers/hns/hns_roce_u_hw_v2.c b/providers/hns/hns_roce_u_hw_v2.c index 50059bf..900387c 100644 --- a/providers/hns/hns_roce_u_hw_v2.c +++ b/providers/hns/hns_roce_u_hw_v2.c @@ -473,6 +473,7 @@ static int hns_roce_u_v2_arm_cq(struct ibv_cq *ibvcq, int solicited) static int hns_roce_u_v2_post_send(struct ibv_qp *ibvqp, struct ibv_send_wr *wr, struct ibv_send_wr **bad_wr) { + unsigned int sq_shift; unsigned int ind_sge; unsigned int ind; int nreq; @@ -542,6 +543,11 @@ static int hns_roce_u_v2_post_send(struct ibv_qp *ibvqp, struct ibv_send_wr *wr, roce_set_bit(rc_sq_wqe->byte_4, RC_SQ_WQE_BYTE_4_SE_S, (wr->send_flags & IBV_SEND_SOLICITED) ? 1 : 0); + for (sq_shift = 0; (1 << sq_shift) < qp->sq.wqe_cnt; ++sq_shift) + ; + roce_set_bit(rc_sq_wqe->byte_4, RC_SQ_WQE_BYTE_4_OWNER_S, + ~(qp->sq.head >> sq_shift) & 0x1); + wqe += sizeof(struct hns_roce_rc_sq_wqe); /* set remote addr segment */ switch (ibvqp->qp_type) {