mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2025-01-12 15:42:57 +00:00
virtio-devices: net: Use "num_queues" for number of queues
This improves consistency with other parts of the code. Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
parent
bbcf69c58c
commit
b4eddce090
@ -565,11 +565,11 @@ impl VirtioDevice for Net {
|
|||||||
) -> ActivateResult {
|
) -> ActivateResult {
|
||||||
self.common.activate(&queues, &queue_evts, &interrupt_cb)?;
|
self.common.activate(&queues, &queue_evts, &interrupt_cb)?;
|
||||||
|
|
||||||
let queue_num = queues.len();
|
let num_queues = queues.len();
|
||||||
let event_idx = self.common.feature_acked(VIRTIO_RING_F_EVENT_IDX.into());
|
let event_idx = self.common.feature_acked(VIRTIO_RING_F_EVENT_IDX.into());
|
||||||
if self.common.feature_acked(VIRTIO_NET_F_CTRL_VQ.into()) && queue_num % 2 != 0 {
|
if self.common.feature_acked(VIRTIO_NET_F_CTRL_VQ.into()) && num_queues % 2 != 0 {
|
||||||
let mut cvq_queue = queues.remove(queue_num - 1);
|
let mut cvq_queue = queues.remove(num_queues - 1);
|
||||||
let cvq_queue_evt = queue_evts.remove(queue_num - 1);
|
let cvq_queue_evt = queue_evts.remove(num_queues - 1);
|
||||||
|
|
||||||
cvq_queue.set_event_idx(event_idx);
|
cvq_queue.set_event_idx(event_idx);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user