<div dir="ltr">Hi Michal,<div>these are the steps:</div><div>- start the vm with qemu </div><div>sudo qemu-system-x86_64-spice -m 2048 -enable-kvm -smp 3 -cdrom /home/machine_A/ubuntu.iso -netdev tap,ifname=tap0,vhost=on,id=n1,vhostforce=on,queues=3,script=/etc/tap0_ifup.sh,downscript=/etc/tap0_ifdown.sh -device virtio-net-pci,netdev=n1,mac=9E:58:00:d2:53:03,mq=on,vectors=8 -netdev tap,ifname=tap1,vhost=on,id=n2,vhostforce=on,queues=3,script=/etc/tap1_ifup.sh,downscript=/etc/tap1_ifdown.sh -device virtio-net-pci,netdev=n2,mac=7A:53:00:d1:59:04,mq=on,vectors=8  -device virtio-net,netdev=network2 -netdev user,id=network2 -hda switch_A.img</div><div><br></div><div>- attach the tap to the bridges in the host machine (to have the traffic coming from the outsider traffic generator injected in the vm)</div><div>- in the VM: </div><div>    - enable ip_forward</div><div>    - enable promiscuous mode for the interface</div><div>    - send the "tc qdisc" command to configure the output NIC with 2 traffic classes (TC) assigned to 2 different queues</div><div>    - add the iptables mangle rules to the POSTROUTING chain to assign TC1 to the traffic with dport 7777 and TC0 to the traffic with dport 8888</div><div>I'm sending 2 UDP flows, I have no loss under 3Mbps each.</div><div>If I capture traffic with tcpdump on the ingress and on the egress nic (of the VM), I see a difference of 50% of packets </div><div><br></div><div>When I did a test on the host machine, to check if it has the same problem, I've reached an aggregated traffic of 90Mbps with no loss.</div><div><br></div><div>That's why I think that there is some misconfiguration on the virtual NIC.</div><div><br></div><div>Thanks</div><div>Silvia</div><div><br></div><div>  </div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Mar 29, 2021 at 11:13 AM Michal Privoznik <<a href="mailto:mprivozn@redhat.com">mprivozn@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 3/27/21 2:53 PM, Silvia Fichera wrote:<br>
> Hi all,<br>
> I want to use tc qdisc settings in a network coposed of several qemu <br>
> VMs, connected through bridges and tap interfaces.<br>
> I generate traffic with a spirent. Everything is fine when the <br>
> scheduling discipline is not installed but when I run the command to set <br>
> taprio queues traffic on the VM's NIC the traffic is dropped, i can send <br>
> max 1mbps.<br>
> I think that there is something missing in the virtual NIC configuration <br>
> or setup. With ethtool i can see that queues are configured. I've also <br>
> noticed the BQL equals to 0, that is different than the physical machine <br>
> (BQL=18600) where everything works correctly.<br>
> I've read that it could be because NIC drivers do not support that setting.<br>
> <br>
> Do you have any suggestions?<br>
<br>
Hey,<br>
<br>
I'm not familiar with taprio, but what's implemented in libvirt is htb <br>
and sfq and that works well. Are you setting qdisc-s yourself or <br>
modifying libvirt created structure?<br>
<br>
Are you setting these qdiscs from the host, right?<br>
I know that when changing QoS settings (when libvirt changes qdics/class <br>
layout) for a brief moment packets are not transmitted from/to guest. I <br>
suspect that kernel is freeing up queues or something. But this does not <br>
look like your case, does it?<br>
<br>
Michal<br>
<br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature">Silvia Fichera</div>