Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F105968678
D7735.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
3 KB
Referenced Files
None
Subscribers
None
D7735.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
@@ -1335,28 +1335,29 @@
do_csum = 0;
/* receive side checksum offload */
- if (info->csum_info != NULL) {
+ if (info->csum_info != HN_NDIS_RXCSUM_INFO_INVALID) {
/* IP csum offload */
- if (info->csum_info->receive.ip_csum_succeeded && do_csum) {
+ if ((info->csum_info & NDIS_RXCSUM_INFO_IPCS_OK) && do_csum) {
m_new->m_pkthdr.csum_flags |=
(CSUM_IP_CHECKED | CSUM_IP_VALID);
rxr->hn_csum_ip++;
}
/* TCP/UDP csum offload */
- if ((info->csum_info->receive.tcp_csum_succeeded ||
- info->csum_info->receive.udp_csum_succeeded) && do_csum) {
+ if ((info->csum_info & (NDIS_RXCSUM_INFO_UDPCS_OK |
+ NDIS_RXCSUM_INFO_TCPCS_OK)) && do_csum) {
m_new->m_pkthdr.csum_flags |=
(CSUM_DATA_VALID | CSUM_PSEUDO_HDR);
m_new->m_pkthdr.csum_data = 0xffff;
- if (info->csum_info->receive.tcp_csum_succeeded)
+ if (info->csum_info & NDIS_RXCSUM_INFO_TCPCS_OK)
rxr->hn_csum_tcp++;
else
rxr->hn_csum_udp++;
}
- if (info->csum_info->receive.ip_csum_succeeded &&
- info->csum_info->receive.tcp_csum_succeeded)
+ if ((info->csum_info &
+ (NDIS_RXCSUM_INFO_TCPCS_OK | NDIS_RXCSUM_INFO_IPCS_OK)) ==
+ (NDIS_RXCSUM_INFO_TCPCS_OK | NDIS_RXCSUM_INFO_IPCS_OK))
do_lro = 1;
} else {
const struct ether_header *eh;
Index: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c
===================================================================
--- head/sys/dev/hyperv/netvsc/hv_rndis_filter.c
+++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.c
@@ -157,7 +157,7 @@
uint32_t mask = 0, len;
info->vlan_info = HN_NDIS_VLAN_INFO_INVALID;
- info->csum_info = NULL;
+ info->csum_info = HN_NDIS_RXCSUM_INFO_INVALID;
info->hash_info = NULL;
info->hash_value = NULL;
@@ -200,10 +200,9 @@
break;
case tcpip_chksum_info:
- if (__predict_false(dlen <
- sizeof(rndis_tcp_ip_csum_info)))
+ if (__predict_false(dlen < NDIS_RXCSUM_INFO_SIZE))
return (EINVAL);
- info->csum_info = data;
+ info->csum_info = *((const uint32_t *)data);
mask |= HV_RF_RECVINFO_CSUM;
break;
Index: head/sys/dev/hyperv/netvsc/if_hnvar.h
===================================================================
--- head/sys/dev/hyperv/netvsc/if_hnvar.h
+++ head/sys/dev/hyperv/netvsc/if_hnvar.h
@@ -56,10 +56,11 @@
struct rndis_tcp_ip_csum_info_;
#define HN_NDIS_VLAN_INFO_INVALID 0xffffffff
+#define HN_NDIS_RXCSUM_INFO_INVALID 0
struct hn_recvinfo {
uint32_t vlan_info;
- const struct rndis_tcp_ip_csum_info_ *csum_info;
+ uint32_t csum_info;
const struct rndis_hash_info *hash_info;
const struct rndis_hash_value *hash_value;
};
Index: head/sys/dev/hyperv/netvsc/ndis.h
===================================================================
--- head/sys/dev/hyperv/netvsc/ndis.h
+++ head/sys/dev/hyperv/netvsc/ndis.h
@@ -219,4 +219,16 @@
#define NDIS_VLAN_INFO_CFI(inf) (((inf) & NDIS_VLAN_INFO_CFI_MASK) >> 3)
#define NDIS_VLAN_INFO_PRI(inf) ((inf) & NDIS_VLAN_INFO_PRI_MASK)
+/* Reception checksum */
+#define NDIS_RXCSUM_INFO_SIZE sizeof(uint32_t)
+#define NDIS_RXCSUM_INFO_TCPCS_FAILED 0x0001
+#define NDIS_RXCSUM_INFO_UDPCS_FAILED 0x0002
+#define NDIS_RXCSUM_INFO_IPCS_FAILED 0x0004
+#define NDIS_RXCSUM_INFO_TCPCS_OK 0x0008
+#define NDIS_RXCSUM_INFO_UDPCS_OK 0x0010
+#define NDIS_RXCSUM_INFO_IPCS_OK 0x0020
+#define NDIS_RXCSUM_INFO_LOOPBACK 0x0040
+#define NDIS_RXCSUM_INFO_TCPCS_INVAL 0x0080
+#define NDIS_RXCSUM_INFO_IPCS_INVAL 0x0100
+
#endif /* !_NET_NDIS_H_ */
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Dec 24, 6:19 AM (19 h, 39 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15585996
Default Alt Text
D7735.diff (3 KB)
Attached To
Mode
D7735: hyperv/hn: Rework RXCSUM related bits
Attached
Detach File
Event Timeline
Log In to Comment