mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-08-25 09:21:15 +00:00
vhost_user_net: Remove debugging println! messages
Remove messages that are left over from the development of the project that represent normal operation for the backend. This cleans up the console output and improves performance. Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
parent
9e78c2e686
commit
df336ade57
@ -213,7 +213,6 @@ impl VhostUserNetBackend {
|
|||||||
let mut next_desc = vring.mut_queue().iter(&mem).next();
|
let mut next_desc = vring.mut_queue().iter(&mem).next();
|
||||||
|
|
||||||
if next_desc.is_none() {
|
if next_desc.is_none() {
|
||||||
println!("rx queue has no available descriptors!\n");
|
|
||||||
// Queue has no available descriptors
|
// Queue has no available descriptors
|
||||||
if self.rx_tap_listening {
|
if self.rx_tap_listening {
|
||||||
self.vring_worker
|
self.vring_worker
|
||||||
@ -288,7 +287,6 @@ impl VhostUserNetBackend {
|
|||||||
Ok(count) => {
|
Ok(count) => {
|
||||||
self.rx.bytes_read = count;
|
self.rx.bytes_read = count;
|
||||||
if !self.rx_single_frame(vring) {
|
if !self.rx_single_frame(vring) {
|
||||||
println!("read_tap done, set rx_single_frame!\n");
|
|
||||||
self.rx.deferred_frame = true;
|
self.rx.deferred_frame = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -337,7 +335,6 @@ impl VhostUserNetBackend {
|
|||||||
|
|
||||||
fn process_tx(&mut self, vring: &mut Vring) -> Result<()> {
|
fn process_tx(&mut self, vring: &mut Vring) -> Result<()> {
|
||||||
if let Some(mem) = &self.mem {
|
if let Some(mem) = &self.mem {
|
||||||
println!("Entering process_tx!\n");
|
|
||||||
let mut used_desc_heads = [(0, 0); QUEUE_SIZE];
|
let mut used_desc_heads = [(0, 0); QUEUE_SIZE];
|
||||||
let mut used_count = 0;
|
let mut used_count = 0;
|
||||||
while let Some(avail_desc) = vring.mut_queue().iter(&mem).next() {
|
while let Some(avail_desc) = vring.mut_queue().iter(&mem).next() {
|
||||||
@ -348,7 +345,6 @@ impl VhostUserNetBackend {
|
|||||||
self.tx.iovec.clear();
|
self.tx.iovec.clear();
|
||||||
while let Some(desc) = next_desc {
|
while let Some(desc) = next_desc {
|
||||||
if desc.is_write_only() {
|
if desc.is_write_only() {
|
||||||
println!("desc is write only!\n");
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
self.tx.iovec.push((desc.addr, desc.len as usize));
|
self.tx.iovec.push((desc.addr, desc.len as usize));
|
||||||
@ -370,10 +366,6 @@ impl VhostUserNetBackend {
|
|||||||
);
|
);
|
||||||
match read_result {
|
match read_result {
|
||||||
Ok(_) => {
|
Ok(_) => {
|
||||||
println!(
|
|
||||||
"process_tx read_result is good with read_count: {:?}\n",
|
|
||||||
read_count
|
|
||||||
);
|
|
||||||
// Increment by number of bytes actually read
|
// Increment by number of bytes actually read
|
||||||
read_count += limit - read_count;
|
read_count += limit - read_count;
|
||||||
}
|
}
|
||||||
@ -450,7 +442,6 @@ impl VhostUserBackend for VhostUserNetBackend {
|
|||||||
match device_event {
|
match device_event {
|
||||||
RX_QUEUE_EVENT => {
|
RX_QUEUE_EVENT => {
|
||||||
let mut vring = vrings[0].write().unwrap();
|
let mut vring = vrings[0].write().unwrap();
|
||||||
println!("RX_QUEUE_EVENT received");
|
|
||||||
self.resume_rx(&mut vring).unwrap();
|
self.resume_rx(&mut vring).unwrap();
|
||||||
|
|
||||||
if !self.rx_tap_listening {
|
if !self.rx_tap_listening {
|
||||||
@ -464,12 +455,10 @@ impl VhostUserBackend for VhostUserNetBackend {
|
|||||||
}
|
}
|
||||||
TX_QUEUE_EVENT => {
|
TX_QUEUE_EVENT => {
|
||||||
let mut vring = vrings[1].write().unwrap();
|
let mut vring = vrings[1].write().unwrap();
|
||||||
println!("TX_QUEUE_EVENT received!\n");
|
|
||||||
self.process_tx(&mut vring).unwrap();
|
self.process_tx(&mut vring).unwrap();
|
||||||
}
|
}
|
||||||
RX_TAP_EVENT => {
|
RX_TAP_EVENT => {
|
||||||
let mut vring = vrings[0].write().unwrap();
|
let mut vring = vrings[0].write().unwrap();
|
||||||
println!("RX_TAP_EVENT received");
|
|
||||||
if self.rx.deferred_frame
|
if self.rx.deferred_frame
|
||||||
// Process a deferred frame first if available. Don't read from tap again
|
// Process a deferred frame first if available. Don't read from tap again
|
||||||
// until we manage to receive this deferred frame.
|
// until we manage to receive this deferred frame.
|
||||||
@ -487,7 +476,6 @@ impl VhostUserBackend for VhostUserNetBackend {
|
|||||||
}
|
}
|
||||||
KILL_EVENT => {
|
KILL_EVENT => {
|
||||||
self.kill_evt.read().unwrap();
|
self.kill_evt.read().unwrap();
|
||||||
println!("KILL_EVENT received, stopping epoll loop");
|
|
||||||
return Ok(true);
|
return Ok(true);
|
||||||
}
|
}
|
||||||
_ => {
|
_ => {
|
||||||
@ -570,8 +558,6 @@ fn main() {
|
|||||||
let net_backend = Arc::new(RwLock::new(
|
let net_backend = Arc::new(RwLock::new(
|
||||||
VhostUserNetBackend::new(backend_config.ip, backend_config.mask).unwrap(),
|
VhostUserNetBackend::new(backend_config.ip, backend_config.mask).unwrap(),
|
||||||
));
|
));
|
||||||
println!("net_backend is created!\n");
|
|
||||||
|
|
||||||
let name = "vhost-user-net-backend";
|
let name = "vhost-user-net-backend";
|
||||||
let mut net_daemon = VhostUserDaemon::new(
|
let mut net_daemon = VhostUserDaemon::new(
|
||||||
name.to_string(),
|
name.to_string(),
|
||||||
@ -579,8 +565,6 @@ fn main() {
|
|||||||
net_backend.clone(),
|
net_backend.clone(),
|
||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
println!("net_daemon is created!\n");
|
|
||||||
|
|
||||||
let vring_worker = net_daemon.get_vring_worker();
|
let vring_worker = net_daemon.get_vring_worker();
|
||||||
|
|
||||||
if vring_worker
|
if vring_worker
|
||||||
|
Loading…
Reference in New Issue
Block a user