def test_create_ah(self): """ Test ibv_create_ah. """ self.verify_state(self.ctx) gr = u.get_global_route(self.ctx, port_num=self.ib_port) ah_attr = AHAttr(gr=gr, is_global=1, port_num=self.ib_port) pd = PD(self.ctx) try: AH(pd, attr=ah_attr) except PyverbsRDMAError as ex: if ex.error_code == errno.EOPNOTSUPP: raise unittest.SkipTest('Create AH is not supported') raise ex
def test_create_ah(self): """ Test ibv_create_ah. """ self.verify_state(self.ctx) gr = u.get_global_route(self.ctx, port_num=self.ib_port) port_attrs = self.ctx.query_port(self.ib_port) dlid = port_attrs.lid if port_attrs.link_layer == e.IBV_LINK_LAYER_INFINIBAND else 0 ah_attr = AHAttr(dlid=dlid, gr=gr, is_global=1, port_num=self.ib_port) pd = PD(self.ctx) try: AH(pd, attr=ah_attr) except PyverbsRDMAError as ex: if ex.error_code == errno.EOPNOTSUPP: raise unittest.SkipTest('Create AH is not supported') raise ex
def test_efadv_query_ah(self): """ Test efadv_query_ah() """ pd = PD(self.ctx) try: gr = u.get_global_route(self.ctx, port_num=self.ib_port) ah_attr = AHAttr(gr=gr, is_global=1, port_num=self.ib_port) ah = efa.EfaAH(pd, attr=ah_attr) query_ah_attr = ah.query_efa_ah() if self.config['verbosity']: print(f'\n{query_ah_attr}') except PyverbsRDMAError as ex: if ex.error_code == errno.EOPNOTSUPP: raise unittest.SkipTest('Not supported on non EFA devices') raise ex
def test_destroy_ah(self): """ Test ibv_destroy_ah. """ for ctx, _, _ in self.devices: self.verify_state(ctx) gr = u.get_global_route(ctx, port_num=self.ib_port) ah_attr = AHAttr(gr=gr, is_global=1, port_num=self.ib_port) pd = PD(ctx) try: with AH(pd, attr=ah_attr) as ah: ah.close() except PyverbsRDMAError as ex: if ex.error_code == errno.EOPNOTSUPP: raise unittest.SkipTest('Create AH is not supported') raise ex
def test_create_ah(self): """ Test ibv_create_ah. """ done = 0 for ctx, attr, attr_ex in self.devices: pd = PD(ctx) for port_num in range(1, 1 + attr.phys_port_cnt): state = ctx.query_port(port_num).state if state != e.IBV_PORT_ACTIVE and state != e.IBV_PORT_INIT: continue gr = u.get_global_route(ctx, port_num=port_num) ah_attr = AHAttr(gr=gr, is_global=1, port_num=port_num) try: with AH(pd, attr=ah_attr): done += 1 except PyverbsRDMAError as ex: if ex.error_code == errno.EOPNOTSUPP: raise unittest.SkipTest('Create AH is not supported') raise ex if done == 0: raise unittest.SkipTest('No port is up, can\'t create AH')