From owner-freebsd-net@FreeBSD.ORG Tue May 13 07:02:07 2014 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C8FD05A4; Tue, 13 May 2014 07:02:07 +0000 (UTC) Received: from mail-n.franken.de (drew.ipv6.franken.de [IPv6:2001:638:a02:a001:20e:cff:fe4a:feaa]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mail-n.franken.de", Issuer "Thawte DV SSL CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 856E42418; Tue, 13 May 2014 07:02:07 +0000 (UTC) Received: from [192.168.1.200] (p54819945.dip0.t-ipconnect.de [84.129.153.69]) (Authenticated sender: macmic) by mail-n.franken.de (Postfix) with ESMTP id 066AC1C104906; Tue, 13 May 2014 09:02:04 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: RX checksum offloading problem From: Michael Tuexen In-Reply-To: <20140513052134.GA1419@michelle.cdnetworks.com> Date: Tue, 13 May 2014 09:02:04 +0200 Content-Transfer-Encoding: 7bit Message-Id: <1E676F4A-50A7-4FB9-8EE8-08B2A4BD54CB@lurchi.franken.de> References: <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> <20140512013612.GA4085@michelle.cdnetworks.com> <72BEDE7B-C1F1-4EE2-BA68-49AED7209E8A@lurchi.franken.de> <20140513052134.GA1419@michelle.cdnetworks.com> To: pyunyh@gmail.com X-Mailer: Apple Mail (2.1874) Cc: FreeBSD Net , "Bjoern A. Zeeb" X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 May 2014 07:02:07 -0000 On 13 May 2014, at 07:21, Yonghyeon PYUN wrote: > On Mon, May 12, 2014 at 01:22:03PM +0200, Michael Tuexen wrote: >> On 12 May 2014, at 03:36, Yonghyeon PYUN wrote: >> >>> On Fri, May 09, 2014 at 12:46:48PM +0200, Michael Tuexen wrote: >>>> On 09 May 2014, at 03:35, Yonghyeon PYUN 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. Great. Thanks. Michael >