Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2552137lqp; Mon, 25 Mar 2024 02:17:17 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXombtSsypxvIgGyEKbD+TW3zhh8C8ZUaxSExocDr+Q9XSnZaRomK4Ia2TbtgDH3rV/WirePOKhyU3UQZKyUlVakowUBB2Jnh8Azm3L/Q== X-Google-Smtp-Source: AGHT+IGMXvM4UDcoL/4P8W8jRjCj9tGqL6xpPmnMGA9lB+R0lV3GkEI7sVDS/5Kvhr0Nn4VsEgjw X-Received: by 2002:a17:903:1205:b0:1e0:1355:c6b9 with SMTP id l5-20020a170903120500b001e01355c6b9mr6053119plh.32.1711358237193; Mon, 25 Mar 2024 02:17:17 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711358237; cv=pass; d=google.com; s=arc-20160816; b=IYagt1uNtCW411seXPwdJmt+3uaeJR0n1hC82+m+IM4k43jC7pWAd03SityU72n+xb pzmZaUW6caY9kTc0SPY4/S3UUEvHKsd+1BYxZqOdSQ1PYCxt6zChnrrYCPHyPTglqGrb WG0rcv8gqnoOZSAfE/femgYkdb6pCIitaRmL9M+FOrkjN32z+tqxtOjohwkmZClfltHy kOd31aGZw8rCcbVW/lOZJOq/jdM4eKfZZi2GY5N8UTngELxIzwifkFYKxdTrzlBrtma0 /fpzQkQVWh9QS3YjQB98T2ZOJ+xAnG6v6sz+ZkmV+g+0fY71tFs1vs+iLH2v+wF/PaSf /i/g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=07mkdAK8PJ+6XZEdqVU4GRNs4NZ4v330K4g6gQ0kbLc=; fh=5N0tdEnKFDf1V/Hu/MCrRNhk4u7Ioi5AWvmFcTfybm8=; b=g6wo7tGimftn/nJVXlJmpN+xVole/03vbO7fvDKjoh7FIFvMSQRA7SQTjZYQyVAY6Z Iy29yt5T770A5JmaYD8Ms9Kq0Ix3YHYaYv1EY7ttZab8ArKPFKoqXnhxTH5Ot3V+VSzv axqO8tUr1J/w8mULP30rvieyR1LTWKtcQ0KQMIqD02ZUI0BfoBYnyLI4EuUz2mb1C47n F3uBsfY+8CTfpp1r4dH4sbBV9dB4+Vbnqw8R7JfE2EeWs5uJLREL8quae26amR2/ZKDu MY9+rZJVRB0kF/2tXsxpGaD+skiWvqAyJPW41QQfIMuzI8JGKSa16wWCpXaGdOKZOpSH NuQg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="hJe/DZKS"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-115763-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-115763-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id j15-20020a170903024f00b001e027ccc606si4709221plh.388.2024.03.25.02.17.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 02:17:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-115763-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="hJe/DZKS"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-115763-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-115763-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id D7D7D292F3C for ; Mon, 25 Mar 2024 09:17:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CD4A62618E0; Mon, 25 Mar 2024 03:00:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="hJe/DZKS" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 627101448EE; Sun, 24 Mar 2024 23:12:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711321959; cv=none; b=JVll19vW1/SpAVuQQ22zDA06GoJDTSuD+ovwTnNK5rU37a8ULf+jouW8oiCNOyKhTUljeZLLyK6c7mtph9Dqw+LtY6V9eNPwu1+hXeHboKwfDU9XzKTX4ufk0DYIWIbnPDcoLk4IRIc1TYx+we0SswdRX1ICFaabHZu3muevzSo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711321959; c=relaxed/simple; bh=xQC6o6+q3OtIE2gwfV+uYfObv8PJwHK9mSaRmCA0uMY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=hh3EporKyPjoBzaGaR6IMbdAdf5P4BFHzwyZSrGkMhp68FghOA5x+7Q5EL8D4WI9chYn4tbwKzQWWccr30PZ2N7GDBKkSlWTdOpcpzzBgjQB2p4Q/zEZriGIYYkvXoSJv8V/8nipBdnrs4zMN2bFXvFsmiMnJp+9mblHLz6DJk8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=hJe/DZKS; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6F2E7C433C7; Sun, 24 Mar 2024 23:12:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711321959; bh=xQC6o6+q3OtIE2gwfV+uYfObv8PJwHK9mSaRmCA0uMY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hJe/DZKSt/S7ZE6m/VwbW57VsxPLy9aHdpy1KWXmuGkpGQ8FaxvOAAG5NZ5dyLuZm E+QgRCPIf+yDXbLEoUTD76SPFnF00z4dJH8rXexLcSUTHj5Yjg+ytzj8rCr+mHlWNv b26Ohf8AmTL3PpPCxUSbF1CYTjtlLisZVNGYdA5LfGBdmT9g2PBQ5cc/V5mB/Sqs34 8Y+L0u4vKZV9TgNXofRusaxtZYV0L8KrMzjCfMPmkx8KFHocQYkvysuQMOattiG8BS HCHlPkTgambYWGqgTp4iKs3CrwDZF/TzncT2PAyL54MQVPeYO8Be+U1t9CuPyo3bYR GIlYHzSvBux0g== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Yishai Hadas , Tamar Mashiah , Michael Guralnik , Leon Romanovsky , Sasha Levin Subject: [PATCH 6.1 031/451] RDMA/mlx5: Relax DEVX access upon modify commands Date: Sun, 24 Mar 2024 19:05:07 -0400 Message-ID: <20240324231207.1351418-32-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324231207.1351418-1-sashal@kernel.org> References: <20240324231207.1351418-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit From: Yishai Hadas [ Upstream commit be551ee1574280ef8afbf7c271212ac3e38933ef ] Relax DEVX access upon modify commands to be UVERBS_ACCESS_READ. The kernel doesn't need to protect what firmware protects, or what causes no damage to anyone but the user. As firmware needs to protect itself from parallel access to the same object, don't block parallel modify/query commands on the same object in the kernel side. This change will allow user space application to run parallel updates to different entries in the same bulk object. Tested-by: Tamar Mashiah Signed-off-by: Yishai Hadas Reviewed-by: Michael Guralnik Link: https://lore.kernel.org/r/7407d5ed35dc427c1097699e12b49c01e1073406.1706433934.git.leon@kernel.org Signed-off-by: Leon Romanovsky Signed-off-by: Sasha Levin --- drivers/infiniband/hw/mlx5/devx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/mlx5/devx.c b/drivers/infiniband/hw/mlx5/devx.c index f8e2baed27a5c..7013ce20549bd 100644 --- a/drivers/infiniband/hw/mlx5/devx.c +++ b/drivers/infiniband/hw/mlx5/devx.c @@ -2951,7 +2951,7 @@ DECLARE_UVERBS_NAMED_METHOD( MLX5_IB_METHOD_DEVX_OBJ_MODIFY, UVERBS_ATTR_IDR(MLX5_IB_ATTR_DEVX_OBJ_MODIFY_HANDLE, UVERBS_IDR_ANY_OBJECT, - UVERBS_ACCESS_WRITE, + UVERBS_ACCESS_READ, UA_MANDATORY), UVERBS_ATTR_PTR_IN( MLX5_IB_ATTR_DEVX_OBJ_MODIFY_CMD_IN, -- 2.43.0