Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2508980lqp; Mon, 25 Mar 2024 00:19:07 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWXGrIscnTWi3oo6wPPfOaeAV2V7obfl/V1X2VZ/WiZOlYeGD9EdLDh1QYu+IahvM64Kj+DJc8ULHAz5NZ5DoR09+n6D4MeK5Dd+C2eUw== X-Google-Smtp-Source: AGHT+IG+TzZRENk/2vt1euudsZ8RQG9PIfIImu+d+fEVxWTb7HFuMXlSZxVw3LCrbogFQzyIc+QO X-Received: by 2002:a17:903:13c8:b0:1e0:bc33:d with SMTP id kd8-20020a17090313c800b001e0bc33000dmr3481936plb.31.1711351147315; Mon, 25 Mar 2024 00:19:07 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711351147; cv=pass; d=google.com; s=arc-20160816; b=0MkbaGF5DXH9trGDQw6lHtoa8HOvIODhgK1RsbaHvrkM9SmDQr7to1b8v6QbAd2h7s x3ZtkQTmT781ZsVoq8YgUznmRS1BhyNyOdYo6G5M34HqMEVgjD7syTReJlUqAlOW/qAV Sotz5n79mtLCEedv+ABPWvJoZMel/DOEFypaKhyPbjBUjuTxrFFhVVcJAHLBCkHGj5cr Lje2V0SfevN/CTZSJBlxL1rYYJmFyruP1RwS6xXU89PYkm4ft7HkT3RPlgIiwKrQ+Tau bevgAH4oLe8KIlMFmn+T1QrahVzw3R8v3VJFCnaQrhddH5PMYj4Jr6GBXsceACpVI/8A 98kQ== 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=VIs45lKYkgXMGWBjtPRuRPN9O+kbZQFVJWYPPwkqZPY=; fh=5N0tdEnKFDf1V/Hu/MCrRNhk4u7Ioi5AWvmFcTfybm8=; b=Wded3WaPGCJpsTkLG2LfojnvV09HIUlCNYVoFrB/mNzUC2W2clcYcpCY0SeyiZvN7x Sslb/VKSMx3bJab5xZsp8hcgerdpM5ktowm+UGY30Fk5ToO71MG2TqUYW16wCNzdDx5o qWpnYBhCFANXTVAqq94ew741EjCZr1ewcXiasxqFvvzoFoJPTe+kgTH53SakLcF6JM1l AWtT21IcTKeEFZEAcEj99xmVKtRwL5bUWNXgFbbWNVc9NltZuCV5fkcu5XVsMgrrf2h4 +PYxVbhyoyHn2/AfEmCwerq2gRolSmJsMiTLc4waZCOeDypJc73UEmo1D3g9EDHBse/5 GU7w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=KsRyly+b; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-114935-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-114935-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. [139.178.88.99]) by mx.google.com with ESMTPS id p1-20020a170902e74100b001dcfadaddf4si4873594plf.88.2024.03.25.00.19.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 00:19:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-114935-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=KsRyly+b; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-114935-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-114935-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 5EBEF29D803 for ; Mon, 25 Mar 2024 07:10:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BF43C2D8E5B; Mon, 25 Mar 2024 00:56:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="KsRyly+b" 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 EA9A717967E; Sun, 24 Mar 2024 23:40:41 +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=1711323643; cv=none; b=U6GMe6cybsX/7+7QmMTJiYU1l0MZccVCwLVT3QD4Mlt5//hGvFmoYuj7Nk5jvxlUbiw0Ko94+6HotfPREhs/eGiIoEKmCDJvd3EEU+omsChYFflv2QkGmyd+AQgERuaK3J4o6pV6JZbPcRyOyu3P1E4d5jLwisXOw5zdfULKnjY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711323643; c=relaxed/simple; bh=9eC06TIqVP4YEX5xtazcIFSDbMDbYTC3Hpi0cb+4aWg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=mZxZTs9WIKrKhn5wU9RG8G/dl4JZsrepzUThsgWKVdwCPAlD0VUFOSHqUGBkWxaJ1n6xfGHjERrv+aLo3u56j4D7AomhBaVJSxW89A292tmO+6qODhY2I7d3GatRmT3R0xcPnDNIvYdJvYuvSfK+eoKl/IeETA0PD/+1Vas7V8A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=KsRyly+b; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 00B6FC433F1; Sun, 24 Mar 2024 23:40:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711323641; bh=9eC06TIqVP4YEX5xtazcIFSDbMDbYTC3Hpi0cb+4aWg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KsRyly+bdyJVs10sCVleve2HoaYGh0ojO6Yj5PsnwfnJb0sxkunMSCvhPx9Law1kf q/POwOHKe9O3zcGxX/WeegwL8ja+aRGuEgzzYf2VeaNYXlZRHBDd4Bw8TWg21zCQIr dD+6i8YEMDqpzL86o/p+WokHk8x6XEKmXft13rPE0oov3ktG+2fB/cr/NwFaSkz5jz Nq/XcNfDCeV6eRV9apH5rtWeOzDlLQqFsPGOZr7jed4Eg4Z/Q1jI2ozQG3cPgmxzFv ikFdq2ezSXpYDuBE8g9be9Y2aGq/DG2cEe9muCtuBJJrMwGucO0mQJi/X5hILjWoGm Fke+6U+9esM9g== 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 5.10 013/238] RDMA/mlx5: Relax DEVX access upon modify commands Date: Sun, 24 Mar 2024 19:36:41 -0400 Message-ID: <20240324234027.1354210-14-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324234027.1354210-1-sashal@kernel.org> References: <20240324234027.1354210-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 a56ebdc15723c..f67ebd9f3cdd1 100644 --- a/drivers/infiniband/hw/mlx5/devx.c +++ b/drivers/infiniband/hw/mlx5/devx.c @@ -2780,7 +2780,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