Date: Tue, 13 May 2014 14:21:34 +0900 From: Yonghyeon PYUN <pyunyh@gmail.com> To: Michael Tuexen <Michael.Tuexen@lurchi.franken.de> Cc: FreeBSD Net <freebsd-net@freebsd.org>, "Bjoern A. Zeeb" <bz@FreeBSD.org> Subject: Re: RX checksum offloading problem Message-ID: <20140513052134.GA1419@michelle.cdnetworks.com> In-Reply-To: <72BEDE7B-C1F1-4EE2-BA68-49AED7209E8A@lurchi.franken.de> References: <A345E6A0-D6FF-4E69-AFBD-9BB67B82F02E@FreeBSD.org> <B149FC4B-4F15-4619-A04F-F1A08DDC1741@lurchi.franken.de> <20140507075612.GA1376@michelle.cdnetworks.com> <36469814-FAC8-4172-A792-487E2AB8ECB9@lurchi.franken.de> <20140507083751.GB1376@michelle.cdnetworks.com> <415C1CB5-3AF9-44E4-943A-74116037980E@lurchi.franken.de> <20140509013556.GA3014@michelle.cdnetworks.com> <B4F16B70-825A-441A-82AA-F7ED28C9D254@lurchi.franken.de> <20140512013612.GA4085@michelle.cdnetworks.com> <72BEDE7B-C1F1-4EE2-BA68-49AED7209E8A@lurchi.franken.de>
next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, May 12, 2014 at 01:22:03PM +0200, Michael Tuexen wrote: > On 12 May 2014, at 03:36, Yonghyeon PYUN <pyunyh@gmail.com> wrote: > > > On Fri, May 09, 2014 at 12:46:48PM +0200, Michael Tuexen wrote: > >> On 09 May 2014, at 03:35, Yonghyeon PYUN <pyunyh@gmail.com> wrote: > >> [...] > > Oops, sorry. You're right. Probably I was confused with old memory > > when I worked on that area. I've quickly read IP reassembly code > > again and as you said, it should work. However it seems there is a > > checksumming bug here. > > > > /* > > * In order to do checksumming faster we do 'end-around carry' here > > * (and not in for{} loop), though it implies we are not going to > > * reassemble more than 64k fragments. > > */ > > m->m_pkthdr.csum_data = > > (m->m_pkthdr.csum_data & 0xffff) + (m->m_pkthdr.csum_data >> 16); > > > > I guess the line above didn't account possible carry happened after > > the computation. Probably it could be rewritten as the following. > > > > while (m->m_pkthdr.csum_data & 0xffff0000) > > m->m_pkthdr.csum_data = (m->m_pkthdr.csum_data & 0xffff) + > > (m->m_pkthdr.csum_data >> 16); > I think you are right here. Good catch. Will you fix it? > Done in r265942.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20140513052134.GA1419>