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=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,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 52BF3C76186 for ; Wed, 24 Jul 2019 19:40:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 247D922ADB for ; Wed, 24 Jul 2019 19:40:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563997253; bh=d1GLalrnQ3TcuRPElj6ZsWare3NPHQDUtgOaNwbHZuQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=ZibMsBYjI22Em7u7nkeS+XC9xicM+nQdLi+d+U6YrkRyyTmOAm3EoiHLoUw9pGDPz f1Fk7afyoFnvDooZBbWqpeTIJdR1ZRdhoWfvnAIEvI7Sckij8hLb4o9RbH34DwL6Ja l8eJydsMLWYeU9HVI96zibQM32oQgj4RVBnvS3jI= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390090AbfGXTkv (ORCPT ); Wed, 24 Jul 2019 15:40:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:42062 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390082AbfGXTkt (ORCPT ); Wed, 24 Jul 2019 15:40:49 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 9BED021873; Wed, 24 Jul 2019 19:40:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563997248; bh=d1GLalrnQ3TcuRPElj6ZsWare3NPHQDUtgOaNwbHZuQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SJD16VtUdoEjaJrXYVjLhLiVdKreV6/xLXUVTuyajnUwR3tnkky+OCfioFGluQSqR YZ4B+b2r0cADRD/P2iRVRySbivdqHrjr1Dk6uejNUmyBrn5eUp0KqA15deTL2Gzo7k LovhCNf8u8OjB/imGVCKhNjyRtqi44+xqH4O0kn4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Danit Goldberg , Yishai Hadas , Artemy Kovalyov , Leon Romanovsky , Jason Gunthorpe Subject: [PATCH 5.2 371/413] IB/mlx5: Report correctly tag matching rendezvous capability Date: Wed, 24 Jul 2019 21:21:02 +0200 Message-Id: <20190724191801.840822910@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190724191735.096702571@linuxfoundation.org> References: <20190724191735.096702571@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Danit Goldberg commit 89705e92700170888236555fe91b45e4c1bb0985 upstream. Userspace expects the IB_TM_CAP_RC bit to indicate that the device supports RC transport tag matching with rendezvous offload. However the firmware splits this into two capabilities for eager and rendezvous tag matching. Only if the FW supports both modes should userspace be told the tag matching capability is available. Cc: # 4.13 Fixes: eb761894351d ("IB/mlx5: Fill XRQ capabilities") Signed-off-by: Danit Goldberg Reviewed-by: Yishai Hadas Reviewed-by: Artemy Kovalyov Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe Signed-off-by: Greg Kroah-Hartman --- drivers/infiniband/hw/mlx5/main.c | 8 ++++++-- include/rdma/ib_verbs.h | 4 ++-- 2 files changed, 8 insertions(+), 4 deletions(-) --- a/drivers/infiniband/hw/mlx5/main.c +++ b/drivers/infiniband/hw/mlx5/main.c @@ -1043,15 +1043,19 @@ static int mlx5_ib_query_device(struct i } if (MLX5_CAP_GEN(mdev, tag_matching)) { - props->tm_caps.max_rndv_hdr_size = MLX5_TM_MAX_RNDV_MSG_SIZE; props->tm_caps.max_num_tags = (1 << MLX5_CAP_GEN(mdev, log_tag_matching_list_sz)) - 1; - props->tm_caps.flags = IB_TM_CAP_RC; props->tm_caps.max_ops = 1 << MLX5_CAP_GEN(mdev, log_max_qp_sz); props->tm_caps.max_sge = MLX5_TM_MAX_SGE; } + if (MLX5_CAP_GEN(mdev, tag_matching) && + MLX5_CAP_GEN(mdev, rndv_offload_rc)) { + props->tm_caps.flags = IB_TM_CAP_RNDV_RC; + props->tm_caps.max_rndv_hdr_size = MLX5_TM_MAX_RNDV_MSG_SIZE; + } + if (MLX5_CAP_GEN(dev->mdev, cq_moderation)) { props->cq_caps.max_cq_moderation_count = MLX5_MAX_CQ_COUNT; --- a/include/rdma/ib_verbs.h +++ b/include/rdma/ib_verbs.h @@ -327,8 +327,8 @@ struct ib_rss_caps { }; enum ib_tm_cap_flags { - /* Support tag matching on RC transport */ - IB_TM_CAP_RC = 1 << 0, + /* Support tag matching with rendezvous offload for RC transport */ + IB_TM_CAP_RNDV_RC = 1 << 0, }; struct ib_tm_caps {