From owner-freebsd-current@freebsd.org Fri Dec 11 21:19:33 2015 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 16A9BA0448D for ; Fri, 11 Dec 2015 21:19:33 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from gw.catspoiler.org (unknown [IPv6:2602:304:b010:ef20::f2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "gw.catspoiler.org", Issuer "gw.catspoiler.org" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id EF0FF1EAC for ; Fri, 11 Dec 2015 21:19:32 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from FreeBSD.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.15.2/8.15.2) with ESMTP id tBBLJOYC048783; Fri, 11 Dec 2015 13:19:29 -0800 (PST) (envelope-from truckman@FreeBSD.org) Message-Id: <201512112119.tBBLJOYC048783@gw.catspoiler.org> Date: Fri, 11 Dec 2015 13:19:24 -0800 (PST) From: Don Lewis Subject: Re: XOR pt. 2 To: mmcco@mykolab.com cc: freebsd-current@freebsd.org In-Reply-To: <20151211194204.GA26628@thinkpad.swarthmore.edu> MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2015 21:19:33 -0000 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"