mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2025-01-22 04:25:21 +00:00
net_util: Remove some unneeded use of mut
As identified by the new beta clippy. Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
parent
fccd9c8829
commit
00bfb63607
@ -121,7 +121,7 @@ pub fn unregister_listener(
|
||||
}
|
||||
|
||||
pub fn build_net_config_space(
|
||||
mut config: &mut VirtioNetConfig,
|
||||
config: &mut VirtioNetConfig,
|
||||
mac: MacAddr,
|
||||
num_queues: usize,
|
||||
avail_features: &mut u64,
|
||||
@ -129,7 +129,7 @@ pub fn build_net_config_space(
|
||||
config.mac.copy_from_slice(mac.get_bytes());
|
||||
*avail_features |= 1 << VIRTIO_NET_F_MAC;
|
||||
|
||||
build_net_config_space_with_mq(&mut config, num_queues, avail_features);
|
||||
build_net_config_space_with_mq(config, num_queues, avail_features);
|
||||
}
|
||||
|
||||
pub fn build_net_config_space_with_mq(
|
||||
|
@ -268,19 +268,16 @@ pub struct NetQueuePair {
|
||||
}
|
||||
|
||||
impl NetQueuePair {
|
||||
pub fn process_tx(&mut self, mut queue: &mut Queue) -> Result<bool, NetQueuePairError> {
|
||||
pub fn process_tx(&mut self, queue: &mut Queue) -> Result<bool, NetQueuePairError> {
|
||||
let mem = self
|
||||
.mem
|
||||
.as_ref()
|
||||
.ok_or(NetQueuePairError::NoMemoryConfigured)
|
||||
.map(|m| m.memory())?;
|
||||
|
||||
let tx_tap_retry = self.tx.process_desc_chain(
|
||||
&mem,
|
||||
&mut self.tap,
|
||||
&mut queue,
|
||||
&mut self.tx_rate_limiter,
|
||||
)?;
|
||||
let tx_tap_retry =
|
||||
self.tx
|
||||
.process_desc_chain(&mem, &mut self.tap, queue, &mut self.tx_rate_limiter)?;
|
||||
|
||||
// We got told to try again when writing to the tap. Wait for the TAP to be writable
|
||||
if tx_tap_retry && !self.tx_tap_listening {
|
||||
@ -317,19 +314,17 @@ impl NetQueuePair {
|
||||
Ok(queue.needs_notification(&mem, queue.next_used))
|
||||
}
|
||||
|
||||
pub fn process_rx(&mut self, mut queue: &mut Queue) -> Result<bool, NetQueuePairError> {
|
||||
pub fn process_rx(&mut self, queue: &mut Queue) -> Result<bool, NetQueuePairError> {
|
||||
let mem = self
|
||||
.mem
|
||||
.as_ref()
|
||||
.ok_or(NetQueuePairError::NoMemoryConfigured)
|
||||
.map(|m| m.memory())?;
|
||||
|
||||
self.rx_desc_avail = !self.rx.process_desc_chain(
|
||||
&mem,
|
||||
&mut self.tap,
|
||||
&mut queue,
|
||||
&mut self.rx_rate_limiter,
|
||||
)?;
|
||||
self.rx_desc_avail =
|
||||
!self
|
||||
.rx
|
||||
.process_desc_chain(&mem, &mut self.tap, queue, &mut self.rx_rate_limiter)?;
|
||||
let rate_limit_reached = self
|
||||
.rx_rate_limiter
|
||||
.as_ref()
|
||||
|
Loading…
x
Reference in New Issue
Block a user