From patchwork Tue Mar 1 16:52:23 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eli Cohen X-Patchwork-Id: 8467231 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 9DFE4C0553 for ; Tue, 1 Mar 2016 16:53:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D9A9920260 for ; Tue, 1 Mar 2016 16:53:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 005CB20254 for ; Tue, 1 Mar 2016 16:53:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751808AbcCAQxS (ORCPT ); Tue, 1 Mar 2016 11:53:18 -0500 Received: from [193.47.165.129] ([193.47.165.129]:59780 "EHLO mellanox.co.il" rhost-flags-FAIL-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1751642AbcCAQxQ (ORCPT ); Tue, 1 Mar 2016 11:53:16 -0500 Received: from Internal Mail-Server by MTLPINE1 (envelope-from eli@mellanox.com) with ESMTPS (AES256-SHA encrypted); 1 Mar 2016 18:52:42 +0200 Received: from x-vnc01.mtx.labs.mlnx (x-vnc01.mtx.labs.mlnx [10.12.150.16]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id u21GqfS6023823; Tue, 1 Mar 2016 18:52:42 +0200 Received: from x-vnc01.mtx.labs.mlnx (localhost.localdomain [127.0.0.1]) by x-vnc01.mtx.labs.mlnx (8.14.4/8.14.4) with ESMTP id u21Gqfmi138403; Tue, 1 Mar 2016 18:52:41 +0200 Received: (from eli@localhost) by x-vnc01.mtx.labs.mlnx (8.14.4/8.14.4/Submit) id u21GqfFC138402; Tue, 1 Mar 2016 18:52:41 +0200 From: Eli Cohen To: dledford@redhat.com Cc: linux-rdma@vger.kernel.org, liranl@mellanox.com, Or Gerlitz Subject: [PATCH for-next 10/10] IB/core: Use GRH when the path hop-limit > 0 Date: Tue, 1 Mar 2016 18:52:23 +0200 Message-Id: <1456851143-138332-11-git-send-email-eli@mellanox.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1456851143-138332-1-git-send-email-eli@mellanox.com> References: <1456851143-138332-1-git-send-email-eli@mellanox.com> Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Or Gerlitz 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 --- 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 833d2a99a311..6145ded45293 100644 --- a/drivers/infiniband/core/sa_query.c +++ b/drivers/infiniband/core/sa_query.c @@ -1076,7 +1076,7 @@ int ib_init_ah_from_path(struct ib_device *device, u8 port_num, } } - if (rec->hop_limit > 1 || use_roce) { + if (rec->hop_limit > 0 || use_roce) { ah_attr->ah_flags = IB_AH_GRH; ah_attr->grh.dgid = rec->dgid;