From owner-freebsd-hackers@freebsd.org Tue Nov 3 19:20:06 2020 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 17E13460CFC; Tue, 3 Nov 2020 19:20:06 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CQfkF6x4bz4Jmp; Tue, 3 Nov 2020 19:20:05 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from venus.codepro.be (venus.codepro.be [5.9.86.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx1.codepro.be", Issuer "Let's Encrypt Authority X3" (verified OK)) (Authenticated sender: kp) by smtp.freebsd.org (Postfix) with ESMTPSA id B72D714554; Tue, 3 Nov 2020 19:20:05 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: by venus.codepro.be (Postfix, authenticated sender kp) id AE4A64E6A8; Tue, 3 Nov 2020 20:20:03 +0100 (CET) From: "Kristof Provost" To: "John-Mark Gurney" Cc: "Carsten =?utf-8?q?B=C3=A4cker?=" , freebsd-hackers@freebsd.org, freebsd-arm@freebsd.org Subject: Re: Problem with checksum offloading on RPi3 (PF + Jails involved) Date: Tue, 03 Nov 2020 20:20:02 +0100 X-Mailer: MailMate (1.13.2r5673) Message-ID: In-Reply-To: <20201103191439.GV31099@funkthat.com> References: <748edc3d-4ef7-c4de-291f-7c0b460a6052@gmx.de> <5130ee46-5832-d4df-d774-c6bd32e10b30@gmx.de> <20201029213622.GM31099@funkthat.com> <55713894-A896-4F12-ABB9-93DFEB2F16B9@FreeBSD.org> <20201103191439.GV31099@funkthat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Nov 2020 19:20:06 -0000 On 3 Nov 2020, at 20:14, John-Mark Gurney wrote: > Kristof Provost wrote this message on Sun, Nov 01, 2020 at 19:48 > +0100: >> On 31 Oct 2020, at 16:06, Carsten Bäcker wrote: >>> Packet-capture from the router is attached. >>> >> Okay??? but that doesn???t actually demonstrate anything at all. >> It shows an outbound packet with an incorrect checksum. See what >> I???ve >> mentioned before about checksums potentially being calculated by >> hardware. >> Given that there???s been a reply to that DNS query the checksum >> clearly >> got set correctly after the packet was captured. > > Actually, isn't that odd that the outbound checksum is wrong? Since > the chip doesn't advertise (or it shouldn't) tx checksum handling, > FreeBSD's stack should have computed the checksum. > Bear in mind that this capture was made with pflog, not the usual BTF_MTAP() in the driver. That means it was captured before the stack does checksum calculations. Just before it, in fact. See ip_output(). The checksum calculation is pretty much immediately after the pfil hook. Best regards, Kristof