qemu-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

virtio-net can't work with event_idx=off


From: Yin Fengwei
Subject: virtio-net can't work with event_idx=off
Date: Wed, 17 Apr 2024 14:11:26 +0800
User-agent: Mozilla Thunderbird

Hi,
When tried to run iperf3 between guest and host, virtio-net can work correctly
after a while if disable event_idx by "event_idx=off".

It's on a Intel x86 platform. The host/guest kernel doesn't matter as I hit
the issue with kernels form different distributions/built-by-my-self.

The issue can be reproduced with v8.2.2 (I suppose we can hit it on master 
branch
also).


The qemu commandline I am using is:
qemu \                                                      
        --accel kvm \                                              
        -no-reboot \
        -smp 4 \          
        -m 16G \
        -nographic \
        -vga none \
        -chardev stdio,id=mux,mux=on,signal=off \
        -device virtio-serial,romfile= \
        -device virtconsole,chardev=mux \
        -device virtio-blk-pci,drive=virtio-disk0 \
        -drive 
file=/home/sdp/image/debian_bullseye_gnome.img,if=none,id=virtio-disk0 \
        -netdev 
bridge,helper=/usr/lib/qemu/qemu-bridge-helper,id=network0,br=virbr0 \
        -device virtio-net,netdev=network0,event_idx=off \
        -serial chardev:mux \
        -monitor chardev:mux \
        -kernel ${KERNEL_IMAGE} \
        -initrd ${INITRD_IMAGE} \
        -append "root=/dev/vda2 rw console=hvc0 earlyprintk=ttyS0" \
        -monitor pty \
        -nodefaults

If remove event_idx=off, everything is fine.

Another finding: if the following commit is reverted, everything is fine even
with "event_idx=off":

commit 850cd20b072cd330cb24aa1c92732b9722998d40
Author: Ilya Maximets <i.maximets@ovn.org>
Date:   Wed Sep 27 15:50:33 2023 +0200

    virtio: use shadow_avail_idx while checking number of heads
    
    We do not need the most up to date number of heads, we only want to
    know if there is at least one.
    
    Use shadow variable as long as it is not equal to the last available
    index checked.  This avoids expensive qatomic dereference of the
    RCU-protected memory region cache as well as the memory access itself.
    
    The change improves performance of the af-xdp network backend by 2-3%.
    
    Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
    Message-Id: <20230927135157.2316982-1-i.maximets@ovn.org>
    Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>



Regards
Yin, Fengwei



reply via email to

[Prev in Thread] Current Thread [Next in Thread]