pub fn post_recvs(
        &mut self,
        qp: *mut ib_qp,
        srq: *mut ib_srq,
        buffer_sz: usize,
    ) -> linux_kernel_module::KernelResult<()> {
        let tail = (self.cur_idx + buffer_sz - 1) % self.capacity;

        let mut bad_wr: *mut ib_recv_wr = core::ptr::null_mut();
        self.freeze_at(tail);
        let err = unsafe {
            if srq.is_null() {
                bd_ib_post_recv(
                    qp,
                    self.header_ptr(),
                    &mut bad_wr as *mut _,
                )
            } else {
                bd_ib_post_srq_recv(
                    srq,
                    self.header_ptr(),
                    &mut bad_wr as *mut _,
                )
            }
        };
        self.freeze_done_at(tail);
        if err != 0 {
            println!("[recv helper] error when post recv {}", err);
            return Err(Error::from_kernel_errno(err));
        }
        self.cur_idx = (tail + 1) % self.capacity;
        Ok(())
    }
/// Post recv use the receive buffer directly
/// srq: Use shared receive queue if set this to not null
Post recv use the receive buffer directly
srq: Use shared receive queue if set this to not null
Post recv use the receive buffer directly srq : Use shared receive queue if set this to not null
pub fn post_recvs(
        &mut self,
        qp: *mut ib_qp,
        srq: *mut ib_srq,
        buffer_sz: usize,
    ) -> linux_kernel_module::KernelResult<()> {
        let tail = (self.cur_idx + buffer_sz - 1) % self.capacity;
        let mut bad_wr: *mut ib_recv_wr = core::ptr::null_mut();
        self.freeze_at(tail);
        let err = unsafe {
            if srq.is_null() {
                bd_ib_post_recv(
                    qp,
                    self.header_ptr(),
                    &mut bad_wr as *mut _,
                )
            } else {
                bd_ib_post_srq_recv(
                    srq,
                    self.header_ptr(),
                    &mut bad_wr as *mut _,
                )
            }
        };
        self.freeze_done_at(tail);
        if err != 0 {
            println!("[recv helper] error when post recv {}", err);
            return Err(Error::from_kernel_errno(err));
        }
        self.cur_idx = (tail + 1) % self.capacity;
        Ok(())
    }
pub fn post_recvs ( & mut self , qp : * mut ib_qp , srq : * mut ib_srq , buffer_sz : usize , ) -> linux_kernel_module :: KernelResult < ( ) > { let tail = ( self . cur_idx + buffer_sz - 1 ) % self . capacity ; let mut bad_wr : * mut ib_recv_wr = core :: ptr :: null_mut ( ) ; self . freeze_at ( tail ) ; let err = unsafe { if srq . is_null ( ) { bd_ib_post_recv ( qp , self . header_ptr ( ) , & mut bad_wr as * mut _ , ) } else { bd_ib_post_srq_recv ( srq , self . header_ptr ( ) , & mut bad_wr as * mut _ , ) } } ; self . freeze_done_at ( tail ) ; if err != 0 { println ! ( " " err ) ; return Err ( Error :: from_kernel_errno ( err ) ) ; } self . cur_idx = ( tail + 1 ) % self . capacity ; Ok ( ( ) ) }
Post recv use the receive buffer directly
srq: Use shared receive queue if set this to not null
Post recv use the receive buffer directly srq : Use shared receive queue if set this to not null
&mut self
qp
*mut ib_qp
srq
*mut ib_srq
buffer_sz
usize