diff options
author | Dasaratharaman Chandramouli <dasaratharaman.chandramouli@intel.com> | 2017-04-27 19:06:00 -0400 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2017-05-01 14:38:19 -0400 |
commit | 9fdca4da4d8c83caefb9f2fd897d6a7bc355dfe6 (patch) | |
tree | 002153e16e28b8817c25082e00ab2cc397fe9c34 /drivers/infiniband/ulp/srp/ib_srp.c | |
parent | dfa834e1d97e24c7d6b7c5b102728d69d6361501 (diff) |
IB/SA: Split struct sa_path_rec based on IB and ROCE specific fields
sa_path_rec now contains a union of sa_path_rec_ib and sa_path_rec_roce
based on the type of the path record. Note that fields applicable to
path record type ROCE v1 and ROCE v2 fall under sa_path_rec_roce.
Accessor functions are added to these fields so the caller doesn't have
to know the type.
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/ulp/srp/ib_srp.c')
-rw-r--r-- | drivers/infiniband/ulp/srp/ib_srp.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c index ded9b9afbac0..89341dde9e5b 100644 --- a/drivers/infiniband/ulp/srp/ib_srp.c +++ b/drivers/infiniband/ulp/srp/ib_srp.c | |||
@@ -312,10 +312,11 @@ static int srp_new_cm_id(struct srp_rdma_ch *ch) | |||
312 | if (ch->cm_id) | 312 | if (ch->cm_id) |
313 | ib_destroy_cm_id(ch->cm_id); | 313 | ib_destroy_cm_id(ch->cm_id); |
314 | ch->cm_id = new_cm_id; | 314 | ch->cm_id = new_cm_id; |
315 | ch->path.rec_type = SA_PATH_REC_TYPE_IB; | ||
315 | ch->path.sgid = target->sgid; | 316 | ch->path.sgid = target->sgid; |
316 | ch->path.dgid = target->orig_dgid; | 317 | ch->path.dgid = target->orig_dgid; |
317 | ch->path.pkey = target->pkey; | 318 | ch->path.pkey = target->pkey; |
318 | ch->path.service_id = target->service_id; | 319 | sa_path_set_service_id(&ch->path, target->service_id); |
319 | 320 | ||
320 | return 0; | 321 | return 0; |
321 | } | 322 | } |
@@ -2399,12 +2400,12 @@ static void srp_cm_rej_handler(struct ib_cm_id *cm_id, | |||
2399 | switch (event->param.rej_rcvd.reason) { | 2400 | switch (event->param.rej_rcvd.reason) { |
2400 | case IB_CM_REJ_PORT_CM_REDIRECT: | 2401 | case IB_CM_REJ_PORT_CM_REDIRECT: |
2401 | cpi = event->param.rej_rcvd.ari; | 2402 | cpi = event->param.rej_rcvd.ari; |
2402 | ch->path.dlid = cpi->redirect_lid; | 2403 | sa_path_set_dlid(&ch->path, cpi->redirect_lid); |
2403 | ch->path.pkey = cpi->redirect_pkey; | 2404 | ch->path.pkey = cpi->redirect_pkey; |
2404 | cm_id->remote_cm_qpn = be32_to_cpu(cpi->redirect_qp) & 0x00ffffff; | 2405 | cm_id->remote_cm_qpn = be32_to_cpu(cpi->redirect_qp) & 0x00ffffff; |
2405 | memcpy(ch->path.dgid.raw, cpi->redirect_gid, 16); | 2406 | memcpy(ch->path.dgid.raw, cpi->redirect_gid, 16); |
2406 | 2407 | ||
2407 | ch->status = ch->path.dlid ? | 2408 | ch->status = sa_path_get_dlid(&ch->path) ? |
2408 | SRP_DLID_REDIRECT : SRP_PORT_REDIRECT; | 2409 | SRP_DLID_REDIRECT : SRP_PORT_REDIRECT; |
2409 | break; | 2410 | break; |
2410 | 2411 | ||