Bug 236584 - netmap does not work with VLAN on em driver (was: ifconfig does not honor disabling vlanhwtag)
Summary: netmap does not work with VLAN on em driver (was: ifconfig does not honor dis...
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 12.1-RELEASE
Hardware: amd64 Any
: --- Affects Many People
Assignee: freebsd-net (Nobody)
URL:
Keywords: IntelNetworking, easy, patch
Depends on:
Blocks:
 
Reported: 2019-03-16 22:55 UTC by Murat
Modified: 2020-06-16 00:12 UTC (History)
2 users (show)

See Also:


Attachments
patch to fix ifconfig vlanhwcsum parameter handling for em (492 bytes, patch)
2020-06-15 16:58 UTC, Murat
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Murat 2019-03-16 22:55:49 UTC
Please see the following:

[root@bsd11 ~]# uname -a
FreeBSD bsd11.2 11.2-STABLE FreeBSD 11.2-STABLE #0: Sat Dec 22 11:34:16 PST 2018     root@bsd11.2:/usr/obj/usr/src/sys/GENERIC  amd64

[root@bsd11 ~]# ifconfig em0
em0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
	options=209b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,WOL_MAGIC>
	ether 52:54:00:8a:e5:33
	hwaddr 52:54:00:8a:e5:33
	inet 0.0.0.0 netmask 0xff000000 broadcast 255.255.255.255 
	nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
	media: Ethernet autoselect (1000baseT <full-duplex>)
	status: active

[root@bsd11 ~]# ifconfig em0 -vlanhwtso -vlanhwfilter -vlanhwtag -vlanhwcsum

[root@bsd11 ~]# ifconfig em0
em0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
	options=208b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWCSUM,WOL_MAGIC>
	ether 52:54:00:8a:e5:33
	hwaddr 52:54:00:8a:e5:33
	inet 0.0.0.0 netmask 0xff000000 broadcast 255.255.255.255 
	nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
	media: Ethernet autoselect (1000baseT <full-duplex>)
	status: active

[root@bsd11 ~]# ifconfig em0 -vlanhwcsum

[root@bsd11 ~]# ifconfig em0
em0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
	options=208b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWCSUM,WOL_MAGIC>
	ether 52:54:00:8a:e5:33
	hwaddr 52:54:00:8a:e5:33
	inet 0.0.0.0 netmask 0xff000000 broadcast 255.255.255.255 
	nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
	media: Ethernet autoselect (1000baseT <full-duplex>)
	status: active
[root@bsd11 ~]#
Comment 1 Murat 2020-06-15 16:58:44 UTC
Created attachment 215584 [details]
patch to fix ifconfig vlanhwcsum parameter handling for em
Comment 2 Murat 2020-06-15 17:05:54 UTC
Hi,

It looks like this bug effects quite many FreeBSD versions. This was present in FreeBSD 11.x and I could confirm this is present in FreeBSD 12.x

Fix looks very easy. 

Impact will be huge since em(4) driver is being used by many hypervisors (QEMU, Proxmox, VirtualBox, VMware) and you can find this adapter oboard in many COTS hardware. 

Most obvious effect is you cannot run netmap(4) on em VLAN interfaces.
Comment 3 Murat 2020-06-15 17:07:18 UTC
Related netmap(4) PR:

https://github.com/luigirizzo/netmap/issues/703
Comment 4 Vincenzo Maffione freebsd_committer 2020-06-15 20:13:31 UTC
Review created
https://reviews.freebsd.org/D25286
However, it's not clear if this is about the vlanhwcsum flag or the vlanhwtag flag (as stated on the github).
Comment 5 Murat 2020-06-16 00:11:42 UTC
Vincenzo,

It should be as stated in the netmap ticket: vlanhwtag