Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/xen/xen adjust previous - set the Tx flag only when...



details:   https://anonhg.NetBSD.org/src/rev/a3f299034324
branches:  trunk
changeset: 970922:a3f299034324
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Mon Apr 06 19:58:09 2020 +0000

description:
adjust previous - set the Tx flag only when the feature supported, instead
of first setting it and then masking it when unsupported

diffstat:

 sys/arch/xen/xen/if_xennet_xenbus.c |  20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)

diffs (47 lines):

diff -r 644938d15d07 -r a3f299034324 sys/arch/xen/xen/if_xennet_xenbus.c
--- a/sys/arch/xen/xen/if_xennet_xenbus.c       Mon Apr 06 19:53:22 2020 +0000
+++ b/sys/arch/xen/xen/if_xennet_xenbus.c       Mon Apr 06 19:58:09 2020 +0000
@@ -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 @@
                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);



Home | Main Index | Thread Index | Old Index