FreeBSD-16:04.hyperv FreeBSD-16:05.hv_netvsc FreeBSD-SA-16:14.openssh FreeBSD-SA-16:15.sysarch
28 lines
884 B
Diff
28 lines
884 B
Diff
--- sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c.orig
|
|
+++ sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
|
|
@@ -128,6 +128,15 @@
|
|
#define HV_NV_SC_PTR_OFFSET_IN_BUF 0
|
|
#define HV_NV_PACKET_OFFSET_IN_BUF 16
|
|
|
|
+/*
|
|
+ * A unified flag for all outbound check sum flags is useful,
|
|
+ * and it helps avoiding unnecessary check sum calculation in
|
|
+ * network forwarding scenario.
|
|
+ */
|
|
+#define HV_CSUM_FOR_OUTBOUND \
|
|
+ (CSUM_IP|CSUM_IP_UDP|CSUM_IP_TCP|CSUM_IP_SCTP|CSUM_IP_TSO| \
|
|
+ CSUM_IP_ISCSI|CSUM_IP6_UDP|CSUM_IP6_TCP|CSUM_IP6_SCTP| \
|
|
+ CSUM_IP6_TSO|CSUM_IP6_ISCSI)
|
|
|
|
/*
|
|
* Data types
|
|
@@ -570,7 +579,8 @@
|
|
packet->vlan_tci & 0xfff;
|
|
}
|
|
|
|
- if (0 == m_head->m_pkthdr.csum_flags) {
|
|
+ /* Only check the flags for outbound and ignore the ones for inbound */
|
|
+ if (0 == (m_head->m_pkthdr.csum_flags & HV_CSUM_FOR_OUTBOUND)) {
|
|
goto pre_send;
|
|
}
|
|
|