From owner-freebsd-hackers@freebsd.org Wed Nov 4 08:52:30 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 42B674560C3; Wed, 4 Nov 2020 08:52:30 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (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 did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4CR0ld1hq3z4SVT; Wed, 4 Nov 2020 08:52:28 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2020.home.selasky.org (unknown [178.17.145.105]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id DB066260198; Wed, 4 Nov 2020 09:52:25 +0100 (CET) Subject: Re: Problem with checksum offloading on RPi3 (PF + Jails involved) To: =?UTF-8?Q?Carsten_B=c3=a4cker?= , YongHyeon PYUN , Kristof Provost Cc: freebsd-arm@freebsd.org, freebsd-hackers@freebsd.org 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> <20201103045215.GA2524@michelle> <46d08198-530c-cb4b-efa8-4edaf89471c1@selasky.org> <4dfaa9a3-c085-8466-a6e4-19f988b5ed3d@selasky.org> From: Hans Petter Selasky Message-ID: <9e1f9407-e2ff-6486-256e-012626b534fb@selasky.org> Date: Wed, 4 Nov 2020 09:52:24 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4CR0ld1hq3z4SVT X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of hps@selasky.org designates 2a01:4f8:c17:6c4b::2 as permitted sender) smtp.mailfrom=hps@selasky.org X-Spamd-Result: default: False [-2.19 / 15.00]; RCVD_TLS_ALL(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+a:mail.turbocat.net]; NEURAL_HAM_LONG(-1.05)[-1.054]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[selasky.org]; ARC_NA(0.00)[]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_SHORT(0.15)[0.153]; NEURAL_HAM_MEDIUM(-0.99)[-0.992]; FREEMAIL_TO(0.00)[gmx.de,gmail.com,FreeBSD.org]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/29, country:DE]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[freebsd-arm,freebsd-hackers] 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: Wed, 04 Nov 2020 08:52:30 -0000 On 2020-11-04 07:36, Carsten Bäcker wrote: > Am 03.11.2020 um 09:46 schrieb Hans Petter Selasky: >> On 2020-11-03 09:19, Hans Petter Selasky wrote: >>> It looks like smsc(4) uses the following RX format but I don't >>> know actual RX format of H/W(no access to datasheet). >>> >>> <---------------------------- actlen >>> --------------------------------------------------> >>>                  <------------- pktlen ------------------------> >>> rxhdr(4 bytes) | padding (2 bytes) | RX frame | FCS(4 bytes) | >>> partial checksum(2 bytes) >> >> Hi, >> >> I wonder if the checksum is zero, when not valid, and that we should >> check for this in the driver! >> >> Can you try this patch? >> >> Also enabling debugging in the SMSC driver would be useful. >> >> --HPS >> >> _______________________________________________ >> freebsd-hackers@freebsd.org mailing list >> https://lists.freebsd.org/mailman/listinfo/freebsd-hackers >> To unsubscribe, send any mail to >> "freebsd-hackers-unsubscribe@freebsd.org" > Hi, > > i applied the patch on -CURRENT but got a panic right after loading the > kernel. Most likely an unrelated problem. > > But i was able to apply the patch on releng/12.2 (with an offset). > Unfortunately it doesn't change the previously described behavior with > rxcsum and i didn't manage to get any reasonable debug-output. > > Since i can easily reproduce the problem. How else can i help? > Can you enable the debug knob for SMSC: sysctl hw.usb.smsc.debug=16 It will print the RX checksum per frame received. Just do this with the unpatched driver while doing some traffic. Capture log messages from dmesg or /var/log/messages. --HPS