def invalidate_mw_type1(self): """ Invalidate the MWs by rebind this MW with zero length. :return: None """ for player in [self.server, self.client]: mw_bind_info = MWBindInfo(player.mr, player.mr.buf, 0, 0) mw_bind = MWBind(mw_bind_info, e.IBV_SEND_SIGNALED) player.qp.bind_mw(player.mw, mw_bind) # Poll the bound MW action request completion. u.poll_cq(player.cq)
def __init__(self, dev_name, ib_port, gid_index, mw_type): """ Initialize Memory Window resources based on RC resources that include RC QP. :param dev_name: Device name to be used :param ib_port: IB port of the device to use :param gid_index: Which GID index to use :param mw_type: The MW type to use """ super().__init__(dev_name=dev_name, ib_port=ib_port, gid_index=gid_index) self.mw_type = mw_type access = e.IBV_ACCESS_REMOTE_WRITE | e.IBV_ACCESS_LOCAL_WRITE self.mw_bind_info = MWBindInfo(self.mr, self.mr.buf, self.msg_size, access) self.mw_bind = MWBind(self.mw_bind_info, e.IBV_SEND_SIGNALED) try: self.mw = MW(self.pd, self.mw_type) except PyverbsRDMAError as ex: if ex.error_code == errno.EOPNOTSUPP: raise unittest.SkipTest('Create MW is not supported') raise ex