Skip to content

Network defrag

Wolfgang Denk u-boot 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest0 of 4 patches 0 repliesNew

Patches in v1 No applies recorded yet

None of the 4 patches the cover letter announces are in this archive.

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [U-Boot] [PATCH 0/4] Network defrag

Dear Robin Getz,

Quoted 5 lines · In message <[email protected]> you wrote:
Quoted 3 lines

Why static int? This gives a random init value for the second and each following TFTP transfers.

Nope - it is set to zero on the start of every transfer.

Right, I saw this later, at the end of your patch, but was too lazy to change my whole message ;-)

Quoted 7 lines
Quoted 5 lines

Review

Quoted 3 lines
(quoted diff) +3 -0
+#ifdef CONFIG_TFTP_TSIZE
+		pkt += sprintf((char *)pkt,"tsize%c%d", 0,0);
+		pkt += strlen((char *)pkt) + 1;

Looks to me as if you were adding the length twice?

One zero is for the null char (delimiter), one zero is for ascii zero (length).

Wel, the sprintf() already returns the number of output characters, i. e. 7.

pkt then points at the terminating '\0' character. strlen() should always return 0, then. This makes not much sense to me.

Also, why do you need sprintf() at all when the string is a constant anyway?

Why not simply:

	memcpy (pkt, "tsize\00", 7);
	pkt += 7;
Quoted 7 lines
Quoted 7 lines

Review

Quoted 3 lines
(quoted diff) +3 -0
+			printf("%2d\b\b", NetBootFileXferSize * 100 / TftpTsize);
+		}
+#endif

Hm... maybe we should rather print hashes (say one '#' for each 2%, resulting in a maximum of 50 characters output.

Quoted 8 lines
Quoted 2 lines

Otherwise we actually increase the amount of characters sent over the serial line (and the intention was to reduce it, right?)

Yeah, it was to reduce the output - this was easier :)

Plus spinning numbers are always nice. When you are doing a scp - do you look at the bar moving, or the numbers going up to 100%? I always look at the numbers...

I know what you mean. OTOH, I tend to dislike such characters sequences (with lots of backspace characters) because they always mess up log files ;-)

Quoted 1 line

I'll re-work it for a single line of 50 hashes. (one '#' == 2% of the file).

Thanks.

Quoted 2 lines

So - you are OK with they way it is done (other comments still apply of course).

Right. Thanks a lot.

Best regards,

Wolfgang Denk

Signature · 4 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Many aligators will be slain, but the swamp will remain.