Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp484729pxx; Wed, 28 Oct 2020 09:22:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz914CgLBWjMKYIvkJAbHg5d+15uO8LkXAjHJ+pqXCaiPKJYaF216PUGWdnvF4l7jSwvC3v X-Received: by 2002:a17:906:3087:: with SMTP id 7mr3603089ejv.375.1603902138575; Wed, 28 Oct 2020 09:22:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603902138; cv=none; d=google.com; s=arc-20160816; b=qGjXV7ZpWGO9FcmGFh0Ms+owU8rr9Hv2VnVNGqu7O4btAVDvHR3lLqq76qc+ua5fAA MqDcMT/yQcJt0bwsRhyYixiId+2tNllyFeCMQW4IKbwtkRCJfdz1cGZwyI2PKOe/Xi/g spElYGYn3Jg7B6qNvgNGbyNwLCFChV+iEg0ePulUH0Vgpy2hUEsG/wPVJE0zbApVuUre VT3PI/HJuOvR2WH8PoNmt+zZ+T/o4kYAjzniSnP3+OhxxA38fr86fPF9WCAGWeOMQrzP QsScbi4iro4q83LrEaLIkVC6MLCWpMSuVo92GV08bfHuwrIzX5RxdIbflIHu1mkacZB7 dPkg== 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=jz6MN2mGB+XWrewkv8xnd/dnO7VB+T4QTA6GaufeocY=; b=vMbcb0fu7gVUKoGR7qmQgygU50IOLH38Rzd/R3OSCi77zWU4V1L34aQ2uPFLgPtfHy BBwEp+OH0DhYXi5ddA/0ASNyo3JvRrDRwysXQfAk68DjXL6jVN2pTBbTMjf9ACc5fr6O uW7XxbXMo3SeSIRIvh0t/eGxEXEbl/81CmC1Q3WT++au4MCOivNz9uksG0s1wkCmjmqv D5n+feZG0VdjrVBTvVgK9VHDBUUY0RwOjDcdERoaLzcRig4KgiIgbCy7ncgTE1ynVrYV eIGQyFh6DNYH4zAZ508tCsujm/gyRI/gTMH4pBceeYfk/GlEZHgfIUR/Zlz5zMP2JSlv QeDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=tnG2MTWm; 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 w18si3712082eds.554.2020.10.28.09.21.56; Wed, 28 Oct 2020 09:22: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=tnG2MTWm; 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 S1816531AbgJ0RH3 (ORCPT + 99 others); Tue, 27 Oct 2020 13:07:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:40712 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2509806AbgJ0PGh (ORCPT ); Tue, 27 Oct 2020 11:06:37 -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 6B96C2242E; Tue, 27 Oct 2020 15:06:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603811197; bh=NSZcLyLc+lG2Lh4QM+0BGVdUbjTSQ1T5XemTD61W+PM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tnG2MTWmHnh6QX8MYnsHN0D57ukcB/CfDT8SRVqBLhLr4zeDQr/tqDAIoR7s8JIqe NgYpH/v/UKygAHBAkdyLOBJtbhHu3xVJh9/ut61bA74ymKn2xAONgAo4RaJdr9TWXa q9TsdUgCjgfkwFxSy/s7qAjvW0uWDQfEemQ1M5YI= 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.8 380/633] RDMA/mlx5: Disable IB_DEVICE_MEM_MGT_EXTENSIONS if IB_WR_REG_MR cant work Date: Tue, 27 Oct 2020 14:52:03 +0100 Message-Id: <20201027135540.533647109@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135522.655719020@linuxfoundation.org> References: <20201027135522.655719020@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 6f99ed03d88e7..1f4aa2647a6f3 100644 --- a/drivers/infiniband/hw/mlx5/main.c +++ b/drivers/infiniband/hw/mlx5/main.c @@ -867,7 +867,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