Date: Fri, 11 Dec 2015 13:19:24 -0800 (PST) From: Don Lewis <truckman@FreeBSD.org> To: mmcco@mykolab.com Cc: freebsd-current@freebsd.org Subject: Re: XOR pt. 2 Message-ID: <201512112119.tBBLJOYC048783@gw.catspoiler.org> In-Reply-To: <20151211194204.GA26628@thinkpad.swarthmore.edu>
next in thread | previous in thread | raw e-mail | index | archive | help
On 11 Dec, Michael McConville wrote: > Note that IFCAP_HWCSUM has two bits set. Because of this, it doesn't XOR > cleanly in the current if-else condition, but I'm not sure whether that > was intended. I just wanted to pass this by people in case it was a > logical bug. Yeah, the original code looks incorrect. If HWCSUM is totally disabled and the user requests RXCSUM, then the current code will enable both RXCSUM and TXCSUM. > --- dev/ixgb/if_ixgb.c.orig > +++ dev/ixgb/if_ixgb.c > @@ -599,10 +599,7 @@ ixgb_ioctl(struct ifnet * ifp, IOCTL_CMD > } > #endif /* DEVICE_POLLING */ > if (mask & IFCAP_HWCSUM) { > - if (IFCAP_HWCSUM & ifp->if_capenable) > - ifp->if_capenable &= ~IFCAP_HWCSUM; > - else > - ifp->if_capenable |= IFCAP_HWCSUM; > + ifp->if_capenable ^= IFCAP_HWCSUM; I think that would need to be: ifp->if_capenable ^= (mask & IFCAP_HWCSUM); > if (ifp->if_drv_flags & IFF_DRV_RUNNING) > ixgb_init(adapter); > } > _______________________________________________ > freebsd-current@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201512112119.tBBLJOYC048783>