Bug 1263982

Summary: ctrl_vlan does not work if the peer netdev is vhost-user.
Product: Red Hat Enterprise Linux 7 Reporter: Qian Guo <qiguo>
Component: qemu-kvm-rhevAssignee: Victor Kaplansky <victork>
Status: CLOSED WONTFIX QA Contact: Pei Zhang <pezhang>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.2CC: ailan, chayang, ehabkost, juzhang, knoel, victork, virt-maint
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-09-24 08:53:43 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Qian Guo 2015-09-17 09:11:57 UTC
Description of problem:
When set ctrl_vlan=on, the "query-rx-filter" still can flush the vlan table.

Version-Release number of selected component (if applicable):
qemu-kvm-rhev-2.3.0-23.el7.x86_64

guest&host kernel-3.10.0-316.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1.Boot guest with vhost-user, and set ctrl_vlan enabled:

# /usr/libexec/qemu-kvm -name rhel71-br0-1 -S -machine pc-i440fx-rhel7.2.0,accel=kvm,usb=off -cpu IvyBridge -m 4096 -realtime mlock=off -smp 4,sockets=4,cores=1,threads=1 -object memory-backend-file,prealloc=yes,mem-path=/dev/hugepages/qemu,share=on,size=4096M,id=ram-node0 -numa node,nodeid=0,cpus=0-3,memdev=ram-node0 -uuid 7907dc99-aa2d-4a3e-9fca-6087f3cfbbe6 -no-user-config -nodefaults -rtc base=utc,driftfix=slew -global kvm-pit.lost_tick_policy=discard -no-hpet -no-shutdown -boot menu=on -drive file=/home/rhel72cp1.qcow2,if=none,id=drive-virtio-disk0,format=qcow2 -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x5,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1 -chardev socket,id=charnet0,path=/var/run/openvswitch/vhost-user1 -netdev type=vhost-user,id=hostnet0,chardev=charnet0 -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:01:0b:11,bus=pci.0,addr=0x9,ctrl_vlan=on -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -spice port=5901,disable-ticketing,seamless-migration=on -device qxl,id=video0,ram_size=67108864,vram_size=67108864,vgamem_mb=16,bus=pci.0,addr=0xe -msg timestamp=on -monitor stdio -qmp unix:/tmp/q1,server,nowait

2. Try to do the "query-rx-filter"
{ "execute": "query-rx-filter", "arguments": { "name": "net0" } }

3.

Actual results:
The ctrl_vlan does not work:
** since the vlan table is huge, I use "..." to replace the vlan numbers.

{ "execute": "query-rx-filter", "arguments": { "name": "net0" } }
{"return": [{"promiscuous": false, "name": "net0", "main-mac": "52:54:00:01:0b:11", "unicast": "normal", "vlan": "all", "vlan-table": [4095, 4094, 4093, 4092, 4091, 4090, ..., 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0], "unicast-table": [], "multicast": "normal", "multicast-overflow": false, "unicast-overflow": false, "multicast-table": ["33:33:ff:01:0b:11", "33:33:00:00:00:01", "01:00:5e:00:00:fb", "01:00:5e:00:00:01"], "broadcast-allowed": false}]}

Expected results:
If ctrl_vlan enabled, the vlan table should be empty.

Additional info:
1.This bug is not regression, I tried with qemu-kvm-rhev-2.1.2-23.el7.x86_64(7.1GA), can hit such issue too.

2.With tun/tap, works well.

Comment 2 Michael S. Tsirkin 2015-09-21 08:33:31 UTC
I see a minor bug here:
I think that  "vlan": "all" probably should not list the vlan table.
NHot sure it's worth fixing for 7.2.

The reason you see vlan all is probably because you queries the table
before guest booted completely.
Pls wait for guest to boot, then you should see the vlan table in
normal state.

Comment 3 Michael S. Tsirkin 2015-09-21 08:54:20 UTC
oh I didn't notice it's with vhost-user.
that one doesn't support ctrl_vlan so it's expected that all vlans
are allowed.
Again, listing them all is a minor bug.

Comment 4 Qian Guo 2015-09-21 08:59:23 UTC
(In reply to Michael S. Tsirkin from comment #3)
> oh I didn't notice it's with vhost-user.
> that one doesn't support ctrl_vlan so it's expected that all vlans
> are allowed.
> Again, listing them all is a minor bug.

Hi, Michael

Yes, it only occurs with vhost-user, so should I change the bug to RFE?

Thanks,
Qian