From owner-freebsd-net@FreeBSD.ORG Tue May 13 05:21:39 2014 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A413CA9E; Tue, 13 May 2014 05:21:39 +0000 (UTC) Received: from mail-pa0-x229.google.com (mail-pa0-x229.google.com [IPv6:2607:f8b0:400e:c03::229]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6C8342CA4; Tue, 13 May 2014 05:21:39 +0000 (UTC) Received: by mail-pa0-f41.google.com with SMTP id lj1so9717439pab.14 for ; Mon, 12 May 2014 22:21:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:date:to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=mOB4bsJVlO3s+dOvIY0ngXmUV2WhaPXUMGOkVdCjiBo=; b=oMrc+Yc6bIk5kWj+C0Pt8V2uy33c+ptCDuPZGSuXrAfRdaXmx8Vp1FQJCpLc9B2kHd 2rpgiV5/3V913AqFFYS2uzlPcz16cIJcLLg8u+ZX+JDmId2yrt2tf7KytsXOPIFZEIAU Sltfgcp8jsKTNUE4HR4KYFIgf/Uk/Srmsc/Ps/hkGKeUr6KUF7LdoUpTnpO1cK88IIWG L0Q26xWjdpZK+99zzjITjk6htJ9hVvErLvmDwFsjc1C5Vaw7pMKOEfK9MACPrp7gAu1f bKUaXa2y1MZPsnFHzbL4kSiuBBsjsI75TpvAnIDE30OabiikqrBpul/dUxdjtx85Wx46 tf8Q== X-Received: by 10.66.136.131 with SMTP id qa3mr61172005pab.77.1399958499014; Mon, 12 May 2014 22:21:39 -0700 (PDT) Received: from pyunyh@gmail.com (lpe4.p59-icn.cdngp.net. [114.111.62.249]) by mx.google.com with ESMTPSA id ek2sm25951177pbd.30.2014.05.12.22.21.36 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 12 May 2014 22:21:38 -0700 (PDT) X-Google-Original-From: "Yonghyeon PYUN" Received: by pyunyh@gmail.com (sSMTP sendmail emulation); Tue, 13 May 2014 14:21:34 +0900 From: Yonghyeon PYUN Date: Tue, 13 May 2014 14:21:34 +0900 To: Michael Tuexen Subject: Re: RX checksum offloading problem Message-ID: <20140513052134.GA1419@michelle.cdnetworks.com> Reply-To: pyunyh@gmail.com 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> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <72BEDE7B-C1F1-4EE2-BA68-49AED7209E8A@lurchi.franken.de> User-Agent: Mutt/1.4.2.3i 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 05:21:39 -0000 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.