From owner-freebsd-net@FreeBSD.ORG Thu Dec 1 22:43:52 2011 Return-Path: Delivered-To: freebsd-net@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 786021065672; Thu, 1 Dec 2011 22:43:52 +0000 (UTC) (envelope-from pmc@citylink.dinoex.sub.org) Received: from uucp.dinoex.sub.de (uucp.dinoex.sub.de [194.45.71.2]) by mx1.freebsd.org (Postfix) with ESMTP id 94A148FC08; Thu, 1 Dec 2011 22:43:51 +0000 (UTC) Received: from uucp.dinoex.sub.de (uucp@uucp.dinoex.sub.de [194.45.71.2] (may be forged)) by uucp.dinoex.sub.de (8.14.4/8.14.4) with ESMTP id pB1MD5Cd083678 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 1 Dec 2011 23:13:05 +0100 (CET) (envelope-from pmc@citylink.dinoex.sub.org) Received: from citylink.dinoex.sub.org (uucp@localhost) by uucp.dinoex.sub.de (8.14.4/8.14.4/Submit) with UUCP id pB1MD5a0083677; Thu, 1 Dec 2011 23:13:05 +0100 (CET) (envelope-from pmc@citylink.dinoex.sub.org) Received: from gate.oper.dinoex.org (gate-e [192.168.98.2]) by citylink.dinoex.sub.de (8.14.5/8.14.5) with ESMTP id pB1M6uFC007592; Thu, 1 Dec 2011 23:06:56 +0100 (CET) (envelope-from peter@gate.oper.dinoex.org) Received: from gate.oper.dinoex.org (gate-e [192.168.98.2]) by gate.oper.dinoex.org (8.14.5/8.14.5) with ESMTP id pB1M5GJs007500; Thu, 1 Dec 2011 23:05:16 +0100 (CET) (envelope-from peter@gate.oper.dinoex.org) Received: (from peter@localhost) by gate.oper.dinoex.org (8.14.5/8.14.5/Submit) id pB1M5F9U007499; Thu, 1 Dec 2011 23:05:15 +0100 (CET) (envelope-from peter) Date: Thu, 1 Dec 2011 23:05:15 +0100 From: Peter To: yongari@FreeBSD.org Message-ID: <20111201220515.GA3363@gate.oper.dinoex.org> References: <201111292303.pATN30W7062450@freefall.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201111292303.pATN30W7062450@freefall.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Milter: Spamilter (Reciever: uucp.dinoex.sub.de; Sender-ip: 194.45.71.2; Sender-helo: uucp.dinoex.sub.de; ) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.5 (uucp.dinoex.sub.de [194.45.71.2]); Thu, 01 Dec 2011 23:13:06 +0100 (CET) Cc: freebsd-net@FreeBSD.org Subject: Re: kern/162932: [ed][panic][patch] large traffic yields occasional panics X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2011 22:43:52 -0000 On Tue, Nov 29, 2011 at 11:03:00PM +0000, yongari@FreeBSD.org wrote: ! You can find the patch at the following URL. ! http://people.freebsd.org/~yongari/ed.pf.diff ! Let me know whether this patch works for you. Negative. It does not work. It seems You left away the pointer-arithmetics on src side, and copy the FIRST byte to the LAST position. Putting that right makes it working. *(mtod(m, uint8_t *)) should be *(mtod(m, uint8_t *) + m->m_len - 1) (Possibly there is a way to write this construct more beautiful - I didn't care.) ! since your patch may still invoke bus_space_write_1(9) if mbuf ! length is even bytes. Yes, it does. Deliberately. ;) The original idea seemed to be: "copy byte-pairs of AT LEAST mbuf-size" - on uneven buffers tjat led to copying one byte that doesnt belong. My idea was "copy byte-pairs of AT MOST mbuf-size" which leads to the last byte missing on uneven buffers - and therefore I did ALWAYS copy the LAST byte extra. (Shouldn't hurt copying it twice.) Please understand: it's 20 years ago that I coded C. I don't have all the niceties handy - but I'll find some way to get it do what I want. It looks not always beautiful. ;) Today I did reproduce the panic on 7.4-STABLE with the original code. Then I tried Your patch - and it did what was to be expected: no panic, but when setting "ifconfig ed0 mtu 1499", filetransfers would not proceed at all - the wrong byte obviousely breaks the packet checksum. rgds, PMc