]>
git.proxmox.com Git - mirror_ubuntu-kernels.git/blob - drivers/infiniband/hw/hfi1/tid_rdma.c
1 // SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause)
3 * Copyright(c) 2018 Intel Corporation.
12 * qp_to_rcd - determine the receive context used by a qp
15 * This routine returns the receive context associated
18 * Returns the context.
20 static struct hfi1_ctxtdata
*qp_to_rcd(struct rvt_dev_info
*rdi
,
23 struct hfi1_ibdev
*verbs_dev
= container_of(rdi
,
26 struct hfi1_devdata
*dd
= container_of(verbs_dev
,
31 if (qp
->ibqp
.qp_num
== 0)
34 ctxt
= ((qp
->ibqp
.qp_num
>> dd
->qos_shift
) %
35 (dd
->n_krcv_queues
- 1)) + 1;
40 int hfi1_qp_priv_init(struct rvt_dev_info
*rdi
, struct rvt_qp
*qp
,
41 struct ib_qp_init_attr
*init_attr
)
43 struct hfi1_qp_priv
*qpriv
= qp
->priv
;
45 qpriv
->rcd
= qp_to_rcd(rdi
, qp
);