Bug 1256626 - windows guest(win7/win10) CTRL_VLAN=on/off does not support for virtio-net-pci
windows guest(win7/win10) CTRL_VLAN=on/off does not support for virtio-net...
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: virtio-win (Show other bugs)
7.2
x86_64 Linux
medium Severity medium
: rc
: ---
Assigned To: Yan Vugenfirer
Virtualization Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-08-25 03:03 EDT by weliao
Modified: 2017-08-01 08:53 EDT (History)
9 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-08-01 08:53:08 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
VLAN Configuration (448 bytes, text/x-ms-regedit)
2017-01-10 08:54 EST, Yan Vugenfirer
no flags Details
Loading netkvm driver with build 130 (23.25 KB, text/plain)
2017-01-22 03:52 EST, Peixiu Hou
no flags Details
Set VlanID and query-rx-filter (48.92 KB, text/plain)
2017-01-22 03:53 EST, Peixiu Hou
no flags Details
Disable netkvm and Enable it (48.92 KB, text/plain)
2017-01-22 04:00 EST, Peixiu Hou
no flags Details
debugviewer.log (533.93 KB, text/plain)
2017-03-06 11:07 EST, Peixiu Hou
no flags Details
debug-viewer settings (54.71 KB, image/png)
2017-05-11 04:47 EDT, Peixiu Hou
no flags Details

  None (edit)
Description weliao 2015-08-25 03:03:41 EDT
Description of problem:
Boot windows7/windows10 guest,disable/enable CTRL_VLAN feature in qemu cmdline,check vlan table in rx-filter infomation, the vlan-table all filled from 0~4095 

Version-Release number of selected component (if applicable):
3.10.0-305.el7.x86_64
qemu-kvm-1.5.3-101.el7.x86_64
virtio-win-prewhql-0.1-109

How reproducible:
100%

Steps to Reproduce:
1.Boot windows7/windows10 guest enable CTRL_VLAN feature in qemu cmdline
-netdev tap,id=hostnet0,vhost=on,vhostforce=off \
-device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:83:66:77:88:66,bus=pci.0,addr=0x3,status=on,ctrl_vlan=on 
2.Check vlan table in rx-filter information when guest starts.
{ "execute": "query-rx-filter", "arguments": { "name": "net0" } }

Actual results:
the vlan-table is filled from 0~4095.

Expected results:
the vlan-table is empty


Additional info:
Qemu-kvm cmdline as below:
/usr/libexec/qemu-kvm -name win10qcow2 -M pc-i440fx-rhel7.0.0 -cpu SandyBridge -m 4096 -realtime mlock=off -smp 4,sockets=1,cores=4 \
-device virtio-scsi-pci,id=scsi2,indirect_desc=off,event_idx=off,bus=pci.0 \
-drive file=/mnt/win10.qcow2.1,snapshot=on,if=none,id=drive-scsi-disk0,format=qcow2 \
-device scsi-hd,bus=scsi2.0,drive=drive-scsi-disk0,id=scsi-disk0 \
-boot menu=on -netdev tap,id=hostnet0,vhost=on,vhostforce=off \
-device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:83:66:77:88:66,bus=pci.0,addr=0x3,status=on,ctrl_vlan=on \
-device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,vgamem_mb=16,bus=pci.0,addr=0x5 \
-spice port=6800,disable-ticketing, -monitor stdio -qmp tcp:0:4444,server,nowait
Comment 2 Yan Vugenfirer 2015-09-22 07:47:27 EDT
Can please provide full exchange of qmp commands before issuing "query-rx-filter"?

Thanks.
Comment 3 Yan Vugenfirer 2015-09-22 07:53:56 EDT
Please ignore comment #2
Comment 4 Yan Vugenfirer 2015-09-22 08:30:51 EDT
1. I think the bug description describes normal behaviour - Windows will fill all possible VLAN values for filtering (allowing to pass) when no specific plan ID is specified.

2. We have a bug in the driver that we ignore ctrl_vlan=off and will still use control queue to set vlan filtering. This should be fixed.
Comment 6 Peixiu Hou 2015-12-09 04:52:21 EST
Hello,

Reproduced this issue on virtio-win-prewhql-0.1-109 version.

Verified this issue on virtio-win-prewhql-0.1-111 verion.

Steps:
1.Boot windows10 guest enable CTRL_VLAN feature in qemu cmdline.
-netdev tap,id=hostnet0,vhost=on,vhostforce=off \
-device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:83:66:77:88:66,bus=pci.0,addr=0x3,status=on,ctrl_vlan=on 
2.Check vlan table in rx-filter information when guest starts.
{ "execute": "query-rx-filter", "arguments": { "name": "net0" } }

Actual Results:
The vlan-table is filled from 0~4095.


On virtio-win-prewhql-0.1-109 verion , issue can be reproduced.
On virtio-win-prewhql-0.1-111 verion , issue also can be reproduced.
Based on above ,this issue has not been fixed yet.
Comment 7 Peixiu Hou 2016-01-06 21:26:58 EST
Hello Yan,

Reproduced this issue on virtio-win-prewhql-0.1-109 version.

Verified this issue on virtio-win-prewhql-0.1-112 verion, the issue can be reproduced.

Steps same as comment#0

Actual Results:
The vlan-table is filled from 0~4095.


Best Regard!
Peixiu Hou
Comment 8 lijin 2016-01-06 21:32:13 EST
re-assign this bug according to comment#7
Comment 9 Yan Vugenfirer 2016-01-07 02:04:22 EST
(In reply to lijin from comment #8)
> re-assign this bug according to comment#7

Please check comment 4. What are the values of the vlan-table? 

If vlan is on, the table should be filled.
Comment 10 Peixiu Hou 2016-01-07 03:20:59 EST
Hi Yan,


I retest this case on a linux guest,the actual results as follows:

set ctrl_vlan=on, the vlan table shown empty; 
set ctrl_vlan=off, the vlan table is filled from 0~4095.

And I verified this issue on a windows guest with 112 build, no matter ctrl_vlan is on or off, the vlan table both filled from 0~4095.


Best Regards!
Peixiu Hou
Comment 11 Yan Vugenfirer 2016-01-07 03:26:05 EST
(In reply to Peixiu Hou from comment #10)
> Hi Yan,
> 
> 
> I retest this case on a linux guest,the actual results as follows:
> 
> set ctrl_vlan=on, the vlan table shown empty; 
> set ctrl_vlan=off, the vlan table is filled from 0~4095.
> 
> And I verified this issue on a windows guest with 112 build, no matter
> ctrl_vlan is on or off, the vlan table both filled from 0~4095.
> 
> 
> Best Regards!
> Peixiu Hou

When vlan is on and we don't have specific plan setting, Windows driver will fill the table from 0 to 4095 (no filtering).

Best regards,
Yan.
Comment 12 Peixiu Hou 2016-01-10 21:32:52 EST
Hello Yan,

According to your comment#11, we verified this issue with specific vlan setting, but for windows guest, we cannot research a good way for vlan setting. About netkvm driver, we can find "priority or vlan" setting on advance option, but not find "vlan id" setting~~

Could you help us provide detail steps of "specific vlan setting" ?

Thanks very much~~


Best Regards!
Peixiu Hou
Comment 13 Yan Vugenfirer 2017-01-10 08:54 EST
Created attachment 1239114 [details]
VLAN Configuration

I am attaching the reg file that can add vlanid entry for the device in device manager "advanced" type. You will have to use regedit to find the entry for actual device in your system and change "0013" id that you see below to ID from your system


[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Class\{4d36e972-e325-11ce-bfc1-08002be10318}\0013\Ndi\params\VlanID]

"ParamDesc"="VlanID"

"default"="0"

"type"="int"

"min"="0"
Comment 14 Yan Vugenfirer 2017-01-10 08:55:26 EST
Please test with using settings from comment #13
Comment 15 Peixiu Hou 2017-01-11 09:39:18 EST
Hi Yan,

Thanks for your support firstly~
I tried this issue after setting the VlanID, the result as following:

1. Keep the ctrl_vlan=on, set the VlanID to 1, query-rx-filter return info including "vlan-table": [1].
2. Keep the ctrl_vlan=on, set the VlanID to 10, query-rx-filter return info including "vlan-table": [10].
3. Keep the ctrl_vlan=on, set the VlanID to 4095, query-rx-filter return info including "vlan-table": [4095].
4. Keep the ctrl_vlan=on, set the VlanID to 4096, query-rx-filter return info including "vlan-table": [4095,4094,......5,4,3,2,1,0].
5. Keep the ctrl_vlan=on, set the VlanID to 0, query-rx-filter return info including "vlan-table": [4095,4094,......5,4,3,2,1,0].

According to upper results, the number 4096 is a invalid value of VlanID, query-rx-filter will return 0~4095, but 0 is a valid value of VlanID, why query-rx-filter also return 0~4095, shouldn't return like "vlan-table": [0] ? Thanks a lot~


Best Regards~
Peixiu Hou
Comment 16 Yan Vugenfirer 2017-01-19 07:12:08 EST
(In reply to Peixiu Hou from comment #15)
> Hi Yan,
> 
> Thanks for your support firstly~
> I tried this issue after setting the VlanID, the result as following:
> 
> 1. Keep the ctrl_vlan=on, set the VlanID to 1, query-rx-filter return info
> including "vlan-table": [1].
> 2. Keep the ctrl_vlan=on, set the VlanID to 10, query-rx-filter return info
> including "vlan-table": [10].
> 3. Keep the ctrl_vlan=on, set the VlanID to 4095, query-rx-filter return
> info including "vlan-table": [4095].
> 4. Keep the ctrl_vlan=on, set the VlanID to 4096, query-rx-filter return
> info including "vlan-table": [4095,4094,......5,4,3,2,1,0].
> 5. Keep the ctrl_vlan=on, set the VlanID to 0, query-rx-filter return info
> including "vlan-table": [4095,4094,......5,4,3,2,1,0].
> 
> According to upper results, the number 4096 is a invalid value of VlanID,
> query-rx-filter will return 0~4095, but 0 is a valid value of VlanID, why
> query-rx-filter also return 0~4095, shouldn't return like "vlan-table": [0]
> ? Thanks a lot~
> 
> 
> Best Regards~
> Peixiu Hou

We have the following code in the driver: 

pContext->VlanId = pConfiguration->VlanId.ulValue & 0xfff;

Where the pConfiguration->VlanId.ulValue is the value we read from registry.

We can possibly do two things here:

1. Printout debug message

2. Fail loading the driver (could be an overkill).
Comment 17 Peixiu Hou 2017-01-22 03:52 EST
Created attachment 1243295 [details]
Loading netkvm driver with build 130
Comment 18 Peixiu Hou 2017-01-22 03:53 EST
Created attachment 1243296 [details]
Set VlanID and query-rx-filter
Comment 19 Peixiu Hou 2017-01-22 04:00 EST
Created attachment 1243297 [details]
Disable netkvm and Enable it

Hi Yan,

For "Printout debug message", pls refer to upper 2 attached log files.
For "Fail loading the driver", I tried to collect the log through disable netkvm then enable it, you can refer to this netkvm_disale&enable.LOG. I'm not sure if it's correct, if I'm wrong, pls correct me, thanks~

Best Regards~
Peixiu
Comment 20 Yan Vugenfirer 2017-01-22 06:25:03 EST
(In reply to Peixiu Hou from comment #19)
> Created attachment 1243297 [details]
> Disable netkvm and Enable it
> 
> Hi Yan,
> 
> For "Printout debug message", pls refer to upper 2 attached log files.
> For "Fail loading the driver", I tried to collect the log through disable
> netkvm then enable it, you can refer to this netkvm_disale&enable.LOG. I'm
> not sure if it's correct, if I'm wrong, pls correct me, thanks~
> 

Thanks! What I meant we could add those feature. Currently they are not in the driver. I think adding warning in debug log is enough. Will add for next versions.

> Best Regards~
> Peixiu
Comment 21 Yan Vugenfirer 2017-02-09 08:22:25 EST
Adding debugging message in case VLAN ID is larger than possible.
Comment 22 Peixiu Hou 2017-03-06 11:06:21 EST
Reproduced this issue with virtio-win-prewhql-0.1-133.

Tried to add vlanid entry for the device in device manager "advanced" type,
change the Vlan ID value to 0, 1, 4095, 4096, 4100 and open the debugviewer, the { "execute": "query-rx-filter", "arguments": { "name": "net0" } } result also as upper comment#15. And when setting the Vlan ID larger than 4095, none any warning message show in debugviewer output.

The debugviewer log as attachment debugviewer.LOG, and I'm not sure if the check point is correct, if I'm wrong, pls correct me, thanks~


Best Regards~
Peixiu
Comment 23 Peixiu Hou 2017-03-06 11:07 EST
Created attachment 1260450 [details]
debugviewer.log
Comment 24 lijin 2017-03-28 23:25:45 EDT
Reassign this bug according to comment22.

Yan,could you have a check?

Thanks
Comment 25 Yan Vugenfirer 2017-03-30 07:48:38 EDT
(In reply to lijin from comment #24)
> Reassign this bug according to comment22.
> 
> Yan,could you have a check?
> 
> Thanks

My mistake. We already have mechanism that checks the range for the parameters and fixes the value. Changed the debug level so the printouts will be seen:

[GetConfigurationEntry] value read for *LsoV2IPv4 - current value = 0x1, input value = 0x1
[GetConfigurationEntry] value read for *LsoV2IPv6 - current value = 0x1, input value = 0x1
[GetConfigurationEntry] value read for *PriorityVLANTag - current value = 0x3, input value = 0x3
>>>> Below is the error for VLAN ID
[GetConfigurationEntry] out of range read for VlanId - current value = 0x0, input value = 0x1000
>>>>>
[GetConfigurationEntry] nothing read for PublishIndices - current value = 0x1
Comment 26 Peixiu Hou 2017-05-11 04:46:39 EDT
Hi Yan,

I tried this bug with virtio-win-prewhql-137, keep the vlan-id=0, run "{ "execute": "query-rx-filter", "arguments": { "name": "net0" } } " on qmp monitor, it also print "vlan-table": [4095,4094,......5,4,3,2,1,0] , did not show error like "[GetConfigurationEntry] out of range read for VlanId - current value = 0x0, input value = 0x1000". 
And I also checked on debug-viewer, after disable & enable netkvm device, didn't find any error about VlanId. the log file like the debugviewer.log. The debugviewer setup as attachment picture.

So could you help to confirm if my test steps are correct? or tell us how can see this error "out of range read for VlanId - current value = 0x0, input value = 0x1000"? Thanks a lot~

Best Regards~
Peixiu
Comment 27 Peixiu Hou 2017-05-11 04:47 EDT
Created attachment 1277790 [details]
debug-viewer settings
Comment 28 Yan Vugenfirer 2017-05-11 05:07:02 EDT
Sameeh, please help Peixiu.
Comment 29 Sameeh Jubran 2017-05-11 05:22:31 EDT
(In reply to Peixiu Hou from comment #26)
> Hi Yan,
> 
> I tried this bug with virtio-win-prewhql-137, keep the vlan-id=0, run "{
> "execute": "query-rx-filter", "arguments": { "name": "net0" } } " on qmp
> monitor, it also print "vlan-table": [4095,4094,......5,4,3,2,1,0] , did not
> show error like "[GetConfigurationEntry] out of range read for VlanId -
> current value = 0x0, input value = 0x1000". 
> And I also checked on debug-viewer, after disable & enable netkvm device,
> didn't find any error about VlanId. the log file like the debugviewer.log.
> The debugviewer setup as attachment picture.
> 
> So could you help to confirm if my test steps are correct? or tell us how
> can see this error "out of range read for VlanId - current value = 0x0,
> input value = 0x1000"? Thanks a lot~
Where are you trying to insert this value? If it is in the driver's advanced tab Windows prevents you from inserting any out of range value for the vlan id as it is configured to be [0, 4095] and thus the error message "out of range read for VlanId - current value = 0x0, input value = 0x1000" shouldn't appear in the current behaviour of the driver.
> 
> Best Regards~
> Peixiu
Comment 30 Peixiu Hou 2017-05-11 06:00:14 EDT
(In reply to Sameeh from comment #29)
> (In reply to Peixiu Hou from comment #26)
> > Hi Yan,
> > 
> > I tried this bug with virtio-win-prewhql-137, keep the vlan-id=0, run "{
> > "execute": "query-rx-filter", "arguments": { "name": "net0" } } " on qmp
> > monitor, it also print "vlan-table": [4095,4094,......5,4,3,2,1,0] , did not
> > show error like "[GetConfigurationEntry] out of range read for VlanId -
> > current value = 0x0, input value = 0x1000". 
> > And I also checked on debug-viewer, after disable & enable netkvm device,
> > didn't find any error about VlanId. the log file like the debugviewer.log.
> > The debugviewer setup as attachment picture.
> > 
> > So could you help to confirm if my test steps are correct? or tell us how
> > can see this error "out of range read for VlanId - current value = 0x0,
> > input value = 0x1000"? Thanks a lot~
> Where are you trying to insert this value? If it is in the driver's advanced
> tab Windows prevents you from inserting any out of range value for the vlan
> id as it is configured to be [0, 4095] and thus the error message "out of
> range read for VlanId - current value = 0x0, input value = 0x1000" shouldn't
> appear in the current behaviour of the driver.

Thanks and yes, I set the vlan id in the driver's advanced tab. and tried to set it as "-1", seen the error message on the guest.

But this bug is for qmp command test, it need to run "{"execute": "query-rx-filter", "arguments": { "name": "net0" } }" on qmp monitor, I misunderstood the value "0" is out of range, sorry for that. According to your said,the value "0" is in the design range, so if the "ctrl_vlan=on" and set the vlan-id=0, the query-rx-filter should show "vlan-table": [0]".

> > 
> > Best Regards~
> > Peixiu
Comment 31 Sameeh Jubran 2017-05-11 09:31:09 EDT
(In reply to Peixiu Hou from comment #30)
> (In reply to Sameeh from comment #29)
> > (In reply to Peixiu Hou from comment #26)
> > > Hi Yan,
> > > 
> > > I tried this bug with virtio-win-prewhql-137, keep the vlan-id=0, run "{
> > > "execute": "query-rx-filter", "arguments": { "name": "net0" } } " on qmp
> > > monitor, it also print "vlan-table": [4095,4094,......5,4,3,2,1,0] , did not
> > > show error like "[GetConfigurationEntry] out of range read for VlanId -
> > > current value = 0x0, input value = 0x1000". 
> > > And I also checked on debug-viewer, after disable & enable netkvm device,
> > > didn't find any error about VlanId. the log file like the debugviewer.log.
> > > The debugviewer setup as attachment picture.
> > > 
> > > So could you help to confirm if my test steps are correct? or tell us how
> > > can see this error "out of range read for VlanId - current value = 0x0,
> > > input value = 0x1000"? Thanks a lot~
> > Where are you trying to insert this value? If it is in the driver's advanced
> > tab Windows prevents you from inserting any out of range value for the vlan
> > id as it is configured to be [0, 4095] and thus the error message "out of
> > range read for VlanId - current value = 0x0, input value = 0x1000" shouldn't
> > appear in the current behaviour of the driver.
> 
> Thanks and yes, I set the vlan id in the driver's advanced tab. and tried to
> set it as "-1", seen the error message on the guest.
> 
> But this bug is for qmp command test, it need to run "{"execute":
> "query-rx-filter", "arguments": { "name": "net0" } }" on qmp monitor, I
> misunderstood the value "0" is out of range, sorry for that. According to
> your said,the value "0" is in the design range, so if the "ctrl_vlan=on" and
> set the vlan-id=0, the query-rx-filter should show "vlan-table": [0]".
When the vlan id is set to 0 it means that the card can receive any packet with any vlan tag [0-4095], and that's why the driver returns [0 , 1, 2 ... 4095] when the vlan id is set 0 as all of these values are in the active list of the vlan-table.

Please take a look at the vlan-table field documentation in qemu's QMP Reference: 
https://elmarco.fedorapeople.org/qemu-qmp-ref.pdf
> 
> > > 
> > > Best Regards~
> > > Peixiu
Comment 32 lijin 2017-05-12 03:12:16 EDT
change status to verified according to comment#15 and comment#31
Comment 35 errata-xmlrpc 2017-08-01 08:53:08 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2017:2341

Note You need to log in before you can comment on or make changes to this bug.