Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F81969636
D17910.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D17910.diff
View Options
Index: sys/dev/netmap/netmap.c
===================================================================
--- sys/dev/netmap/netmap.c
+++ sys/dev/netmap/netmap.c
@@ -446,6 +446,7 @@
#include <net/if.h>
#include <net/if_var.h>
#include <net/bpf.h> /* BIOCIMMEDIATE */
+#include <net/if_vlan_var.h> /* VLAN_CAPABILITIES */
#include <machine/bus.h> /* bus_dmamap_* */
#include <sys/endian.h>
#include <sys/refcount.h>
@@ -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 *);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Dec 15, 7:49 AM (20 h, 37 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
9091556
Default Alt Text
D17910.diff (1 KB)
Attached To
Mode
D17910: netmap: automatically disable some capabilities over vlan interface
Attached
Detach File
Event Timeline
Log In to Comment