diff options
author | Dasaratharaman Chandramouli <dasaratharaman.chandramouli@intel.com> | 2017-04-28 02:05:59 +0300 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2017-05-01 21:37:28 +0300 |
commit | dfa834e1d97e24c7d6b7c5b102728d69d6361501 (patch) | |
tree | 9e713bef0935093568dad32ca96c1c92f19fff10 /drivers/infiniband/core/cm.c | |
parent | c2f8fc4ec4400901e5561d4815deca19f395deb6 (diff) | |
download | linux-dfa834e1d97e24c7d6b7c5b102728d69d6361501.tar.xz |
IB/SA: Introduce path record specific types
struct sa_path_rec has a gid_type field. This patch introduces a more
generic path record specific type 'rec_type' which is either IB, ROCE v1
or ROCE v2. The patch also provides conversion functions to get
a gid type from a path record type and vice versa
Reviewed-by: Don Hiatt <don.hiatt@intel.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Dasaratharaman Chandramouli <dasaratharaman.chandramouli@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/core/cm.c')
-rw-r--r-- | drivers/infiniband/core/cm.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c index fe838234cf94..39e306a09f96 100644 --- a/drivers/infiniband/core/cm.c +++ b/drivers/infiniband/core/cm.c @@ -453,7 +453,8 @@ static int cm_init_av_by_path(struct sa_path_rec *path, struct cm_av *av, read_lock_irqsave(&cm.device_lock, flags); list_for_each_entry(cm_dev, &cm.device_list, list) { if (!ib_find_cached_gid(cm_dev->ib_device, &path->sgid, - path->gid_type, ndev, &p, NULL)) { + sa_conv_pathrec_to_gid_type(path), + ndev, &p, NULL)) { port = cm_dev->port[p-1]; break; } @@ -1775,8 +1776,11 @@ static int cm_req_handler(struct cm_work *work) work->path[0].ifindex = gid_attr.ndev->ifindex; work->path[0].net = dev_net(gid_attr.ndev); dev_put(gid_attr.ndev); + work->path[0].rec_type = + sa_conv_gid_to_pathrec_type(gid_attr.gid_type); + } else { + work->path[0].rec_type = SA_PATH_REC_TYPE_IB; } - work->path[0].gid_type = gid_attr.gid_type; ret = cm_init_av_by_path(&work->path[0], &cm_id_priv->av, cm_id_priv); } @@ -1789,8 +1793,13 @@ static int cm_req_handler(struct cm_work *work) work->path[0].ifindex = gid_attr.ndev->ifindex; work->path[0].net = dev_net(gid_attr.ndev); dev_put(gid_attr.ndev); + work->path[0].rec_type = + sa_conv_gid_to_pathrec_type(gid_attr.gid_type); + } else { + work->path[0].rec_type = SA_PATH_REC_TYPE_IB; } - work->path[0].gid_type = gid_attr.gid_type; + if (req_msg->alt_local_lid) + work->path[1].rec_type = work->path[0].rec_type; ib_send_cm_rej(cm_id, IB_CM_REJ_INVALID_GID, &work->path[0].sgid, sizeof work->path[0].sgid, NULL, 0); |