fn read_from_mmds_or_tap(&mut self) -> Result<usize> {
        if let Some(ns) = self.mmds_ns.as_mut() {
            if let Some(len) =
                ns.write_next_frame(frame_bytes_from_buf_mut(&mut self.rx_frame_buf)?)
            {
                let len = len.get();
                METRICS.mmds.tx_frames.inc();
                METRICS.mmds.tx_bytes.add(len);
                init_vnet_hdr(&mut self.rx_frame_buf);
                return Ok(vnet_hdr_len() + len);
            }
        }

        self.read_tap().map_err(Error::IO)
    }
// We currently prioritize packets from the MMDS over regular network packets.
We currently prioritize packets from the MMDS over regular network packets.
We currently prioritize packets from the MMDS over regular network packets .
fn read_from_mmds_or_tap(&mut self) -> Result<usize> {
        if let Some(ns) = self.mmds_ns.as_mut() {
            if let Some(len) =
                ns.write_next_frame(frame_bytes_from_buf_mut(&mut self.rx_frame_buf)?)
            {
                let len = len.get();
                METRICS.mmds.tx_frames.inc();
                METRICS.mmds.tx_bytes.add(len);
                init_vnet_hdr(&mut self.rx_frame_buf);
                return Ok(vnet_hdr_len() + len);
            }
        }
        self.read_tap().map_err(Error::IO)
    }
fn read_from_mmds_or_tap ( & mut self ) -> Result < usize > { if let Some ( ns ) = self . mmds_ns . as_mut ( ) { if let Some ( len ) = ns . write_next_frame ( frame_bytes_from_buf_mut ( & mut self . rx_frame_buf ) ? ) { let len = len . get ( ) ; METRICS . mmds . tx_frames . inc ( ) ; METRICS . mmds . tx_bytes . add ( len ) ; init_vnet_hdr ( & mut self . rx_frame_buf ) ; return Ok ( vnet_hdr_len ( ) + len ) ; } } self . read_tap ( ) . map_err ( Error :: IO ) }
We currently prioritize packets from the MMDS over regular network packets.
We currently prioritize packets from the MMDS over regular network packets .
&mut self
&mut self