Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 17 Jun 2009 18:28:02 +0200
From:      Rafal Jaworowski <raj@semihalf.com>
To:        Marcel Moolenaar <xcllnt@mac.com>
Cc:        ppc@FreeBSD.org
Subject:   Re: MPC8555CDS: U-Boot vs loader compatibility
Message-ID:  <3B1C809E-B2FA-40D7-8202-22CDD389D9BA@semihalf.com>
In-Reply-To: <0B237AD8-FC97-4264-9A39-E4C266633E7F@mac.com>
References:  <B8C7C826-1DC9-4B66-8ECE-86B6C200F0F6@mac.com> <EB949125-E138-49FE-B5BE-1C72AF467CA9@semihalf.com> <DC352583-41E0-4140-BF22-8E81B7B6F1D9@semihalf.com> <0B237AD8-FC97-4264-9A39-E4C266633E7F@mac.com>

next in thread | previous in thread | raw e-mail | index | archive | help

On 2009-05-30, at 21:37, Marcel Moolenaar wrote:

> On May 28, 2009, at 7:48 AM, Rafal Jaworowski wrote:
>
>>
>> On 2009-05-26, at 21:15, Rafal Jaworowski wrote:
>>
>>> On 2009-05-26, at 18:50, Marcel Moolenaar wrote:
>>>
>>>> I think I recently updated the FreeBSD loader on my CDS
>>>> that has U-Boot version 1.3.2-rc1 on it (yes, that sounds
>>>> rather fuzzy :-) In any case, the latest PowerPC U-Boot
>>>> loader is having a problem with netbooting. I see packets
>>>> being transmitted (BOOTP), but none of the responses seem
>>>> to arrive at the loader. Then the ARP resolution is
>>>> attempted, which fails as well.
>>>
>>> I'll try the latest loader tomorrow and let you know how this work  
>>> here.
>>
>> I checked a freshly built loader from HEAD and it works fine with U- 
>> Boot 2008.10-rc2-00091-g2f4342b.
>
> Ok, the problem is this: when packets arrive on the interface that
> are larger than the buffer being passed to U-Boot from the loader,
> then the eth_receive returns -1 and leaves the packet saved. The
> next call to eth_receive(0 will find that same packet and can fail
> for the exact same reason. A typical scenario is the loader doing
> ARP with a buffer of 66 bytes. The end result is that the ARP
> will fail and the loader panics.
>
> This obviously depends on the amount and kind of traffic on the
> LAN in question...
>
> The following U-Boot patch fixes the problem (against 1.3.4):
>
> diff -u u-boot-1.3.4-orig/net/eth.c u-boot-1.3.4-local/net/eth.c
> --- u-boot-1.3.4-orig/net/eth.c	2008-08-12 07:08:38.000000000 -0700
> +++ u-boot-1.3.4-local/net/eth.c	2009-05-30 12:19:20.000000000 -0700
> @@ -526,10 +526,7 @@
> 			return -1;
> 	}
>
> -	if (length < eth_rcv_bufs[eth_rcv_current].length)
> -		return -1;
> -
> -	length = eth_rcv_bufs[eth_rcv_current].length;
> +	length = min(length, eth_rcv_bufs[eth_rcv_current].length);
>
> 	for (i = 0; i < length; i++)
> 		p[i] = eth_rcv_bufs[eth_rcv_current].data[i];
>
> FYI,

So this seems like a bug in generic networking U-Boot code. Are you  
willing to push this fix to the U-Boot main line?

Rafal




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3B1C809E-B2FA-40D7-8202-22CDD389D9BA>