def test_create_cq(self):
        for cq_size in [1, self.attr.max_cqe/2, self.attr.max_cqe]:
            for comp_vector in range(0, min(2, self.ctx.num_comp_vectors)):
                try:
                    cq = CQ(self.ctx, cq_size, None, None, comp_vector)
                    cq.close()
                except PyverbsRDMAError as ex:
                    cq_attr = f'cq_size={cq_size}, comp_vector={comp_vector}'
                    raise PyverbsRDMAErrno(f'Failed to create a CQ with {cq_attr}')

        # Create CQ with Max value of comp_vector.
        max_cqs_comp_vector = self.ctx.num_comp_vectors - 1
        cq = CQ(self.ctx, self.ctx.num_comp_vectors, None, None, max_cqs_comp_vector)
Exemple #2
0
 def test_destroy_cq(self):
     """
     Test ibv_destroy_cq()
     """
     for ctx, attr, attr_ex in self.devices:
         for i in range(10):
             cqes = get_num_cqes(attr)
             comp_vector = int(ctx.num_comp_vectors * random.random())
             if random.choice([True, False]):
                 with CompChannel(ctx) as cc:
                     cq = CQ(ctx, cqes, None, cc, comp_vector)
             else:
                 cq = CQ(ctx, cqes, None, None, comp_vector)
             cq.close()
Exemple #3
0
 def test_destroy_cq():
     """
     Test ibv_destroy_cq()
     """
     lst = d.get_device_list()
     for dev in lst:
         with d.Context(name=dev.name.decode()) as ctx:
             cqes = get_num_cqes(ctx)
             comp_vector = random.randint(0, ctx.num_comp_vectors - 1)
             if random.choice([True, False]):
                 with CompChannel(ctx) as cc:
                     cq = CQ(ctx, cqes, None, cc, comp_vector)
             else:
                 cq = CQ(ctx, cqes, None, None, comp_vector)
             cq.close()