From a42546df8808a36e151d0e7444c34bb73e8406ab Mon Sep 17 00:00:00 2001 From: Stephen Hurd Date: Wed, 7 Nov 2018 19:31:48 +0000 Subject: [PATCH] Fix rxcsum issue introduced in r338838 r338838 attempted to fix issues with rxcsum and rxcsum6. However, the rxcsum bits were set as though if_setcapenablebit() was being called, not if_togglecapenable() which is in use. As a result, it was not possible to disable rxcsum when rxcsum6 was supported. PR: 233004 Reported by: lev Reviewed by: lev MFC after: 3 days Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D17881 --- sys/net/iflib.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/sys/net/iflib.c b/sys/net/iflib.c index 594d50395d82..9d7a8b98fe80 100644 --- a/sys/net/iflib.c +++ b/sys/net/iflib.c @@ -4256,18 +4256,13 @@ iflib_if_ioctl(if_t ifp, u_long command, caddr_t data) setmask |= (mask & IFCAP_WOL); /* - * If we're disabling any RX csum, disable all the ones - * the driver supports. This assumes all supported are - * enabled. - * - * Otherwise, if they've changed, enable all of them. + * If any RX csum has changed, change all the ones that + * are supported by the driver. */ - if ((setmask & (IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6)) < - (oldmask & (IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6))) - setmask &= ~(IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6); - else if ((setmask & (IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6)) != - (oldmask & (IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6))) - setmask |= (mask & (IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6)); + if (setmask & (IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6)) { + setmask |= ctx->ifc_softc_ctx.isc_capabilities & + (IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6); + } /* * want to ensure that traffic has stopped before we change any of the flags