Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 1 Dec 2011 23:05:15 +0100
From:      Peter <pmc@citylink.dinoex.sub.org>
To:        yongari@FreeBSD.org
Cc:        freebsd-net@FreeBSD.org
Subject:   Re: kern/162932: [ed][panic][patch] large traffic yields occasional panics
Message-ID:  <20111201220515.GA3363@gate.oper.dinoex.org>
In-Reply-To: <201111292303.pATN30W7062450@freefall.freebsd.org>
References:  <201111292303.pATN30W7062450@freefall.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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



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