Index: sys/dev/netmap/netmap.c =================================================================== --- sys/dev/netmap/netmap.c +++ sys/dev/netmap/netmap.c @@ -446,6 +446,7 @@ #include #include #include /* BIOCIMMEDIATE */ +#include /* VLAN_CAPABILITIES */ #include /* bus_dmamap_* */ #include #include @@ -1019,6 +1020,9 @@ D("BUG: netmap on while going to delete the krings"); } + /* Restore any capabilities disabled when put into netmap mode */ + na->ifp->if_capenable |= na->cap_restore; + na->nm_krings_delete(na); } @@ -2214,11 +2218,26 @@ } if (nm_kring_pending(priv)) { + + /* We do not support passing 802.1q VLAN IDs through the rings + * so disable hardware tag stripping and generation, as well + * as LRO/TSO/checksum offloading over a VLAN interface. + */ + const unsigned inhibit_cap = IFCAP_VLAN_HWTAGGING | + IFCAP_VLAN_HWTSO | IFCAP_VLAN_HWCSUM | IFCAP_TSO | + IFCAP_RXCSUM | IFCAP_TXCSUM | IFCAP_RXCSUM_IPV6 | IFCAP_TXCSUM_IPV6 | IFCAP_LRO; + + /* Save existing capabilities to restore when we leave netmap mode */ + na->cap_restore = na->ifp->if_capenable & inhibit_cap; + na->ifp->if_capenable &= ~inhibit_cap; + /* Some kring is switching mode, tell the adapter to * react on this. */ error = na->nm_register(na, 1); if (error) goto err_del_if; + + VLAN_CAPABILITIES(na->ifp); } /* Commit the reference. */ Index: sys/dev/netmap/netmap_kern.h =================================================================== --- sys/dev/netmap/netmap_kern.h +++ sys/dev/netmap/netmap_kern.h @@ -740,6 +740,7 @@ * packets from the network stack when netmap is active. */ int (*if_transmit)(struct ifnet *, struct mbuf *); + int cap_restore; /* copy of if_input for netmap_send_up() */ void (*if_input)(struct ifnet *, struct mbuf *);