[SLOF] [PATCH v2 09/10] libnet: Simplify the net-load arguments passing

Alexey Kardashevskiy aik at ozlabs.ru
Wed Oct 12 11:45:00 AEDT 2016


On 11/10/16 23:39, Thomas Huth wrote:
> On 10.10.2016 04:46, Alexey Kardashevskiy wrote:
>> On 20/09/16 05:08, Thomas Huth wrote:
>>> There is no need anymore to pass most of the arguments as
>>> strings, we can use integers and pointers now instead.
>>>
>>> Signed-off-by: Thomas Huth <thuth at redhat.com>
>>> ---
>>>  lib/libnet/libnet.code       | 23 +++++++++--------------
>>>  lib/libnet/netapps.h         |  3 ++-
>>>  lib/libnet/netload.c         | 21 ++++++++++++---------
>>>  slof/fs/packages/obp-tftp.fs | 15 ++++-----------
>>>  4 files changed, 27 insertions(+), 35 deletions(-)
> ...
>>> diff --git a/slof/fs/packages/obp-tftp.fs b/slof/fs/packages/obp-tftp.fs
>>> index 30070a6..2e6bcfc 100644
>>> --- a/slof/fs/packages/obp-tftp.fs
>>> +++ b/slof/fs/packages/obp-tftp.fs
>>> @@ -33,20 +33,13 @@ INSTANCE VARIABLE ciregs-buffer
>>>      my-parent ihandle>phandle node>path encode-string
>>>      s" bootpath" set-chosen
>>>  
>>> -    \ Generate arg string for snk like
>>> -    \ "netboot load-addr length filename"
>>> -    (u.) s" netboot " 2swap $cat s"  60000000 " $cat
>>> +    60000000                        ( addr maxlen )
>>>  
>>>      \ Allocate 1720 bytes to store the BOOTP-REPLY packet
>>> -    6B8 alloc-mem dup >r (u.) $cat
>>> -    huge-tftp-load @ IF s"  1 " ELSE s"  0 " THEN $cat
>>> -    \ Add desired TFTP-Blocksize as additional argument
>>> -    s" 1432 " $cat
>>> +    6B8 alloc-mem dup >r            ( addr maxlen replybuf )
>>> +    huge-tftp-load @  d# 1428       ( addr maxlen replybuf hugetftp blocksize )
>>
>>
>> This 1432 -> 1428 change does not seem to belong to this patch, why is this
>> change?
> 
> 1428 is the right maximum size that should be used for TFTP transfers
> (otherwise there might be problems if networking is using VLANs
> underneath, IIRC).
> The old 1432 value is silently fixed by the code in tftp.c:
> 
>     /* Preferred blocksize - used as option for the read request */
>     if (_blocksize < 8)
>             _blocksize = 8;
>     else if (_blocksize > MAX_BLOCKSIZE)
>             _blocksize = MAX_BLOCKSIZE;
> 
> with MAX_BLOCKSIZE defined to 1428.
> 
> I guess I should have mentioned that in the commit message... or if you
> prefer, I can also do it in a separate patch instead?


Up to you, a note in the commit log is fine for me.



-- 
Alexey


More information about the SLOF mailing list