Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 17 Nov 2020 12:04:06 +0900
From:      YongHyeon PYUN <pyunyh@gmail.com>
To:        Carsten =?iso-8859-1?Q?B=E4cker?= <carbaecker@gmx.de>
Cc:        Hans Petter Selasky <hps@selasky.org>, Kristof Provost <kp@FreeBSD.org>, freebsd-arm@freebsd.org, freebsd-hackers@freebsd.org
Subject:   Re: Problem with checksum offloading on RPi3 (PF + Jails involved)
Message-ID:  <20201117030406.GA45158@michelle>
In-Reply-To: <1245cbe5-9d2f-4808-f989-569ae7d57a8a@gmx.de>
References:  <5130ee46-5832-d4df-d774-c6bd32e10b30@gmx.de> <A3890336-BE8F-438C-8C3E-7B21FB729FCA@FreeBSD.org> <20201029213622.GM31099@funkthat.com> <55713894-A896-4F12-ABB9-93DFEB2F16B9@FreeBSD.org> <20201103045215.GA2524@michelle> <46d08198-530c-cb4b-efa8-4edaf89471c1@selasky.org> <4dfaa9a3-c085-8466-a6e4-19f988b5ed3d@selasky.org> <e43b42e0-80fe-847a-f1bc-025b6914f98a@gmx.de> <20201116011910.GB1941@michelle> <1245cbe5-9d2f-4808-f989-569ae7d57a8a@gmx.de>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Nov 16, 2020 at 12:54:25PM +0100, Carsten Bäcker wrote:

[...]

> i just did a test with your modification.
> The good news is that the driver itself still works.

Your test indicates my approach to improve RX validation works.
Thanks a lot for testing.

> The bad news is that it doesn't solve the problem. :-(
> 

Let's dig further.  Initially I thought pf(4) could be confused by
mismatch of received packet length and IP datagram length.  H/W
does not strip padding bytes for short frame(< 60 bytes) and adds
FCS bytes such that the minimum ethernet frame length is 64 bytes.
When RX checksum offloading is enabled, the size will be 66 bytes.
My patch tried to correct wrong packet length stored in mbuf.

I think simple nping test would be helpful to narrow down the issue
here. nping is bundled with nmap(ports/security/nmap).

o Test patched smsc(4) with/without pf(4).
 - Disable RX checksum offloading and make sure all works as
   expected.
 - Run the following command on other system and see whether you
   can get ICMP port unreachable message from a box with smsc(4).
   5555 is port number that listens on incoming UDP datagrams.
    #nping -c 1 --udp -p 5555 IPv4_addr_of_remote_host_with_smsc(4)

    #nping -c 1 --udp -p 5555 --data-length 100 IPv4_addr_of_remote_host_with_smsc(4)

 - Repeat the same test with RX checksum offloading enabled.

If there is RX checksum mismatch you wouldn't get ICMP port
unreachable message.  You can even generate wrong checksummed UDP
datagrams with --badsum option like the following.
#nping -c 1 --udp -p 5555 --badsum IPv4_addr_of_remote_host_with_smsc(4)

> I used the snapshot from 2020-10-29 as i already had an sdcard with that
> image.
> http://ftp.freebsd.org/pub/FreeBSD/snapshots/ISO-IMAGES/13.0/
> 
> Kernel was build from head + your patch.
> FreeBSD generic 13.0-CURRENT FreeBSD 13.0-CURRENT #1 r367714M: Mon Nov
> 16 08:03:24 UTC 2020
> root@sysbuild:/usr/obj/usr/src_head/arm64.aarch64/sys/GENERIC arm64
> 
> Log from smsc is attached.
> 

The log shows my assumption on RX packet layout is correct.
Thanks.
 
> As the lack of hardware seems to be a problem... i may be able to
> provide temporary access, incl. serial using a 2nd pi - but this will
> take some time as i need to change the network-setup.
> 

I think it's better to share nping test result first.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20201117030406.GA45158>