aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Cohen <eli@mellanox.com>2016-06-22 10:27:24 -0400
committerDoug Ledford <dledford@redhat.com>2016-06-23 10:03:57 -0400
commitb3556005c5f319285610e3eae88b4078e1a4d3bc (patch)
treeafc74a8cdf5203613915ed3d85d3db90c5cdec91
parentc65f6c5a3650876a69d1041a9d3c90986e9ca233 (diff)
IB/core: Fix false search of the IB_SA_WELL_KNOWN_GUID
When virtualziation is supported, VFs may send SA MADs to a GID formed by the concatenation of the subnet prefix with the IB_SA_WELL_KNOWN_GUID. When a response is required, the current code will search the local HCA's port for the received GID to figure out the GID index of the entry containing this GID. However, since this is not a real GID it will not be found and error will be printed. We change the logic to check if the destination GID is this special GID and avoid lookup in this case and use GID index 0. Fixes: a0c1b2a35087 ('IB/core: Support accessing SA in virtualized environment') Signed-off-by: Eli Cohen <eli@mellanox.com> Signed-off-by: Leon Romanovsky <leon@kernel.org> Signed-off-by: Doug Ledford <dledford@redhat.com>
-rw-r--r--drivers/infiniband/core/verbs.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/drivers/infiniband/core/verbs.c b/drivers/infiniband/core/verbs.c
index 1d7d4cf442e3..6298f54b4137 100644
--- a/drivers/infiniband/core/verbs.c
+++ b/drivers/infiniband/core/verbs.c
@@ -511,12 +511,16 @@ int ib_init_ah_from_wc(struct ib_device *device, u8 port_num,
511 ah_attr->grh.dgid = sgid; 511 ah_attr->grh.dgid = sgid;
512 512
513 if (!rdma_cap_eth_ah(device, port_num)) { 513 if (!rdma_cap_eth_ah(device, port_num)) {
514 ret = ib_find_cached_gid_by_port(device, &dgid, 514 if (dgid.global.interface_id != cpu_to_be64(IB_SA_WELL_KNOWN_GUID)) {
515 IB_GID_TYPE_IB, 515 ret = ib_find_cached_gid_by_port(device, &dgid,
516 port_num, NULL, 516 IB_GID_TYPE_IB,
517 &gid_index); 517 port_num, NULL,
518 if (ret) 518 &gid_index);
519 return ret; 519 if (ret)
520 return ret;
521 } else {
522 gid_index = 0;
523 }
520 } 524 }
521 525
522 ah_attr->grh.sgid_index = (u8) gid_index; 526 ah_attr->grh.sgid_index = (u8) gid_index;