From patchwork Sat Mar 3 09:29:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lijun Ou X-Patchwork-Id: 10256037 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 46E2660211 for ; Sat, 3 Mar 2018 09:30:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4A1B6286F5 for ; Sat, 3 Mar 2018 09:30:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3E9B828750; Sat, 3 Mar 2018 09:30: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=-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 DFAD82874E for ; Sat, 3 Mar 2018 09:30:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751663AbeCCJ37 (ORCPT ); Sat, 3 Mar 2018 04:29:59 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:48572 "EHLO huawei.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1751566AbeCCJ36 (ORCPT ); Sat, 3 Mar 2018 04:29:58 -0500 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 81D54D2D9C7E2; Sat, 3 Mar 2018 17:29:44 +0800 (CST) Received: from localhost.localdomain (10.67.212.75) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.361.1; Sat, 3 Mar 2018 17:29:42 +0800 From: Lijun Ou To: , CC: , Subject: [PATCH rdma-core 4/4] libhns: Remove the unnecessary type conversion Date: Sat, 3 Mar 2018 17:29:30 +0800 Message-ID: <1520069370-129426-5-git-send-email-oulijun@huawei.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1520069370-129426-1-git-send-email-oulijun@huawei.com> References: <1520069370-129426-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 The use of short type causes the value is truncated when configured CQ ci, as a result, the hardware get the different value and the CQ overflow. Signed-off-by: Lijun Ou --- providers/hns/hns_roce_u_hw_v1.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/providers/hns/hns_roce_u_hw_v1.c b/providers/hns/hns_roce_u_hw_v1.c index 013a2b4..1d256aa 100644 --- a/providers/hns/hns_roce_u_hw_v1.c +++ b/providers/hns/hns_roce_u_hw_v1.c @@ -411,7 +411,7 @@ static int hns_roce_u_v1_poll_cq(struct ibv_cq *ibvcq, int ne, if (npolled) { if (dev->hw_version == HNS_ROCE_HW_VER1) { - *cq->set_ci_db = (unsigned short)(cq->cons_index & + *cq->set_ci_db = (cq->cons_index & ((cq->cq_depth << 1) - 1)); mmio_ordered_writes_hack(); }