Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F105952524
D7786.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D7786.diff
View Options
Index: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
===================================================================
--- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
+++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
@@ -910,6 +910,7 @@
}
if (m_head->m_pkthdr.csum_flags & CSUM_TSO) {
+#if defined(INET6) || defined(INET)
rndis_tcp_tso_info *tso_info;
struct ether_vlan_header *eh;
int ether_len;
@@ -929,8 +930,6 @@
tso_info = (rndis_tcp_tso_info *)((uint8_t *)rppi +
rppi->per_packet_info_offset);
- tso_info->lso_v2_xmit.type =
- RNDIS_TCP_LARGE_SEND_OFFLOAD_V2_TYPE;
#ifdef INET
if (m_head->m_pkthdr.csum_flags & CSUM_IP_TSO) {
@@ -940,13 +939,12 @@
struct tcphdr *th =
(struct tcphdr *)((caddr_t)ip + iph_len);
- tso_info->lso_v2_xmit.ip_version =
- RNDIS_TCP_LARGE_SEND_OFFLOAD_IPV4;
ip->ip_len = 0;
ip->ip_sum = 0;
-
th->th_sum = in_pseudo(ip->ip_src.s_addr,
ip->ip_dst.s_addr, htons(IPPROTO_TCP));
+ tso_info->value = NDIS_LSO2_INFO_MAKEIPV4(0,
+ m_head->m_pkthdr.tso_segsz);
}
#endif
#if defined(INET6) && defined(INET)
@@ -958,14 +956,13 @@
(m_head->m_data + ether_len);
struct tcphdr *th = (struct tcphdr *)(ip6 + 1);
- tso_info->lso_v2_xmit.ip_version =
- RNDIS_TCP_LARGE_SEND_OFFLOAD_IPV6;
ip6->ip6_plen = 0;
th->th_sum = in6_cksum_pseudo(ip6, 0, IPPROTO_TCP, 0);
+ tso_info->value = NDIS_LSO2_INFO_MAKEIPV6(0,
+ m_head->m_pkthdr.tso_segsz);
}
#endif
- tso_info->lso_v2_xmit.tcp_header_offset = 0;
- tso_info->lso_v2_xmit.mss = m_head->m_pkthdr.tso_segsz;
+#endif /* INET6 || INET */
} else if (m_head->m_pkthdr.csum_flags & txr->hn_csum_assist) {
rndis_tcp_ip_csum_info *csum_info;
Index: head/sys/dev/hyperv/netvsc/ndis.h
===================================================================
--- head/sys/dev/hyperv/netvsc/ndis.h
+++ head/sys/dev/hyperv/netvsc/ndis.h
@@ -231,4 +231,21 @@
#define NDIS_RXCSUM_INFO_TCPCS_INVAL 0x0080
#define NDIS_RXCSUM_INFO_IPCS_INVAL 0x0100
+/* LSOv2 */
+#define NDIS_LSO2_INFO_MSS_MASK 0x000fffff
+#define NDIS_LSO2_INFO_THOFF_MASK 0x3ff00000
+#define NDIS_LSO2_INFO_ISLSO2 0x40000000
+#define NDIS_LSO2_INFO_ISIPV6 0x80000000
+
+#define NDIS_LSO2_INFO_MAKE(thoff, mss) \
+ ((((uint32_t)(mss)) & NDIS_LSO2_INFO_MSS_MASK) | \
+ ((((uint32_t)(thoff)) & 0x3ff) << 20) | \
+ NDIS_LSO2_INFO_ISLSO2)
+
+#define NDIS_LSO2_INFO_MAKEIPV4(thoff, mss) \
+ NDIS_LSO2_INFO_MAKE((thoff), (mss))
+
+#define NDIS_LSO2_INFO_MAKEIPV6(thoff, mss) \
+ (NDIS_LSO2_INFO_MAKE((thoff), (mss)) | NDIS_LSO2_INFO_ISIPV6)
+
#endif /* !_NET_NDIS_H_ */
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Dec 24, 1:13 AM (19 h, 16 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15581286
Default Alt Text
D7786.diff (2 KB)
Attached To
Mode
D7786: hyperv/hn: Fix LSOv2 setup
Attached
Detach File
Event Timeline
Log In to Comment