From patchwork Tue Mar 22 21:03:58 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamal Mostafa X-Patchwork-Id: 601020 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id 3qV4yC1K1tz9s48; Wed, 23 Mar 2016 08:06:59 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1aiTVw-0007v1-KO; Tue, 22 Mar 2016 21:06:56 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1aiTTx-0006pj-3e for kernel-team@lists.ubuntu.com; Tue, 22 Mar 2016 21:04:53 +0000 Received: from 1.general.kamal.us.vpn ([10.172.68.52] helo=fourier) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1aiTTw-0007iJ-LR; Tue, 22 Mar 2016 21:04:52 +0000 Received: from kamal by fourier with local (Exim 4.86) (envelope-from ) id 1aiTTu-0006EL-0U; Tue, 22 Mar 2016 14:04:50 -0700 From: Kamal Mostafa To: linux-kernel@vger.kernel.org, stable@vger.kernel.org, kernel-team@lists.ubuntu.com Subject: [PATCH 3.13.y-ckt 43/43] IB/core: Use GRH when the path hop-limit > 0 Date: Tue, 22 Mar 2016 14:03:58 -0700 Message-Id: <1458680638-23644-44-git-send-email-kamal@canonical.com> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1458680638-23644-1-git-send-email-kamal@canonical.com> References: <1458680638-23644-1-git-send-email-kamal@canonical.com> X-Extended-Stable: 3.13 Cc: Kamal Mostafa , Or Gerlitz , Doug Ledford X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.14 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: kernel-team-bounces@lists.ubuntu.com 3.13.11-ckt37 -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 Signed-off-by: Kamal Mostafa --- 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 9838ca4..d786aee 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;