mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
net_util: Consolidate vnet_hdr_len() functions
As a result of refactoring this function was duplicated so consolidate into the top level. Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
@@ -2,13 +2,12 @@
|
||||
//
|
||||
// SPDX-License-Identifier: Apache-2.0 AND BSD-3-Clause
|
||||
|
||||
use super::Tap;
|
||||
use super::{vnet_hdr_len, Tap};
|
||||
use std::cmp;
|
||||
use std::io::Write;
|
||||
use std::num::Wrapping;
|
||||
use vm_memory::{Bytes, GuestAddress, GuestMemoryMmap};
|
||||
use vm_virtio::{DescriptorChain, Queue};
|
||||
use virtio_bindings::bindings::virtio_net::virtio_net_hdr_v1
|
||||
|
||||
/// The maximum buffer size when segmentation offload is enabled. This
|
||||
/// includes the 12-byte virtio net header.
|
||||
@@ -183,7 +182,3 @@ impl RxVirtio {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn vnet_hdr_len() -> usize {
|
||||
std::mem::size_of::<virtio_net_hdr_v1>()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user