Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp226661pxx; Wed, 28 Oct 2020 03:24:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw01BbYVSS0MXhkMLFIgM5UPtunKX0kRmlIS+HuuFt02AZR14gjjVfJ7Ze+Q8f4fRqOs6Af X-Received: by 2002:a05:6402:1e9:: with SMTP id i9mr7241353edy.317.1603880658213; Wed, 28 Oct 2020 03:24:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603880658; cv=none; d=google.com; s=arc-20160816; b=W+WYBcJrEtOFWX4rD6yZfMNy140pJhn9abtFKRpd5PAdeJB7ojNwL9J9W+npVKvgvd GaQ70QqJ3/KSrtua4Qok1+xY0t+A3HqZDD7X0horajybbruQfsdBXw9eOTBOYsCxlu08 q5+TtRadoLnUkdsWWE+JeL24Q5M+Qi3V6WPW4oxfhWg8DTsy9ad66vR4pU+pnWPoYXTH ArCPzN9fiIFgT8zSlE6dLI6Vtb0RWIgoP2zcewrodCb2jrhbffyDTFAaV5Wn+tm2wHeL GyYWtkmoJTIlk4RXSeotX5qvFLyk1+RV12BeoADxCHx45Gv/8VAY0XHi/0E0CazvTBd/ EQ3g== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=xdh8wRBJ54ot2P67GYuG2qKx35re9W9Tt6T92SsIjbs=; b=G/p8ezRcWp+AWbjkYOg6RSj4M8UAzZI89E+HW29pG59Oo99YgmHGJcynG9+gJeD15L 5dSBPrXbQ5fzqvRygnXl0kZAF+1mzdpwIPf33ENZSouzYIu2KZZP11a6ZXGzUAGJoyDr ETDOCB37hUtshLDy3cRkzcMx/J7TDeRUQegvcwd2ME+6GNoEPWpIFAWL/4fOOZ3YO46T Ef3FtXNAGsI/PhhQkKTEHu28X8MR2MwXEvmH9ht12FOTFHsVC1L+Jx4QEwh8vvG++tqW mZj5NxeGWlt57KPtB1CKomtJC/egdLlN6Pfh8uXNiajqLk7iawev7WUoxxp/9DIRVRY+ p5cA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=FzZL9Ig7; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p90si2749641edd.284.2020.10.28.03.23.56; Wed, 28 Oct 2020 03:24:18 -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=default header.b=FzZL9Ig7; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761366AbgJ0OjH (ORCPT + 99 others); Tue, 27 Oct 2020 10:39:07 -0400 Received: from mail.kernel.org ([198.145.29.99]:38388 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1761356AbgJ0OjE (ORCPT ); Tue, 27 Oct 2020 10:39:04 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8B33122202; Tue, 27 Oct 2020 14:39:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603809544; bh=kZ4b+RhcBaSFZcTfvOjhmSoh8yL7IF33IxzpOUkc0ME=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FzZL9Ig7fl5l5hOmOLY4I7aQcswlCl7iN7/nUMtBXTfuFtGNUnY9cw/J7tTqmADhL v6sdJNrkFjlSyNcj5KUvdvn7tAAMy0FMjMCPGeyjL+u5p6piIpN3HT7sVOQf6j71uq PyWLv22kjFahKkeftzx+omg+LbN76HumWa4pQr4o= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Leon Romanovsky , Jason Gunthorpe , Sasha Levin Subject: [PATCH 5.4 233/408] RDMA/mlx5: Disable IB_DEVICE_MEM_MGT_EXTENSIONS if IB_WR_REG_MR cant work Date: Tue, 27 Oct 2020 14:52:51 +0100 Message-Id: <20201027135505.868624127@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135455.027547757@linuxfoundation.org> References: <20201027135455.027547757@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jason Gunthorpe [ Upstream commit 0ec52f0194638e2d284ad55eba5a7aff753de1b9 ] set_reg_wr() always fails if !umr_modify_entity_size_disabled because mlx5_ib_can_use_umr() always fails. Without set_reg_wr() IB_WR_REG_MR doesn't work and that means the device should not advertise IB_DEVICE_MEM_MGT_EXTENSIONS. Fixes: 841b07f99a47 ("IB/mlx5: Block MR WR if UMR is not possible") Link: https://lore.kernel.org/r/20200914112653.345244-5-leon@kernel.org Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe Signed-off-by: Sasha Levin --- drivers/infiniband/hw/mlx5/main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c index b781ad74e6de4..40c1a05c2445d 100644 --- a/drivers/infiniband/hw/mlx5/main.c +++ b/drivers/infiniband/hw/mlx5/main.c @@ -888,7 +888,9 @@ static int mlx5_ib_query_device(struct ib_device *ibdev, /* We support 'Gappy' memory registration too */ props->device_cap_flags |= IB_DEVICE_SG_GAPS_REG; } - props->device_cap_flags |= IB_DEVICE_MEM_MGT_EXTENSIONS; + /* IB_WR_REG_MR always requires changing the entity size with UMR */ + if (!MLX5_CAP_GEN(dev->mdev, umr_modify_entity_size_disabled)) + props->device_cap_flags |= IB_DEVICE_MEM_MGT_EXTENSIONS; if (MLX5_CAP_GEN(mdev, sho)) { props->device_cap_flags |= IB_DEVICE_INTEGRITY_HANDOVER; /* At this stage no support for signature handover */ -- 2.25.1