diff options
author | Parav Pandit <parav@mellanox.com> | 2018-06-19 10:59:16 +0300 |
---|---|---|
committer | Jason Gunthorpe <jgg@mellanox.com> | 2018-06-25 14:19:56 -0600 |
commit | aa74f4878d61c83244ad8613082989b60a566ca4 (patch) | |
tree | 2aa0fbab7e0ba530d060638a83a42e9b1269f123 /drivers/infiniband/core/sa_query.c | |
parent | IB: Make ib_init_ah_from_mcmember set sgid_attr (diff) | |
download | linux-dev-aa74f4878d61c83244ad8613082989b60a566ca4.tar.xz linux-dev-aa74f4878d61c83244ad8613082989b60a566ca4.zip |
IB: Make init_ah_attr_grh_fields set sgid_attr
Use the sgid and other information from the path record to figure out the
sgid_attrs.
Store the selected table entry in the sgid_attr for everything else to
use.
Signed-off-by: Parav Pandit <parav@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Diffstat (limited to 'drivers/infiniband/core/sa_query.c')
-rw-r--r-- | drivers/infiniband/core/sa_query.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/drivers/infiniband/core/sa_query.c b/drivers/infiniband/core/sa_query.c index a61ec7e33613..b6da4a6095f1 100644 --- a/drivers/infiniband/core/sa_query.c +++ b/drivers/infiniband/core/sa_query.c @@ -1301,21 +1301,20 @@ static int init_ah_attr_grh_fields(struct ib_device *device, u8 port_num, { enum ib_gid_type type = sa_conv_pathrec_to_gid_type(rec); struct net_device *ndev; - u16 gid_index; - int ret; + const struct ib_gid_attr *gid_attr; ndev = ib_get_ndev_from_path(rec); - ret = ib_find_cached_gid_by_port(device, &rec->sgid, type, - port_num, ndev, &gid_index); + gid_attr = + rdma_find_gid_by_port(device, &rec->sgid, type, port_num, ndev); if (ndev) dev_put(ndev); - if (ret) - return ret; + if (IS_ERR(gid_attr)) + return PTR_ERR(gid_attr); - rdma_ah_set_grh(ah_attr, &rec->dgid, - be32_to_cpu(rec->flow_label), - gid_index, rec->hop_limit, - rec->traffic_class); + rdma_move_grh_sgid_attr(ah_attr, &rec->dgid, + be32_to_cpu(rec->flow_label), + rec->hop_limit, rec->traffic_class, + gid_attr); return 0; } |