Module Name: src
Committed By: jdolecek
Date: Mon Apr 6 19:58:09 UTC 2020
Modified Files:
src/sys/arch/xen/xen: if_xennet_xenbus.c
Log Message:
adjust previous - set the Tx flag only when the feature supported, instead
of first setting it and then masking it when unsupported
To generate a diff of this commit:
cvs rdiff -u -r1.107 -r1.108 src/sys/arch/xen/xen/if_xennet_xenbus.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/xen/xen/if_xennet_xenbus.c
diff -u src/sys/arch/xen/xen/if_xennet_xenbus.c:1.107 src/sys/arch/xen/xen/if_xennet_xenbus.c:1.108
--- src/sys/arch/xen/xen/if_xennet_xenbus.c:1.107 Mon Apr 6 19:52:38 2020
+++ src/sys/arch/xen/xen/if_xennet_xenbus.c Mon Apr 6 19:58:09 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: if_xennet_xenbus.c,v 1.107 2020/04/06 19:52:38 jdolecek Exp $ */
+/* $NetBSD: if_xennet_xenbus.c,v 1.108 2020/04/06 19:58:09 jdolecek Exp $ */
/*
* Copyright (c) 2006 Manuel Bouyer.
@@ -81,7 +81,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_xennet_xenbus.c,v 1.107 2020/04/06 19:52:38 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_xennet_xenbus.c,v 1.108 2020/04/06 19:58:09 jdolecek Exp $");
#include "opt_xen.h"
#include "opt_nfs_boot.h"
@@ -379,20 +379,20 @@ xennet_xenbus_attach(device_t parent, de
IFCAP_CSUM_IPv4_Rx | IFCAP_CSUM_IPv4_Tx
| IFCAP_CSUM_UDPv4_Rx | IFCAP_CSUM_UDPv4_Tx
| IFCAP_CSUM_TCPv4_Rx | IFCAP_CSUM_TCPv4_Tx
- | IFCAP_CSUM_UDPv6_Rx | IFCAP_CSUM_UDPv6_Tx
- | IFCAP_CSUM_TCPv6_Rx | IFCAP_CSUM_TCPv6_Tx;
+ | IFCAP_CSUM_UDPv6_Rx
+ | IFCAP_CSUM_TCPv6_Rx;
#define XN_M_CSUM_SUPPORTED ( \
M_CSUM_TCPv4 | M_CSUM_UDPv4 | M_CSUM_IPv4 \
| M_CSUM_TCPv6 | M_CSUM_UDPv6 \
)
- if (!sc->sc_ipv6_csum) {
+ if (sc->sc_ipv6_csum) {
/*
- * If backend doesn't support IPv6 csum offloading, we must
- * provide valid IPv6 csum for Tx packets, but can still
- * skip validation for Rx packets.
+ * If backend supports IPv6 csum offloading, we can skip
+ * IPv6 csum for Tx packets. Rx packet validation can
+ * be skipped regardless.
*/
- ifp->if_capabilities &=
- ~(IFCAP_CSUM_UDPv6_Tx | IFCAP_CSUM_TCPv6_Tx);
+ ifp->if_capabilities |=
+ IFCAP_CSUM_UDPv6_Tx | IFCAP_CSUM_TCPv6_Tx;
}
IFQ_SET_READY(&ifp->if_snd);