mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-10-05 21:15:45 +00:00
performance-metrics: Be consistent with num_queues
Don't treat it as the number of pairs. Instead calculate the number of pairs later when necessary. Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
parent
70a3564a5e
commit
18d51d3bd1
@ -228,7 +228,7 @@ const TEST_LIST: [PerformanceTest; 15] = [
|
|||||||
name: "performance_virtio_net_throughput_bps_single_queue_rx_bps",
|
name: "performance_virtio_net_throughput_bps_single_queue_rx_bps",
|
||||||
func_ptr: performance_net_throughput,
|
func_ptr: performance_net_throughput,
|
||||||
control: PerformanceTestControl {
|
control: PerformanceTestControl {
|
||||||
num_queues: Some(1), // used as 'queue_pairs'
|
num_queues: Some(2),
|
||||||
queue_size: Some(256),
|
queue_size: Some(256),
|
||||||
net_rx: Some(true),
|
net_rx: Some(true),
|
||||||
..PerformanceTestControl::default()
|
..PerformanceTestControl::default()
|
||||||
@ -238,7 +238,7 @@ const TEST_LIST: [PerformanceTest; 15] = [
|
|||||||
name: "performance_virtio_net_throughput_single_queue_tx_bps",
|
name: "performance_virtio_net_throughput_single_queue_tx_bps",
|
||||||
func_ptr: performance_net_throughput,
|
func_ptr: performance_net_throughput,
|
||||||
control: PerformanceTestControl {
|
control: PerformanceTestControl {
|
||||||
num_queues: Some(1), // used as 'queue_pairs'
|
num_queues: Some(2),
|
||||||
queue_size: Some(256),
|
queue_size: Some(256),
|
||||||
net_rx: Some(false),
|
net_rx: Some(false),
|
||||||
..PerformanceTestControl::default()
|
..PerformanceTestControl::default()
|
||||||
@ -248,7 +248,7 @@ const TEST_LIST: [PerformanceTest; 15] = [
|
|||||||
name: "performance_virtio_net_throughput_multi_queue_rx_bps",
|
name: "performance_virtio_net_throughput_multi_queue_rx_bps",
|
||||||
func_ptr: performance_net_throughput,
|
func_ptr: performance_net_throughput,
|
||||||
control: PerformanceTestControl {
|
control: PerformanceTestControl {
|
||||||
num_queues: Some(2), // used as 'queue_pairs'
|
num_queues: Some(4),
|
||||||
queue_size: Some(1024),
|
queue_size: Some(1024),
|
||||||
net_rx: Some(true),
|
net_rx: Some(true),
|
||||||
..PerformanceTestControl::default()
|
..PerformanceTestControl::default()
|
||||||
@ -258,7 +258,7 @@ const TEST_LIST: [PerformanceTest; 15] = [
|
|||||||
name: "performance_virtio_net_throughput_multi_queue_tx_bps",
|
name: "performance_virtio_net_throughput_multi_queue_tx_bps",
|
||||||
func_ptr: performance_net_throughput,
|
func_ptr: performance_net_throughput,
|
||||||
control: PerformanceTestControl {
|
control: PerformanceTestControl {
|
||||||
num_queues: Some(2), // used as 'queue_pairs'
|
num_queues: Some(4),
|
||||||
queue_size: Some(1024),
|
queue_size: Some(1024),
|
||||||
net_rx: Some(false),
|
net_rx: Some(false),
|
||||||
..PerformanceTestControl::default()
|
..PerformanceTestControl::default()
|
||||||
|
@ -215,7 +215,7 @@ fn measure_virtio_net_throughput(
|
|||||||
|
|
||||||
pub fn performance_net_throughput(control: &PerformanceTestControl) -> f64 {
|
pub fn performance_net_throughput(control: &PerformanceTestControl) -> f64 {
|
||||||
let test_time = control.test_timeout;
|
let test_time = control.test_timeout;
|
||||||
let queue_pairs = control.num_queues.unwrap();
|
let num_queues = control.num_queues.unwrap();
|
||||||
let queue_size = control.queue_size.unwrap();
|
let queue_size = control.queue_size.unwrap();
|
||||||
let rx = control.net_rx.unwrap();
|
let rx = control.net_rx.unwrap();
|
||||||
|
|
||||||
@ -224,14 +224,11 @@ pub fn performance_net_throughput(control: &PerformanceTestControl) -> f64 {
|
|||||||
|
|
||||||
let net_params = format!(
|
let net_params = format!(
|
||||||
"tap=,mac={},ip={},mask=255.255.255.0,num_queues={},queue_size={}",
|
"tap=,mac={},ip={},mask=255.255.255.0,num_queues={},queue_size={}",
|
||||||
guest.network.guest_mac,
|
guest.network.guest_mac, guest.network.host_ip, num_queues, queue_size,
|
||||||
guest.network.host_ip,
|
|
||||||
queue_pairs * 2,
|
|
||||||
queue_size,
|
|
||||||
);
|
);
|
||||||
|
|
||||||
let mut child = GuestCommand::new(&guest)
|
let mut child = GuestCommand::new(&guest)
|
||||||
.args(&["--cpus", &format!("boot={}", queue_pairs * 2)])
|
.args(&["--cpus", &format!("boot={}", num_queues)])
|
||||||
.args(&["--memory", "size=4G"])
|
.args(&["--memory", "size=4G"])
|
||||||
.args(&["--kernel", direct_kernel_boot_path().to_str().unwrap()])
|
.args(&["--kernel", direct_kernel_boot_path().to_str().unwrap()])
|
||||||
.args(&["--cmdline", DIRECT_KERNEL_BOOT_CMDLINE])
|
.args(&["--cmdline", DIRECT_KERNEL_BOOT_CMDLINE])
|
||||||
@ -244,7 +241,7 @@ pub fn performance_net_throughput(control: &PerformanceTestControl) -> f64 {
|
|||||||
|
|
||||||
let r = std::panic::catch_unwind(|| {
|
let r = std::panic::catch_unwind(|| {
|
||||||
guest.wait_vm_boot(None).unwrap();
|
guest.wait_vm_boot(None).unwrap();
|
||||||
measure_virtio_net_throughput(test_time, queue_pairs, &guest, rx).unwrap()
|
measure_virtio_net_throughput(test_time, num_queues / 2, &guest, rx).unwrap()
|
||||||
});
|
});
|
||||||
|
|
||||||
let _ = child.kill();
|
let _ = child.kill();
|
||||||
|
Loading…
Reference in New Issue
Block a user