pub unsafe extern "C" fn cm_handler(
        cm_id: *mut ib_cm_id,
        env: *const ib_cm_event,
    ) -> linux_kernel_module::c_types::c_int {
        let event = *env;
        let cm: &mut ib_cm_id = &mut *cm_id;
        let qp: &mut RC = &mut *(cm.context as *mut RC);

        match event.event {
            ib_cm_event_type::IB_CM_REP_RECEIVED => {
                #[cfg(feature = "profile")]
                    qp.profile.tick_record(1);
                qp.handle_reply(&event);
            }
            ib_cm_event_type::IB_CM_REJ_RECEIVED => {
                println!("QP cm reply rejected!");
            }
            ib_cm_event_type::IB_CM_TIMEWAIT_EXIT => {
                println!("QP cm reply time wait exit!")
            }
            ib_cm_event_type::IB_CM_DREP_RECEIVED => {
                println!("QP cm reply derep received!");
                qp.done.done();
            }
            // others should be handled later
            _ => {
                println!("sunknown QP cm event: {}", event.event);
            }
        };
        0
    }
/// CM callback handler shown as below.
///
/// cm handler for RC primitive
CM callback handler shown as below.
cm handler for RC primitive
CM callback handler shown as below . cm handler for RC primitive
pub unsafe extern "C" fn cm_handler(
        cm_id: *mut ib_cm_id,
        env: *const ib_cm_event,
    ) -> linux_kernel_module::c_types::c_int {
        let event = *env;
        let cm: &mut ib_cm_id = &mut *cm_id;
        let qp: &mut RC = &mut *(cm.context as *mut RC);
        match event.event {
            ib_cm_event_type::IB_CM_REP_RECEIVED => {
                #[cfg(feature = "profile")]
                    qp.profile.tick_record(1);
                qp.handle_reply(&event);
            }
            ib_cm_event_type::IB_CM_REJ_RECEIVED => {
                println!("QP cm reply rejected!");
            }
            ib_cm_event_type::IB_CM_TIMEWAIT_EXIT => {
                println!("QP cm reply time wait exit!")
            }
            ib_cm_event_type::IB_CM_DREP_RECEIVED => {
                println!("QP cm reply derep received!");
                qp.done.done();
            }
            // others should be handled later
            _ => {
                println!("sunknown QP cm event: {}", event.event);
            }
        };
        0
    }
pub unsafe extern " " fn cm_handler ( cm_id : * mut ib_cm_id , env : * const ib_cm_event , ) -> linux_kernel_module :: c_types :: c_int { let event = * env ; let cm : & mut ib_cm_id = & mut * cm_id ; let qp : & mut RC = & mut * ( cm . context as * mut RC ) ; match event . event { ib_cm_event_type :: IB_CM_REP_RECEIVED => { # [ cfg ( feature " " ) ] qp . profile . tick_record ( 1 ) ; qp . handle_reply ( & event ) ; } ib_cm_event_type :: IB_CM_REJ_RECEIVED => { println ! ( " " ) ; } ib_cm_event_type :: IB_CM_TIMEWAIT_EXIT => { println ! ( " " ) } ib_cm_event_type :: IB_CM_DREP_RECEIVED => { println ! ( " " ) ; qp . done . done ( ) ; } // others should be handled later _ => { println ! ( " " event event ) ; } } ; 0 }
CM callback handler shown as below.
CM callback handler shown as below .
cm_id
*mut ib_cm_id
env
*const ib_cm_event