Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758890AbcCVKxr (ORCPT ); Tue, 22 Mar 2016 06:53:47 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:56917 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932616AbcCVKm7 (ORCPT ); Tue, 22 Mar 2016 06:42:59 -0400 From: Luis Henriques To: linux-kernel@vger.kernel.org, stable@vger.kernel.org, kernel-team@lists.ubuntu.com Cc: Or Gerlitz , Doug Ledford , Luis Henriques Subject: [PATCH 3.16.y-ckt 110/142] IB/core: Use GRH when the path hop-limit > 0 Date: Tue, 22 Mar 2016 10:40:39 +0000 Message-Id: <1458643271-4227-111-git-send-email-luis.henriques@canonical.com> In-Reply-To: <1458643271-4227-1-git-send-email-luis.henriques@canonical.com> References: <1458643271-4227-1-git-send-email-luis.henriques@canonical.com> X-Extended-Stable: 3.16 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1382 Lines: 35 3.16.7-ckt26 -stable review patch. If anyone has any objections, please let me know. ---8<------------------------------------------------------------ From: Or Gerlitz commit 11d8d645343efba0c975aefe7c2cf3b33c836c75 upstream. According to IBTA spec v1.3 section 12.7.19, QPs should use GRH when the path returned by the SA has hop-limit > 0. Currently, we do that only for the > 1 case, fix that. Fixes: 6d969a471ba1 ('IB/sa: Add ib_init_ah_from_path()') Signed-off-by: Or Gerlitz Reviewed-by: Jason Gunthorpe Signed-off-by: Doug Ledford [ luis: backported to 3.16: adjusted context ] Signed-off-by: Luis Henriques --- drivers/infiniband/core/sa_query.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/core/sa_query.c b/drivers/infiniband/core/sa_query.c index 233eaf541f55..3ca38f9ad26a 100644 --- a/drivers/infiniband/core/sa_query.c +++ b/drivers/infiniband/core/sa_query.c @@ -542,7 +542,7 @@ int ib_init_ah_from_path(struct ib_device *device, u8 port_num, force_grh = rdma_port_get_link_layer(device, port_num) == IB_LINK_LAYER_ETHERNET; - if (rec->hop_limit > 1 || force_grh) { + if (rec->hop_limit > 0 || force_grh) { ah_attr->ah_flags = IB_AH_GRH; ah_attr->grh.dgid = rec->dgid;