Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp4272864rwd; Tue, 23 May 2023 05:48:00 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4FeITAfB6lQADkdQSNt4CIzVJscGtpNuHjLM+fTuu7kxTnI/wDieW+ntLRdiGsSvXr8ZdT X-Received: by 2002:a05:6a00:248a:b0:64e:6862:8553 with SMTP id c10-20020a056a00248a00b0064e68628553mr6779030pfv.32.1684846080585; Tue, 23 May 2023 05:48:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684846080; cv=none; d=google.com; s=arc-20160816; b=QRl5y9JH6gW/srsXEmJq20/YuPKhGsgGOq6wM5/EjUwNYYaeKve0AvxRkETjpdySfT TbCMT6L9qzM23+Sj28HX30T2hTR0qDvNuBFqF8biloOHWUPQMCN8uTJLR+B/9HO+cGD4 iTfzIwFIjSwCILIQ5D5L4TIIYvdEDIobME9CVod+iq0y1cXgRIc6lPJNj4qB6kadrJmZ V00ezy1LFfI4Lhybi9LFVNsT6qQNtayloqKmPB7VDF9bDDJGhETPtg3c93M0b4UPZ+89 TgxM08gCK+W7fc+6tx9cG+ujlepown+OKys5FjHtvDmJkbdXje3Go8+SvwxNM01CzyLI uC0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=KbRZOWBh0IAtr5DvHgdetG7JCpt//0iKT6PR0wBLodw=; b=pRIIZwWuh+Mnqs6KPrzGSXiWVAR+axHBVddFaftHk8arQGMgLiGd277od8C7L+lbCt OSAzBgdvTa+JjcddbmBG8d1TTn6OWJgHKpgOG+vCaL6XfFzNRzLqPUuXxX1oTdO/yEN6 ny+vC6Y304jcTtyYeYfmgMVc1tLtU6fFoXmycX6TYpHeeabBWtrRxkP24sEVEiQIsll1 fp/RZL1LqxAW0+u3yVRnjkC8e83l5wZDIuqyZsV7HkPJLK2+qSx9GQ3z3P6n64kHtsX1 r99th6nVuerG7cDCjZTZiF8A053Sv5jHcG+yKc8G72PeIXhGpXI+zjV4BlF37h2Op10Z nZDg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=hisilicon.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z22-20020a637e16000000b004df18fa49aesi6355694pgc.796.2023.05.23.05.47.47; Tue, 23 May 2023 05:48:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=hisilicon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236688AbjEWMSy (ORCPT + 99 others); Tue, 23 May 2023 08:18:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47668 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235983AbjEWMSv (ORCPT ); Tue, 23 May 2023 08:18:51 -0400 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 87FE9118; Tue, 23 May 2023 05:18:50 -0700 (PDT) Received: from kwepemi500006.china.huawei.com (unknown [172.30.72.54]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4QQYGn1b5WzLmFy; Tue, 23 May 2023 20:17:21 +0800 (CST) Received: from localhost.localdomain (10.67.165.2) by kwepemi500006.china.huawei.com (7.221.188.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Tue, 23 May 2023 20:18:48 +0800 From: Junxian Huang To: , CC: , , , Subject: [PATCH for-rc 1/3] RDMA/hns: Remove unnecessary QP type checks Date: Tue, 23 May 2023 20:16:39 +0800 Message-ID: <20230523121641.3132102-2-huangjunxian6@hisilicon.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20230523121641.3132102-1-huangjunxian6@hisilicon.com> References: <20230523121641.3132102-1-huangjunxian6@hisilicon.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.67.165.2] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To kwepemi500006.china.huawei.com (7.221.188.68) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org It is not necessary to check the type of the queue on IO path because unsupported QP type cannot be created. Signed-off-by: Chengchang Tang Signed-off-by: Junxian Huang --- drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c index d4c6b9bc0a4e..673fd31b9ecf 100644 --- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c +++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c @@ -373,17 +373,10 @@ static int check_send_valid(struct hns_roce_dev *hr_dev, struct hns_roce_qp *hr_qp) { struct ib_device *ibdev = &hr_dev->ib_dev; - struct ib_qp *ibqp = &hr_qp->ibqp; - if (unlikely(ibqp->qp_type != IB_QPT_RC && - ibqp->qp_type != IB_QPT_GSI && - ibqp->qp_type != IB_QPT_UD)) { - ibdev_err(ibdev, "not supported QP(0x%x)type!\n", - ibqp->qp_type); - return -EOPNOTSUPP; - } else if (unlikely(hr_qp->state == IB_QPS_RESET || - hr_qp->state == IB_QPS_INIT || - hr_qp->state == IB_QPS_RTR)) { + if (unlikely(hr_qp->state == IB_QPS_RESET || + hr_qp->state == IB_QPS_INIT || + hr_qp->state == IB_QPS_RTR)) { ibdev_err(ibdev, "failed to post WQE, QP state %u!\n", hr_qp->state); return -EINVAL; @@ -772,15 +765,6 @@ static int check_recv_valid(struct hns_roce_dev *hr_dev, struct hns_roce_qp *hr_qp) { struct ib_device *ibdev = &hr_dev->ib_dev; - struct ib_qp *ibqp = &hr_qp->ibqp; - - if (unlikely(ibqp->qp_type != IB_QPT_RC && - ibqp->qp_type != IB_QPT_GSI && - ibqp->qp_type != IB_QPT_UD)) { - ibdev_err(ibdev, "unsupported qp type, qp_type = %d.\n", - ibqp->qp_type); - return -EOPNOTSUPP; - } if (unlikely(hr_dev->state >= HNS_ROCE_DEVICE_STATE_RST_DOWN)) return -EIO; -- 2.30.0