From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5508 invoked by alias); 18 May 2006 15:00:04 -0000 Received: (qmail 5338 invoked by uid 22791); 18 May 2006 15:00:00 -0000 X-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from webapps.arcom.com (HELO webapps.arcom.com) (194.200.159.168) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 18 May 2006 14:59:57 +0000 Received: from [10.2.2.14] ([10.2.2.14]) by webapps.arcom.com with Microsoft SMTPSVC(6.0.3790.1830); Thu, 18 May 2006 15:59:52 +0100 Message-ID: <446C8BE9.10503@arcom.com> Date: Thu, 18 May 2006 15:00:00 -0000 From: David Vrabel User-Agent: Thunderbird 1.5.0.2 (X11/20060501) MIME-Version: 1.0 To: "Doyle, Patrick" CC: 'Andrew Lunn' , "'ecos-devel@sources.redhat.com'" , 'Andrew Dyer' Subject: Re: RedBoot patches regarding redboot_getc_terminate References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 18 May 2006 14:59:52.0840 (UTC) FILETIME=[B7BE9080:01C67A8B] X-IsSubscribed: yes Mailing-List: contact ecos-devel-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Post: List-Help: , Sender: ecos-devel-owner@ecos.sourceware.org X-SW-Source: 2006-05/txt/msg00019.txt.bz2 Doyle, Patrick wrote: >> What happens to TFTP transfers with your change? Are they terminated >> gracefully? Or do they hang around until the server times out and >> kills them? >> >> Andrew >> > Unfortunately, I don't have any means to check that. Which is why I brought > it up as a topic for discussion. Then I realized that it would be easier to > discuss if somebody who _did_ have a means to check that checked that, which > led to me posting the patch :-) > > IIRC, a TFTP server will keep spewing out packets until it has sent the > whole file, and will retry and retransmit if the client stops responding. > So, it guess it depends on what the TFTP transport stream (implemented in > code somewhere in RedBoot) does when it gets a "terminate" call that isn't > an abort... > > Hmmm... looking at the code, I see something that looks like: > > if (abort) > tftp_error_ack(...) > else > tftp_ack(...) > > which looks to me like TFTP folks would be getting some sort of similar > error message for TFTP transfers. > > I wonder why I'm the only one whose noticed this? (he asks in a plaintive, > "why do these things always happen to me" voice) No. I noticed (or rather a customer did) but didn't have time to really look at it or implement a solution. I guess I should have a least mentioned it though. Sorry. I don't think your patch does the correct thing wrt TFTP transfers since we're back to the original situation of TFTP connections remaining open for ages. Here's a snippet from our internal bug tracker wrt lingering TFTP connection issue: "When loading ELF images using TFTP RedBoot fails to ACK the last received data block. This causes the server to timeout and retransmit the last data block several times. See attached packet captures for details. This can cause problems with lame TFTP servers (like tftpd32 for Windows) that can only handle one transfer at a time. ---- The ELF image used in testing had a trailing .comment section which RedBoot isn't interested in so it stopped reading data from the TFTP stream and hence didn't ack subsequent data blocks (I don't think it even reads them from the network). I'd suggest stripping unneeded sections from eCos/RedBoot ELF images. e.g., $ arm-elf-string --remove-section=.comment foo.elf ---- I'm not entirely happy with the fix. It terminates the download when all the relevant bits of the ELF have been transferred. The causes the sender to think that the file transfer has failed which causes some customer confusion. I think a better solution would be for the downloader to continue to transfer the remaining portions of the ELF image and just throw them away." Perhaps it's best to revert the fix for the lingering TFTP connections and note instead that ELFs really need all unneccesary sections stripped before transferring to the target? At least until a complete solution (e.g., my suggested solution in the paragraph above) has been implemented. David Vrabel ps. If possible, attach patches as text/plain so people can easily read them in their mail readers. Thanks. Sticking a .txt extension at the end of the file name may do the trick if you're using a lame mail client that doesn't recognize patches as text/plain. -- David Vrabel, Design Engineer Arcom, Clifton Road Tel: +44 (0)1223 411200 ext. 3233 Cambridge CB1 7EA, UK Web: http://www.arcom.com/