Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F138077459
D51291.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
D51291.diff
View Options
diff --git a/sys/net/if_tuntap.c b/sys/net/if_tuntap.c
--- a/sys/net/if_tuntap.c
+++ b/sys/net/if_tuntap.c
@@ -160,12 +160,10 @@
#define TUN_VMIO_FLAG_MASK 0x0fff
/*
- * Interface capabilities of a tap device that supports the virtio-net
- * header.
+ * Additional interface capabilities of a tap device that supports the
+ * virtio-net header.
*/
-#define TAP_VNET_HDR_CAPS (IFCAP_HWCSUM | IFCAP_HWCSUM_IPV6 \
- | IFCAP_VLAN_HWCSUM \
- | IFCAP_TSO | IFCAP_LRO \
+#define TAP_VNET_HDR_CAPS (IFCAP_VLAN_HWCSUM | IFCAP_TSO \
| IFCAP_VLAN_HWTSO)
#define TAP_ALL_OFFLOAD (CSUM_TSO | CSUM_TCP | CSUM_UDP |\
@@ -987,7 +985,8 @@
ifp->if_capabilities |= IFCAP_LINKSTATE | IFCAP_MEXTPG;
if ((tp->tun_flags & TUN_L2) != 0)
ifp->if_capabilities |=
- IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6 | IFCAP_LRO;
+ IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6 | IFCAP_LRO |
+ IFCAP_TXCSUM | IFCAP_TXCSUM_IPV6;
ifp->if_capenable |= IFCAP_LINKSTATE | IFCAP_MEXTPG;
if ((tp->tun_flags & TUN_L2) != 0) {
@@ -1767,6 +1766,13 @@
vhdr.hdr.gso_size, vhdr.hdr.csum_start,
vhdr.hdr.csum_offset);
error = uiomove(&vhdr, len, uio);
+ } else if (m->m_pkthdr.csum_flags & TAP_ALL_OFFLOAD) {
+ /*
+ * Sender offloads TCP segmentation or TCP/UDP checksum
+ * computation to hardware but without a virtio-net header, tap
+ * cannot forward the offload flags.
+ */
+ error = EOPNOTSUPP;
}
if (error == 0)
error = m_mbuftouio(uio, m, 0);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 29, 5:11 PM (4 h, 27 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
26347657
Default Alt Text
D51291.diff (1 KB)
Attached To
Mode
D51291: tuntap: add IFCAP_TXCSUM and IFCAP_TXCSUM_IPV6
Attached
Detach File
Event Timeline
Log In to Comment