Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp9940969ybi; Wed, 24 Jul 2019 12:43:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqwKfn3izOL/c82/mKaYdDEiXtaWS2Z1Lh+XL82HViHZsqY85s0FcmHEgAzuqMt7S4ImbtlG X-Received: by 2002:a63:6bc5:: with SMTP id g188mr52399431pgc.225.1563997410381; Wed, 24 Jul 2019 12:43:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563997410; cv=none; d=google.com; s=arc-20160816; b=kxSqOz78wSs4Tp6aWFTJAbyUSfvFA6UuvEQhRPX+e4T2kjZ3k7K5RFAEd4MgbbRnSt B6DNAbrZQswieLnUp0NTzA1UC77cJLZUSZxXi4cXqJm0lqy99Y2JRyAR7OAojk8at5qy V9pwr3pSK94wGp+SxQM28fSy8ZS/po9sFruo8zBW1jzZVOWP1ByssPGJ4qFcZirRsAiQ rF2Wm/yNHk/JtFbN4KnRsOJmb/t9m46zpaN7avJmrpcMbYvKp6bO132+KQqdGxKMRqB4 SGZxfTWBDSW1DTdb4vMA3GOT+MAN6KrFoiXZpV37cVdOxWOV+0jMTa7taRa9kUMGtwca Begw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=KgAQ4ct1Umdn5bZasekX2SExf1ASsMC0FxYMUa6h8pA=; b=k6OrPzitFx8565pN90YRdCgBjFF4KNmJUYTLwis9sbIJtRR9pkDtPOUFG6mhK81sMb EPU/fQJaM71geexkIiqEi3DcgN+/ZBJhM1zJ2kcklxP/GVs6tbPMq4wKFtiA5ghdsAEr 13Td3bHsOks6cvpOyLcbTU8fklZBdd/je2UdPQDLXQY5wKET0GJhKWMBF+kLY6/J2lMt Gjz++06cE8tnT9NmNzlHEylNmtat0MK0+5YIVyB+hf9Kyw6V864XFEKoHyZBGCMWoUu7 zkI04R4uNG6RD/cMnpl8XMK0mWYsZkH5+jsRaMyttXvaXHBsB33uxmDbrwx0JnBcnrO/ b49g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=SJD16VtU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m42si15490957pje.31.2019.07.24.12.43.16; Wed, 24 Jul 2019 12:43:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=SJD16VtU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389395AbfGXTku (ORCPT + 99 others); Wed, 24 Jul 2019 15:40:50 -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 {