pub fn process_tx(&mut self) -> bool {
        debug!("vsock::process_tx()");
        let mem = match self.device_state {
            DeviceState::Activated(ref mem) => mem,
            // This should never happen, it's been already validated in the event handler.
            DeviceState::Inactive => unreachable!(),
        };

        let mut have_used = false;

        while let Some(head) = self.queues[TXQ_INDEX].pop(mem) {
            let pkt = match VsockPacket::from_tx_virtq_head(&head) {
                Ok(pkt) => pkt,
                Err(e) => {
                    error!("vsock: error reading TX packet: {:?}", e);
                    have_used = true;
                    self.queues[TXQ_INDEX].add_used(mem, head.index, 0);
                    continue;
                }
            };

            if self.backend.send_pkt(&pkt).is_err() {
                self.queues[TXQ_INDEX].undo_pop();
                break;
            }

            have_used = true;
            self.queues[TXQ_INDEX].add_used(mem, head.index, 0);
        }

        have_used
    }
/// Walk the driver-provided TX queue buffers, package them up as vsock packets, and send them
/// to the backend for processing. Return `true` if descriptors have been added to the used
/// ring, and `false` otherwise.
Walk the driver-provided TX queue buffers, package them up as vsock packets, and send them
to the backend for processing. Return `true` if descriptors have been added to the used
ring, and `false` otherwise.
Walk the driver - provided TX queue buffers package them up as vsock packets and send them to the backend for processing . Return ` true ` if descriptors have been added to the used ring and ` false ` otherwise .
pub fn process_tx(&mut self) -> bool {
        debug!("vsock::process_tx()");
        let mem = match self.device_state {
            DeviceState::Activated(ref mem) => mem,
            // This should never happen, it's been already validated in the event handler.
            DeviceState::Inactive => unreachable!(),
        };
        let mut have_used = false;
        while let Some(head) = self.queues[TXQ_INDEX].pop(mem) {
            let pkt = match VsockPacket::from_tx_virtq_head(&head) {
                Ok(pkt) => pkt,
                Err(e) => {
                    error!("vsock: error reading TX packet: {:?}", e);
                    have_used = true;
                    self.queues[TXQ_INDEX].add_used(mem, head.index, 0);
                    continue;
                }
            };
            if self.backend.send_pkt(&pkt).is_err() {
                self.queues[TXQ_INDEX].undo_pop();
                break;
            }
            have_used = true;
            self.queues[TXQ_INDEX].add_used(mem, head.index, 0);
        }
        have_used
    }
pub fn process_tx ( & mut self ) -> bool { debug ! ( " " ) ; let mem = match self . device_state { DeviceState :: Activated ( ref mem ) => mem , // This should never happen, it's been already validated in the event handler. DeviceState :: Inactive => unreachable ! ( ) , } ; let mut have_used = false ; while let Some ( head ) = self . queues [ TXQ_INDEX ] . pop ( mem ) { let pkt = match VsockPacket :: from_tx_virtq_head ( & head ) { Ok ( pkt ) => pkt , Err ( e ) => { error ! ( " " e ) ; have_used = true ; self . queues [ TXQ_INDEX ] . add_used ( mem , head . index , 0 ) ; continue ; } } ; if self . backend . send_pkt ( & pkt ) . is_err ( ) { self . queues [ TXQ_INDEX ] . undo_pop ( ) ; break ; } have_used = true ; self . queues [ TXQ_INDEX ] . add_used ( mem , head . index , 0 ) ; } have_used }
Walk the driver-provided TX queue buffers, package them up as vsock packets, and send them
to the backend for processing.
Walk the driver - provided TX queue buffers package them up as vsock packets and send them to the backend for processing .
&mut self