Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp10428250ybi; Wed, 24 Jul 2019 23:02:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqyBeyoYtv3Z3J3BF3W0g9GmXRkcaTXxeyW7ZFUjDQojtQZ1nN2KxduPidx8Yl76tr6ztyfR X-Received: by 2002:a63:6c02:: with SMTP id h2mr84318725pgc.61.1564034579755; Wed, 24 Jul 2019 23:02:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564034579; cv=none; d=google.com; s=arc-20160816; b=e35a3YnyDWEWQG7dTNLyOxUSyS3edTdLf6kYH54ZJuogbfPQgvH6JcVADvfaSnvz0y GY4sSEt+HO02Yjl++YA/9QFE+730wq7K0ECplrSA+cxzIGcIDFyuwzToeCePMAHF/jkK 0hGBDpuXZBRaTzch0TC+DBHce3BU8KFd2GM2tfJBy+Cc2vC1vdbdWPq8S1cy64YiBxgg UInKv+jHp5Burre4ZZdxqbo3xzo6/xogIW3kVNbKzOK4Jv3bS0WXbyFRjDlqafseCtl8 a8xMTHja5UvHSVVX0OgWmlm1RKRvMNmpSh/8OjodVGn0bsRiIUxYOHXSmKAuoQyg6lw2 siXA== 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=2C93YSSFWXmKWOa31iI4FjM9f2GtcgdY+n62uTDKnt8=; b=giHABEyjEegMV0WYeGIYI6nMMwbqNAo50iK9IqejELkyHfHRFcyBcxZUOzikE50VES 88r4O4kIPvyEkqiPGRzKdh6h/VMHxf+BbPbHqgqC18q6Zjijg44KzdUzuz4WpmS14CfF S3WzGxA4xLfZSxvyuC0l7duX+P9WTXN7LSfSf24seaoQCdA84T0iV20N2DNIjMfUqys/ dyFAgQbujVn1upTL/faacMYWvqbWKRLnIWvupRTuziKcrT/tWD/fdlb9xf2bOFPDSS5j CxuL9u8IXCCQFBtgYiAc+7QjRtJ6ruXCuB8G0MXJB6WQGubmzIxrf91DWDq0iZLiSweF 2sow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=AoBiQ6vt; 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 i11si15265204plb.20.2019.07.24.23.02.43; Wed, 24 Jul 2019 23:02:59 -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=AoBiQ6vt; 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 S2405144AbfGYFpT (ORCPT + 99 others); Thu, 25 Jul 2019 01:45:19 -0400 Received: from mail.kernel.org ([198.145.29.99]:60718 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391304AbfGYFpQ (ORCPT ); Thu, 25 Jul 2019 01:45:16 -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 02F5A22BEB; Thu, 25 Jul 2019 05:45:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564033515; bh=TEcS6VEwrK6c/rRhgJG8532FMPLUvInMa8VorxuqWJM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AoBiQ6vtsB877tgXck4QeOUE5YIrYKZ3s6uqY3lBtpmzywZQmEhcYuKUqnjBcFFUu PosaTDL/XHFaId1qAykseZ9tFLKR62Q8Z3vfTU4Yux4/zaa2AZ2Il1efQf9Zwjw2Tg Whpweesp5jSIOPq42DbDaD19om/oHnoXy3ivx3h8= 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 4.19 235/271] IB/mlx5: Report correctly tag matching rendezvous capability Date: Wed, 24 Jul 2019 21:21:44 +0200 Message-Id: <20190724191715.296943279@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190724191655.268628197@linuxfoundation.org> References: <20190724191655.268628197@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 @@ -939,15 +939,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 @@ -290,8 +290,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 {