pub fn bring_to_rts(&self, cm: *mut ib_cm_id) -> KernelResult<()> {
        if self.get_status().unwrap() == ib_qp_state::IB_QPS_RTR {
            let mut attr: ib_qp_attr = Default::default();
            let mut mask: linux_kernel_module::c_types::c_int = ib_qp_attr_mask::IB_QP_STATE;

            attr.qp_state = ib_qp_state::IB_QPS_RTS;
            let ret = unsafe { ib_cm_init_qp_attr(cm, to_ptr!(attr), to_ptr!(mask)) };
            if ret != 0 {
                return Err(Error::from_kernel_errno(ret));
            }

            let ret = unsafe { ib_modify_qp(self.get_qp(), to_ptr!(attr), mask) };
            if ret != 0 {
                println!("bring ready to send error!");
                return Err(Error::from_kernel_errno(ret));
            }
        }
        Ok(())
    }
// bring QP from ready to receive => ready to send
bring QP from ready to receive => ready to send
bring QP from ready to receive = > ready to send
pub fn bring_to_rts(&self, cm: *mut ib_cm_id) -> KernelResult<()> {
        if self.get_status().unwrap() == ib_qp_state::IB_QPS_RTR {
            let mut attr: ib_qp_attr = Default::default();
            let mut mask: linux_kernel_module::c_types::c_int = ib_qp_attr_mask::IB_QP_STATE;
            attr.qp_state = ib_qp_state::IB_QPS_RTS;
            let ret = unsafe { ib_cm_init_qp_attr(cm, to_ptr!(attr), to_ptr!(mask)) };
            if ret != 0 {
                return Err(Error::from_kernel_errno(ret));
            }
            let ret = unsafe { ib_modify_qp(self.get_qp(), to_ptr!(attr), mask) };
            if ret != 0 {
                println!("bring ready to send error!");
                return Err(Error::from_kernel_errno(ret));
            }
        }
        Ok(())
    }
pub fn bring_to_rts ( & self , cm : * mut ib_cm_id ) -> KernelResult < ( ) > { if self . get_status ( ) . unwrap ( ) == ib_qp_state :: IB_QPS_RTR { let mut attr : ib_qp_attr = Default :: default ( ) ; let mut mask : linux_kernel_module :: c_types :: c_int = ib_qp_attr_mask :: IB_QP_STATE ; attr . qp_state = ib_qp_state :: IB_QPS_RTS ; let ret = unsafe { ib_cm_init_qp_attr ( cm , to_ptr ! ( attr ) , to_ptr ! ( mask ) ) } ; if ret != 0 { return Err ( Error :: from_kernel_errno ( ret ) ) ; } let ret = unsafe { ib_modify_qp ( self . get_qp ( ) , to_ptr ! ( attr ) , mask ) } ; if ret != 0 { println ! ( " " ) ; return Err ( Error :: from_kernel_errno ( ret ) ) ; } } Ok ( ( ) ) }
bring QP from ready to receive => ready to send
bring QP from ready to receive = > ready to send
&self
cm
*mut ib_cm_id