Commit 901a7ae3 authored by Or Gerlitz's avatar Or Gerlitz Committed by Luis Henriques

IB/core: Use GRH when the path hop-limit > 0

commit 11d8d645 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: 6d969a47 ('IB/sa: Add ib_init_ah_from_path()')
Signed-off-by: default avatarOr Gerlitz <ogerlitz@mellanox.com>
Reviewed-by: default avatarJason Gunthorpe <jgunthorpe@obsidianresearch.com>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
[ luis: backported to 3.16: adjusted context ]
Signed-off-by: default avatarLuis Henriques <luis.henriques@canonical.com>
parent 9d313c12
...@@ -542,7 +542,7 @@ int ib_init_ah_from_path(struct ib_device *device, u8 port_num, ...@@ -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; 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->ah_flags = IB_AH_GRH;
ah_attr->grh.dgid = rec->dgid; ah_attr->grh.dgid = rec->dgid;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment