pub fn check_rx_queue_resume(&mut self, expected_frame: &[u8]) {
            let used_idx = self.rxq.used.idx.get();
            // Add a valid Rx avail descriptor chain and run epoll.
            self.add_desc_chain(
                NetQueue::Rx,
                0,
                &[(0, expected_frame.len() as u32, VIRTQ_DESC_F_WRITE)],
            );
            check_metric_after_block!(
                METRICS.net.rx_packets_count,
                1,
                self.event_manager.run_with_timeout(100).unwrap()
            );
            // Check that the expected frame was sent to the Rx queue eventually.
            assert_eq!(self.rxq.used.idx.get(), used_idx + 1);
            assert!(&self.net().irq_trigger.has_pending_irq(IrqType::Vring));
            self.rxq
                .check_used_elem(used_idx, 0, expected_frame.len() as u32);
            self.rxq.dtable[0].check_data(&expected_frame);
        }
/// Check that after adding a valid Rx queue descriptor chain a previously deferred frame
/// is eventually received by the guest
Check that after adding a valid Rx queue descriptor chain a previously deferred frame
is eventually received by the guest
Check that after adding a valid Rx queue descriptor chain a previously deferred frame is eventually received by the guest
pub fn check_rx_queue_resume(&mut self, expected_frame: &[u8]) {
            let used_idx = self.rxq.used.idx.get();
            // Add a valid Rx avail descriptor chain and run epoll.
            self.add_desc_chain(
                NetQueue::Rx,
                0,
                &[(0, expected_frame.len() as u32, VIRTQ_DESC_F_WRITE)],
            );
            check_metric_after_block!(
                METRICS.net.rx_packets_count,
                1,
                self.event_manager.run_with_timeout(100).unwrap()
            );
            // Check that the expected frame was sent to the Rx queue eventually.
            assert_eq!(self.rxq.used.idx.get(), used_idx + 1);
            assert!(&self.net().irq_trigger.has_pending_irq(IrqType::Vring));
            self.rxq
                .check_used_elem(used_idx, 0, expected_frame.len() as u32);
            self.rxq.dtable[0].check_data(&expected_frame);
        }
pub fn check_rx_queue_resume ( & mut self , expected_frame : & [ u8 ] ) { let used_idx = self . rxq . used . idx . get ( ) ; // Add a valid Rx avail descriptor chain and run epoll. self . add_desc_chain ( NetQueue :: Rx , 0 , & [ ( 0 , expected_frame . len ( ) as u32 , VIRTQ_DESC_F_WRITE ) ] , ) ; check_metric_after_block ! ( METRICS net rx_packets_count 1 self event_manager run_with_timeout ( 100 ) unwrap ( ) ) ; // Check that the expected frame was sent to the Rx queue eventually. assert_eq ! ( self rxq used idx get ( ) used_idx 1 ) ; assert ! ( self net ( ) irq_trigger has_pending_irq ( IrqType Vring ) ) ; self . rxq . check_used_elem ( used_idx , 0 , expected_frame . len ( ) as u32 ) ; self . rxq . dtable [ 0 ] . check_data ( & expected_frame ) ; }
Check that after adding a valid Rx queue descriptor chain a previously deferred frame
is eventually received by the guest
Check that after adding a valid Rx queue descriptor chain a previously deferred frame is eventually received by the guest
&mut self
expected_frame
&[u8]
&mut self
expected_frame
&[u8]