From owner-cvs-all@FreeBSD.ORG Mon Feb 6 22:23:58 2006 Return-Path: X-Original-To: cvs-all@FreeBSD.org Delivered-To: cvs-all@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 49CD016A420; Mon, 6 Feb 2006 22:23:58 +0000 (GMT) (envelope-from nate@root.org) Received: from www.cryptography.com (li-22.members.linode.com [64.5.53.22]) by mx1.FreeBSD.org (Postfix) with ESMTP id E6C1B43D46; Mon, 6 Feb 2006 22:23:57 +0000 (GMT) (envelope-from nate@root.org) Received: from [10.0.0.53] (adsl-67-119-74-222.dsl.sntc01.pacbell.net [67.119.74.222]) by www.cryptography.com (8.12.8/8.12.8) with ESMTP id k16ML0Er020147 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 6 Feb 2006 14:21:01 -0800 Message-ID: <43E7CBD5.5090203@root.org> Date: Mon, 06 Feb 2006 14:21:09 -0800 From: Nate Lawson User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Oleg Bulyzhin References: <200602020958.k129wWtc066930@repoman.freebsd.org> <20060202100637.GB24350@lath.rinet.ru> <20060205235817.GQ5499@cs.rice.edu> <20060206221141.GA57775@lath.rinet.ru> In-Reply-To: <20060206221141.GA57775@lath.rinet.ru> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: cvs-src@FreeBSD.org, src-committers@FreeBSD.org, Alan Cox , cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/dev/bge if_bge.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2006 22:23:58 -0000 Oleg Bulyzhin wrote: > On Sun, Feb 05, 2006 at 05:58:17PM -0600, Alan Cox wrote: >>Unfortunately, it also breaks NFS over UDP. Let me know if you need >>details. >> >>Alan > > > Fix attached. It's not bge problem it's five years old bug in ip_reass(). > > Index: ip_input.c > =================================================================== > RCS file: /home/ncvs/src/sys/netinet/ip_input.c,v > retrieving revision 1.314 > diff -u -r1.314 ip_input.c > --- ip_input.c 2 Feb 2006 03:13:15 -0000 1.314 > +++ ip_input.c 6 Feb 2006 21:44:45 -0000 > @@ -982,10 +982,12 @@ > nq = q->m_nextpkt; > q->m_nextpkt = NULL; > for (q = nq; q != NULL; q = nq) { > + int sum; It's not good to declare local variables in the for() context. It's a style(9) bug and also costs an extra instruction or two (to decrement the stack pointer twice). > nq = q->m_nextpkt; > q->m_nextpkt = NULL; > m->m_pkthdr.csum_flags &= q->m_pkthdr.csum_flags; > - m->m_pkthdr.csum_data += q->m_pkthdr.csum_data; > + sum = m->m_pkthdr.csum_data + q->m_pkthdr.csum_data; > + m->m_pkthdr.csum_data = (sum & 0xffff) + (sum >> 16); > m_cat(m, q); > } > #ifdef MAC I'm not familiar with this code. So m->m_pkthdr.csum_data is 32 bits? Couldn't the same thing be achieved with making it 16 bits since the add will wrap normally? -- Nate