From owner-freebsd-arm@freebsd.org Fri Nov 20 14:34:44 2020 Return-Path: Delivered-To: freebsd-arm@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 482E42EC355; Fri, 20 Nov 2020 14:34:44 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 4Cczb81YR3z3jBh; Fri, 20 Nov 2020 14:34:44 +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 E768AF99B; Fri, 20 Nov 2020 14:34:43 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: by venus.codepro.be (Postfix, authenticated sender kp) id 3489F4B6E6; Fri, 20 Nov 2020 15:34:41 +0100 (CET) From: "Kristof Provost" To: "YongHyeon PYUN" Cc: "Carsten =?utf-8?q?B=C3=A4cker?=" , "Hans Petter Selasky" , freebsd-arm@freebsd.org, freebsd-hackers@freebsd.org Subject: Re: Problem with checksum offloading on RPi3 (PF + Jails involved) Date: Fri, 20 Nov 2020 15:34:40 +0100 X-Mailer: MailMate (1.13.2r5673) Message-ID: In-Reply-To: <20201119022208.GB1974@michelle> References: <20201103045215.GA2524@michelle> <46d08198-530c-cb4b-efa8-4edaf89471c1@selasky.org> <4dfaa9a3-c085-8466-a6e4-19f988b5ed3d@selasky.org> <20201116011910.GB1941@michelle> <1245cbe5-9d2f-4808-f989-569ae7d57a8a@gmx.de> <20201117030406.GA45158@michelle> <20201118044857.GA1974@michelle> <20201119022208.GB1974@michelle> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8"; format=flowed; markup=markdown Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Nov 2020 14:34:44 -0000 On 19 Nov 2020, at 3:22, YongHyeon PYUN wrote: > On Wed, Nov 18, 2020 at 10:47:08AM +0100, Carsten Bäcker wrote: > > [...] > >> Sorry, that's my fault - i overlooked your request for a test with pf >> enabled. >> The example-ruleset is attached again. I added a line to allow the >> incoming ping to 5555. >> >> I don't see a difference until i enable the redirection to the jail >> which makes the packet with extended data-length fail. >> Once i disable RXCSUM it works. >> > > Thanks for testing. Unfortunately I couldn't find a driver issue > on patched smsc(4). Quick looking pf(4) makes me wonder how it > verifies UDP datagrams. > > Kristof, does pf(4) take advantage of H/W checksummed result for > UDP datagrams? Yes. Pf updates checksums if they’re present, rather than fully recalculating them. > It seems pf_check_proto_cksum() always pass > IPPROTO_TCP such that UDP pseudo checksum is not computed in the > function. Note that pf_check_proto_cksum() is only ever called from pf_return(), and then only if pf->proto == IPPROTO_TCP. Checksum updates are mostly done through pf_proto_cksum_fixup(), in different parts of the code. Best egards, Kristof