Make all network benchmark run with tap backend and vhost on

This commit is contained in:
Jianfeng Jiang
2024-11-14 07:37:51 +00:00
committed by Tate, Hongliang Tian
parent 03aee4a7d7
commit c8c9b9753e
14 changed files with 51 additions and 25 deletions

View File

@ -32,13 +32,18 @@ bitflags! {
const VIRTIO_NET_F_GUEST_ANNOUNCE = 1 << 21; // Driver can send gratuitous packets.
const VIRTIO_NET_F_MQ = 1 << 22; // Device supports multiqueue with automatic receive steering.
const VIRTIO_NET_F_CTRL_MAC_ADDR = 1 << 23; // Set MAC address through control channel.
// const VIRTIO_NET_F_HOST_USO = 1 << 56; // Device can receive USO packets.
// const VIRTIO_NET_F_HASH_REPORT = 1 << 57; // Device can report per-packet hash value and a type of calculated hash.
// const VIRTIO_NET_F_GUEST_HDRLEN = 1 << 59; // Driver can provide the exact hdr_len value. Device benefits from knowing the exact header length.
// const VIRTIO_NET_F_RSS = 1 << 60; // Device supports RSS (receive-side scaling) with Toeplitz hash calculation and configurable hash parameters for receive steering.
// const VIRTIO_NET_F_RSC_EXT = 1 << 61; // DevicecanprocessduplicatedACKsandreportnumberofcoalescedseg- ments and duplicated ACKs.
// const VIRTIO_NET_F_STANDBY = 1 << 62; // Device may act as a standby for a primary device with the same MAC address.
// const VIRTIO_NET_F_SPEED_DUPLEX = 1 << 63; // Device reports speed and duplex.
const VIRTIO_NET_F_HASH_TUNNEL = 1 << 51; // Device supports inner header hash for encapsulated packets.
const VIRTIO_NET_F_VQ_NOTF_COAL = 1 << 52; // Device supports virtqueue notification coalescing.
const VIRTIO_NET_F_NOTF_COAL = 1 << 53; // Device supports notifications coalescing.
const VIRTIO_NET_F_GUEST_USO4 = 1 << 54; // Driver can receive USOv4 packets.
const VIRTIO_NET_F_GUEST_USO6 = 1 << 55; // Driver can receive USOv6 packets.
const VIRTIO_NET_F_HOST_USO = 1 << 56; // Device can receive USO packets.
const VIRTIO_NET_F_HASH_REPORT = 1 << 57; // Device can report per-packet hash value and a type of calculated hash.
const VIRTIO_NET_F_GUEST_HDRLEN = 1 << 59; // Driver can provide the exact hdr_len value. Device benefits from knowing the exact header length.
const VIRTIO_NET_F_RSS = 1 << 60; // Device supports RSS (receive-side scaling) with Toeplitz hash calculation and configurable hash parameters for receive steering.
const VIRTIO_NET_F_RSC_EXT = 1 << 61; // DevicecanprocessduplicatedACKsandreportnumberofcoalescedseg- ments and duplicated ACKs.
const VIRTIO_NET_F_STANDBY = 1 << 62; // Device may act as a standby for a primary device with the same MAC address.
const VIRTIO_NET_F_SPEED_DUPLEX = 1 << 63; // Device reports speed and duplex.
}
}

View File

@ -10,7 +10,7 @@ use aster_network::{
AnyNetworkDevice, EthernetAddr, RxBuffer, TxBuffer, VirtioNetError, RX_BUFFER_POOL,
};
use aster_util::slot_vec::SlotVec;
use log::debug;
use log::{debug, warn};
use ostd::{
mm::DmaStream,
sync::{LocalIrqDisabled, SpinLock},
@ -44,6 +44,14 @@ impl NetworkDevice {
let device_features = NetworkFeatures::from_bits_truncate(device_features);
let supported_features = NetworkFeatures::support_features();
let network_features = device_features & supported_features;
if network_features != device_features {
warn!(
"Virtio net contains unsupported device features: {:?}",
device_features.difference(supported_features)
);
}
debug!("{:?}", network_features);
network_features.bits()
}