Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp5209592pxv; Tue, 20 Jul 2021 23:16:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx9Opbnt5OrQzolXzjzxtylmHp2uz3bOjFfvlsZiw6npezs71K5FaceKu00/LszqrQ4gNFd X-Received: by 2002:a5d:925a:: with SMTP id e26mr13823737iol.195.1626848204232; Tue, 20 Jul 2021 23:16:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626848204; cv=none; d=google.com; s=arc-20160816; b=aaQkhGJagvJeOIHHsYRZOIJ4Qw6Hhz+K0ETy8X9L9pUX/KErRNfA2Xgkji94ik7nkW hPgmtNF909YP4Z58Eg6qz6af3TKuTuwHG8Pc74YN4Z/Ebl8vf+w7DmsW3KO59GoqzI/R QAYNBDpaqG4lk8xB+LQrP+B8Afz+AO44zYobqY+aSm0huntzsTjHbf0CZXmafs2IyRBw YpK+gRzrpFkL1uqGt0wvrDlPRP/WpaToMDwoxtWP8I27A1Eq5xhjG9vRXQkggUpS/vA8 Y7ziXqVViL1D9895wpzThaNq/gULKhpXk4cqSPn9uUshXJCbAjFaYuFIx1vBHqmrSecG wbrg== 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 :dkim-signature; bh=fkJ5RBd9IpK0oCMJF5rwrjCq5DF76Cl1CmISDnhuaHA=; b=ZGcpk/G7/+t2lTyxnvLxV3X35bHz9Rg5ahwUi4C+1hZ7No/vIFr3P/eui17muU5AaK 8+eU74DRk3W7zwVoKYepLOduxryyAQHlZ44V+AysvAuzLQ4PzSllVjbGZFdQISPB6DkX 1NfGpWiCkEV0KuRMbq5Psb6cUz7x2Q+gFI7GE1V7NR8gBOCBemVawxQZuUi6ano037ez DNznxbUUKYjebMuiLq8RwY4sO0mc8I0jnO7eX1EEdsyTKsdq7hFQMLKypo2Rfk3JUGuW p8VoWgsT1K2L/8s20RJODx4Kw9ZdVt4YI9hCr1ccSLPKBhfGvjIwdAoimSNTBiE0gwu8 KnXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=U5uajfH+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v8si16279220jas.68.2021.07.20.23.16.32; Tue, 20 Jul 2021 23:16:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=U5uajfH+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233799AbhGUFem (ORCPT + 99 others); Wed, 21 Jul 2021 01:34:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:34234 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232713AbhGUFcl (ORCPT ); Wed, 21 Jul 2021 01:32:41 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 116C66108B; Wed, 21 Jul 2021 06:13:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1626847998; bh=tbn33wjjVuiv3kzeE4HsxsCHrdDaV9aipcwfnmjZej8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=U5uajfH+gfdLy2jcXsvVGBpH44/P+ViHDxQqEubl6BLMHGMCnHqmu7Qc2KxSyUgDt G59pu1TYVsMFQpGI89pf9391OpRHJzRGgp0UMjYT9ZJYKwpBwMHOgnUc02m+LCiFfX lNsdD4zjcOhRNoZA93HHVt5Tn7NtXoLxjAXCsk+b3Vb51ZKYpLVvJoxCycS8f2/++Y xuGD/bN8SuQBLI6eMZ/6tDojw8S9HsSDwKaQCGvjO2GxlElPjVepxzq7NbOudWSCtb J8Jc8g0N3BMTMrfCEGZFqZduHCdAi5S7wof5Hg0f3bo3SMUBbp3gflP1heHf3aGkIR uUXvQqih8MbJw== From: Leon Romanovsky To: Doug Ledford , Jason Gunthorpe Cc: Leon Romanovsky , linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org, Mark Zhang Subject: [PATCH rdma-next 3/7] RDMA/core: Remove protection from wrong in-kernel API usage Date: Wed, 21 Jul 2021 09:13:02 +0300 Message-Id: <8084238e374fe487c3f9728c2ee5ec8736c204d5.1626846795.git.leonro@nvidia.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Leon Romanovsky The ib_create_named_qp() is kernel verb that is not used for user supplied attributes. In such case, it is ULP responsibility to provide valid QP attributes. In-kernel API shouldn't check it, exactly like other functions that don't check device capabilities. Signed-off-by: Leon Romanovsky --- drivers/infiniband/core/verbs.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/drivers/infiniband/core/verbs.c b/drivers/infiniband/core/verbs.c index 635642a3ecbc..2090f3c9f689 100644 --- a/drivers/infiniband/core/verbs.c +++ b/drivers/infiniband/core/verbs.c @@ -1219,16 +1219,6 @@ struct ib_qp *ib_create_named_qp(struct ib_pd *pd, struct ib_qp *qp; int ret; - if (qp_init_attr->rwq_ind_tbl && - (qp_init_attr->recv_cq || - qp_init_attr->srq || qp_init_attr->cap.max_recv_wr || - qp_init_attr->cap.max_recv_sge)) - return ERR_PTR(-EINVAL); - - if ((qp_init_attr->create_flags & IB_QP_CREATE_INTEGRITY_EN) && - !(device->attrs.device_cap_flags & IB_DEVICE_INTEGRITY_HANDOVER)) - return ERR_PTR(-EINVAL); - /* * If the callers is using the RDMA API calculate the resources * needed for the RDMA READ/WRITE operations. -- 2.31.1