예제 #1
0
 def create_qps(self):
     qp_cap = QPCap(max_recv_wr=self.num_msgs,
                    max_send_wr=self.num_msgs,
                    max_recv_sge=1,
                    max_send_sge=1)
     comp_mask = e.IBV_QP_INIT_ATTR_PD
     if self.send_ops_flags:
         comp_mask |= e.IBV_QP_INIT_ATTR_SEND_OPS_FLAGS
     qp_init_attr_ex = QPInitAttrEx(cap=qp_cap,
                                    qp_type=e.IBV_QPT_DRIVER,
                                    scq=self.cq,
                                    rcq=self.cq,
                                    pd=self.pd,
                                    send_ops_flags=self.send_ops_flags,
                                    comp_mask=comp_mask)
     efa_init_attr_ex = efa.EfaQPInitAttr()
     efa_init_attr_ex.driver_qp_type = efa_e.EFADV_QP_DRIVER_TYPE_SRD
     try:
         for _ in range(self.qp_count):
             qp = efa.SRDQPEx(self.ctx, qp_init_attr_ex, efa_init_attr_ex)
             self.qps.append(qp)
             self.qps_num.append(qp.qp_num)
             self.psns.append(random.getrandbits(24))
     except PyverbsRDMAError as ex:
         if ex.error_code == errno.EOPNOTSUPP:
             raise unittest.SkipTest(
                 'Extended SRD QP is not supported on this device')
         raise ex
예제 #2
0
 def test_efadv_create_qp_ex(self):
     """
     Test efadv_create_qp_ex()
     """
     with PD(self.ctx) as pd:
         with CQ(self.ctx, 100) as cq:
             qiaEx = get_qp_init_attr_ex(cq, pd, self.attr)
             efaqia = efa.EfaQPInitAttr()
             efaqia.driver_qp_type = efa_e.EFADV_QP_DRIVER_TYPE_SRD
             try:
                 qp = efa.SRDQPEx(self.ctx, qiaEx, efaqia)
             except PyverbsRDMAError as ex:
                 if ex.error_code == errno.EOPNOTSUPP:
                     raise unittest.SkipTest("Create SRD QPEx is not supported")
                 raise ex