Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp789458ybj; Thu, 7 May 2020 07:41:56 -0700 (PDT) X-Google-Smtp-Source: APiQypKDSIZmne33II6ZbA6QLk1iyx5SLI55ckwQi2U0hngb7sjiztNULbL6sPm+rv5DVBXGxxXX X-Received: by 2002:a17:906:e098:: with SMTP id gh24mr12786198ejb.44.1588862516017; Thu, 07 May 2020 07:41:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588862516; cv=none; d=google.com; s=arc-20160816; b=hChfghPa3rzUzVwQ/lNx5fKpIlCgZ0nxbs8eYLTwKFbPBN2xIj9NMZ1O11LjJrAnrc sfOmvX0QaEiDPEkEVvM8AEI5jVmSc7p7JQErESnNBhAzZ/1cYQrGVGiyE3kOv5I1qvmW NntCghrxGoeU4KcsLeppmvLHxODxN6MUV9kW/wZlb4MppRQxImvvWU6U6iLWEG1RfKcz AM7SEGIQghE8VrZ92Mn+JONthjLUYwKOdGt5oOA6fbWrZOzb8WdRJBr93izcP7TgoQ7R nSp31+sCbJbrWAuXoWGnkFAMusqITaVBTLC0Fmj2ql6+XwmR3UhMniQN6tJgWOVclBNL CVTg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=X/hnj0owJT5MJnpPOp81gUoZQZe/7/v39+6kumIT0tI=; b=KHQ8lA1IA/h7S+97qDv9ZbxjV4W6PPg09XaMGqzyJeueL8mLnzuofpXRc8mDPmxzOY YuA1G5v6kUGn0BFEMZ4m26PP/RWFJ50mjAQFTYCzGgHzuyLmWKhGXznGNxzrgF3CWjEU s3bgffhGyWCU0TAH8MVPfvb29NC4XaU31c2JMt7yYHcM/xfpDDL9INeCrrgc5/7Yape1 WG5eLi89Lyr4j0xDcMzkKVJDVahuZr9qAZ+qvbeEY4dZEixHAQnEJQYcHWRKuztKOXI4 QfTWUfl4zm3/MLFJLQVJTJLWSs3ktlGN1CmjuxP2B7V8oor6CotFcN4qoSsU6VIu9OVY SAtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="2S/58gtO"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e7si3252926edv.284.2020.05.07.07.41.32; Thu, 07 May 2020 07:41:56 -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="2S/58gtO"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727107AbgEGO1p (ORCPT + 99 others); Thu, 7 May 2020 10:27:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:53526 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727086AbgEGO1m (ORCPT ); Thu, 7 May 2020 10:27:42 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B4D482083B; Thu, 7 May 2020 14:27:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588861662; bh=0YWd1KybDICAXW00MqaZR7V6phzPC/IofZcdh25NxOk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2S/58gtOURtH7TE/8TaYx+8lNMlFc9l4M/yFp3N5sbrP3KB8eEYaxIAA1pKbzRCQ7 AYu/PQEbLRu4u8PtoLmiLX3KMIbNCSu7LfIj96Rhl/teo+gjNBqkwm32EEqOz2CS78 bs3FrBFsL3U3VtPsL8PJ+onpJ6RczCn0mx2I4o3s= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Aharon Landau , Maor Gottlieb , Leon Romanovsky , Jason Gunthorpe , Sasha Levin , linux-rdma@vger.kernel.org Subject: [PATCH AUTOSEL 5.6 12/50] RDMA/mlx5: Set GRH fields in query QP on RoCE Date: Thu, 7 May 2020 10:26:48 -0400 Message-Id: <20200507142726.25751-12-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200507142726.25751-1-sashal@kernel.org> References: <20200507142726.25751-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Aharon Landau [ Upstream commit 2d7e3ff7b6f2c614eb21d0dc348957a47eaffb57 ] GRH fields such as sgid_index, hop limit, et. are set in the QP context when QP is created/modified. Currently, when query QP is performed, we fill the GRH fields only if the GRH bit is set in the QP context, but this bit is not set for RoCE. Adjust the check so we will set all relevant data for the RoCE too. Since this data is returned to userspace, the below is an ABI regression. Fixes: d8966fcd4c25 ("IB/core: Use rdma_ah_attr accessor functions") Link: https://lore.kernel.org/r/20200413132028.930109-1-leon@kernel.org Signed-off-by: Aharon Landau Reviewed-by: Maor Gottlieb Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe Signed-off-by: Sasha Levin --- drivers/infiniband/hw/mlx5/qp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/mlx5/qp.c b/drivers/infiniband/hw/mlx5/qp.c index 8fe149e808af1..245fef36ab4cb 100644 --- a/drivers/infiniband/hw/mlx5/qp.c +++ b/drivers/infiniband/hw/mlx5/qp.c @@ -5545,7 +5545,9 @@ static void to_rdma_ah_attr(struct mlx5_ib_dev *ibdev, rdma_ah_set_path_bits(ah_attr, path->grh_mlid & 0x7f); rdma_ah_set_static_rate(ah_attr, path->static_rate ? path->static_rate - 5 : 0); - if (path->grh_mlid & (1 << 7)) { + + if (path->grh_mlid & (1 << 7) || + ah_attr->type == RDMA_AH_ATTR_TYPE_ROCE) { u32 tc_fl = be32_to_cpu(path->tclass_flowlabel); rdma_ah_set_grh(ah_attr, NULL, -- 2.20.1