From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 62744C43461 for ; Mon, 14 Sep 2020 11:28:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 182D6216C4 for ; Mon, 14 Sep 2020 11:28:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600082900; bh=LLbgw0EmD3MT40P3ZbOTK/sZOjjf0bgd5dfbTb7srQU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=jVGW5F3TKcqpnBBYe9+arE0/nR+5zPS+qLIDlAQWuLRh9ZaFcNS4E1Gp+WjwyZoFp c4WHvZR5lMh+InBop3Z2PRj6ZtoLeY2Ttql4uvmcRIYuHwQLqgzZtKP3fHM9q/dUo5 GoJl/5DsxlN+v9d/Y2mV+xmyan/jAOoUrxsxi1JQ= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726023AbgINL2J (ORCPT ); Mon, 14 Sep 2020 07:28:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:48938 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726087AbgINL10 (ORCPT ); Mon, 14 Sep 2020 07:27:26 -0400 Received: from localhost (unknown [213.57.247.131]) (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 2951621D7E; Mon, 14 Sep 2020 11:27:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600082834; bh=LLbgw0EmD3MT40P3ZbOTK/sZOjjf0bgd5dfbTb7srQU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MsHk1rUWXcOo7TU7AVnURqwvLpKbYA7HUN3br2tdeBl5RKETl2sGrfeUIkIuYdtEC sJGUVx5JwUrZhtzFMP4mxFDd8E+lwGGJ2NCM0Bw8Lmzp03yeT/JpAanpcXgsmFYglW ITMpICSyD5ALCE0i+ZkuFoHpSrOd9G+CYMs8F7ak= From: Leon Romanovsky To: Doug Ledford , Jason Gunthorpe Cc: linux-rdma@vger.kernel.org, Moni Shoua Subject: [PATCH rdma-next 4/5] RDMA/mlx5: Disable IB_DEVICE_MEM_MGT_EXTENSIONS if IB_WR_REG_MR can't work Date: Mon, 14 Sep 2020 14:26:52 +0300 Message-Id: <20200914112653.345244-5-leon@kernel.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200914112653.345244-1-leon@kernel.org> References: <20200914112653.345244-1-leon@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Jason Gunthorpe set_reg_wr() always fails if !umr_modify_entity_size_disabled because mlx5_ib_can_use_umr() always fails. Withotu 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") Signed-off-by: Jason Gunthorpe Signed-off-by: Leon Romanovsky --- 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 5cf5266936de..3ae681a6ae3b 100644 --- a/drivers/infiniband/hw/mlx5/main.c +++ b/drivers/infiniband/hw/mlx5/main.c @@ -840,7 +840,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.26.2