def _create_rdma_objects(self): cq = CQ(self.pd_res.ctx, 100, None, None, 0) dev_attr = self.pd_res.ctx.query_device() qp_cap = u.random_qp_cap(dev_attr) qia = QPInitAttr(scq=cq, rcq=cq, cap=qp_cap) qia.qp_type = e.IBV_QPT_RC QP(self.pd_res.parent_domain, qia) srq_init_attr = SrqInitAttr(SrqAttr()) SRQ(self.pd_res.parent_domain, srq_init_attr)
def get_qp_init_attr(cq, attr): """ Creates a QPInitAttr object with a QP type of the provided <qpts> array and other random values. :param cq: CQ to be used as send and receive CQ :param attr: Device attributes for capability checks :return: An initialized QPInitAttr object """ qp_cap = u.random_qp_cap(attr) sig = random.randint(0, 1) return QPInitAttr(scq=cq, rcq=cq, cap=qp_cap, sq_sig_all=sig)
def get_qp_init_attr_ex(cq, pd, attr): qp_cap = u.random_qp_cap(attr) sig = random.randint(0, 1) mask = e.IBV_QP_INIT_ATTR_PD | e.IBV_QP_INIT_ATTR_SEND_OPS_FLAGS send_ops_flags = get_random_send_op_flags() qia = QPInitAttrEx(qp_type=e.IBV_QPT_DRIVER, cap=qp_cap, sq_sig_all=sig, comp_mask=mask, create_flags=0, max_tso_header=0, send_ops_flags=send_ops_flags) qia.send_cq = cq qia.recv_cq = cq qia.pd = pd return qia
def _create_rdma_objects(self): cq = CQ(self.pd_res.ctx, 100, None, None, 0) dev_attr = self.pd_res.ctx.query_device() qp_cap = u.random_qp_cap(dev_attr) qia = QPInitAttr(scq=cq, rcq=cq, cap=qp_cap) qia.qp_type = e.IBV_QPT_RC QP(self.pd_res.parent_domain, qia) srq_init_attr = SrqInitAttr(SrqAttr()) SRQ(self.pd_res.parent_domain, srq_init_attr) cq_init_attrs_ex = CqInitAttrEx( comp_mask=e.IBV_CQ_INIT_ATTR_MASK_PD, parent_domain=self.pd_res.parent_domain) CQEX(self.pd_res.ctx, cq_init_attrs_ex)