def dci_reset_stream_id(self, qp_idx): stream_id = self.get_stream_id(qp_idx) Mlx5QP.modify_dci_stream_channel_id(self.qps[qp_idx], stream_id) # Check once if error raised when reset wrong stream id if self.stream_check: try: Mlx5QP.modify_dci_stream_channel_id(self.qps[qp_idx], stream_id + 1) except PyverbsRDMAError as ex: self.stream_check = False
def reset_qp(self, qp_idx): qp_attr = QPAttr(qp_state=e.IBV_QPS_RESET) self.qps[qp_idx].modify(qp_attr, e.IBV_QP_STATE) self.qps[qp_idx].to_rts(qp_attr) err_mask = self.qp_stream_errors[qp_idx][0] index = 0 # Clear all set dci while err_mask != 0: if (err_mask & 0x1) == 0x1: Mlx5QP.modify_dci_stream_channel_id(self.qps[qp_idx], index) index += 1 err_mask >>= 1 self.qp_stream_errors[qp_idx][0] = 0