From patchwork Mon May 4 17:57:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 226425 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=unavailable 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 B32B3C4724C for ; Mon, 4 May 2020 18:02:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8AFD120721 for ; Mon, 4 May 2020 18:02:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588615337; bh=IyWikRPAmGkpyNvQjXnK+KtXGbUYDRLOITjbFS7aCqY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=ViQqS9UhvAZGwzp0EzRQKVBksiH/7kqRMAomd6BoJf4FU0crMyki3Vi5NgceoF/5A VR8CiCIWvifSpAicvA65w2TVfO/pvzufl8wTdVq/s+gQF/4g3/R0xwVVTJN0LAlPta i/rC7wmURrvG2eKN3ydwjIfFEsWQi81sv9rHXCqo= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731300AbgEDSCQ (ORCPT ); Mon, 4 May 2020 14:02:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:58472 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731296AbgEDSCQ (ORCPT ); Mon, 4 May 2020 14:02: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 5D893206B8; Mon, 4 May 2020 18:02:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588615335; bh=IyWikRPAmGkpyNvQjXnK+KtXGbUYDRLOITjbFS7aCqY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=W/FYt1HkBIf7e2LU4Qh+WHzYZyOApCVWwcv/XKj2tmYRqM58gV8St5Qo68KGhVLCm 6ac7mJU2KOyVuTw6wWNo+7f9rk2SOo3X+08TRJmAxa8NKw7HDCsO016+dkNTQtz/OQ X3PLH0ilVh/1/YX6Jz3R7xLFc19grMZiFFwrbDEw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Aharon Landau , Maor Gottlieb , Leon Romanovsky , Jason Gunthorpe Subject: [PATCH 4.19 17/37] RDMA/mlx5: Set GRH fields in query QP on RoCE Date: Mon, 4 May 2020 19:57:30 +0200 Message-Id: <20200504165450.213048797@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200504165448.264746645@linuxfoundation.org> References: <20200504165448.264746645@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Aharon Landau commit 2d7e3ff7b6f2c614eb21d0dc348957a47eaffb57 upstream. 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: Greg Kroah-Hartman --- drivers/infiniband/hw/mlx5/qp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/drivers/infiniband/hw/mlx5/qp.c +++ b/drivers/infiniband/hw/mlx5/qp.c @@ -4887,7 +4887,9 @@ static void to_rdma_ah_attr(struct mlx5_ 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,