From: Or Gerlitz Date: Tue, 1 Mar 2016 16:52:23 +0000 (+0200) Subject: IB/core: Use GRH when the path hop-limit > 0 X-Git-Tag: v3.2.79~9 X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?p=pandora-kernel.git;a=commitdiff_plain;h=a1663179bb1707a285258870914536a64cc1c90a IB/core: Use GRH when the path hop-limit > 0 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 [bwh: Backported to 3.2: adjust context] Signed-off-by: Ben Hutchings --- diff --git a/drivers/infiniband/core/sa_query.c b/drivers/infiniband/core/sa_query.c index fbbfa24cf572..f41f1519bbf7 100644 --- a/drivers/infiniband/core/sa_query.c +++ b/drivers/infiniband/core/sa_query.c @@ -508,7 +508,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;