diff mbox

[for-next,10/10] IB/core: Use GRH when the path hop-limit > 0

Message ID 1456851143-138332-11-git-send-email-eli@mellanox.com (mailing list archive)
State Accepted
Headers show

Commit Message

Eli Cohen March 1, 2016, 4:52 p.m. UTC
From: Or Gerlitz <ogerlitz@mellanox.com>

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 <ogerlitz@mellanox.com>
---
 drivers/infiniband/core/sa_query.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jason Gunthorpe March 1, 2016, 5:38 p.m. UTC | #1
On Tue, Mar 01, 2016 at 06:52:23PM +0200, Eli Cohen wrote:
> From: Or Gerlitz <ogerlitz@mellanox.com>
> 
> 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 <ogerlitz@mellanox.com>

Reviewed-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>

Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Doug Ledford March 3, 2016, 3:55 p.m. UTC | #2
On 03/01/2016 12:38 PM, Jason Gunthorpe wrote:
> On Tue, Mar 01, 2016 at 06:52:23PM +0200, Eli Cohen wrote:
>> From: Or Gerlitz <ogerlitz@mellanox.com>
>>
>> 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 <ogerlitz@mellanox.com>
> 
> Reviewed-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
> 
> Jason
> 

I've pulled patch 10/10 out of this series and applied it to my 4.5-rc
branch as it's a valid fix for code already in the kernel and need not
be part of this other patch series.
diff mbox

Patch

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;