tasklwIP - A Lightweight TCP/IP stack - Tasks: task #11493, PPP - change static buffers to...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

task #11493: PPP - change static buffers to PBUFs

Submitter:  Ivan Delamer <idelamer>
Submitted:  Wed 26 Oct 2011 09:48:18 PM UTC
   
 
Category:  Network drivers Should Start On:  Wed 26 Oct 2011 06:00:00 AM UTC
Should be Finished on:  Fri 26 Oct 2012 06:00:00 AM UTC Priority:  5 - Normal
Status:  None Privacy:  Public
Assigned to:  None Percent Complete:  0%
Open/Closed:  Closed Planned Release:  None
Effort:  0.00

Jump to the original submission

Tue 03 Jul 2012 08:33:45 PM UTC, comment #6: 

done in branch ppp-new

Ivan Delamer <idelamer>
Group Member
Tue 13 Mar 2012 04:38:42 PM UTC, comment #5: 

I don't think this should gate 1.4.1

Kieran Mansley <kieranm>
Group Member
Tue 01 Nov 2011 09:04:49 PM UTC, comment #4: 

Seems to me like keeping the original samba PPP code was a good initial choice. However, I think that the way it is written is very un-LwIP-esque. Memory use (program, bss and data) is large compared to other parts of LwIP. I need about an extra 20K flash and 7K RAM.

If/when I get the time to work on this, I will post as a patch and get some feedback. I think there is room for a lot of optimization without changing any behavior, just buffer management.

Ivan Delamer <idelamer>
Group Member
Tue 01 Nov 2011 11:32:27 AM UTC, comment #3: 

When Doping so, please keep in mind that most of the PPP code is deliberately left unchanged to the original samba PPP code. Pbufs are only used in ppp.c (which is a replacement for the main file in the original PPP, which is OS-dependent there).

Simon Goldschmidt <goldsimon>
Group administrator
Mon 31 Oct 2011 04:38:40 PM UTC, comment #2: 

That's right...

Actually what I'll do is change this task: change ppp static buffers to pbufs.

A good part of the ppp code already uses pbufs, I'll look into changing all or most of it.


Ivan Delamer <idelamer>
Group Member
Sat 29 Oct 2011 08:09:37 PM UTC, comment #1: 

What about the "while (l)" at the top of lcp_reqci()? I haven't really used PPP other than playing around with it a bit, but from reading the code, a peer could send multiple CIs that are all NAK'ed so we could have x times a NAK.

Simon Goldschmidt <goldsimon>
Group administrator
Wed 26 Oct 2011 09:48:18 PM UTC, original submission:  

I'll be working with PPP so I may be posting some patches or tasks. I won't push any commits until I receive some feedback or get proficient enough in PPP to do so.

Today: in LCP layer (lcp.c) there is a buffer for NAK messages (line 110):

/* @todo: do we really need such a large buffer? The typical 1500 bytes seem too much. */
static u_char nak_buffer[PPP_MRU]; /* where we construct a nak packet */

I checked the code and the maximum number of bytes used is 8 (in line 1478)

I suggest changing this line to:

static u_char nak_buffer[8];

and we'll save 1492 bytes of ram.

Ivan Delamer <idelamer>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by idelamer (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2012-07-03 idelamer Open/ClosedOpen Closed
    2012-07-03 idelamer Carbon-CopyRemoved 11869 -
    2012-07-03 idelamer Carbon-CopyRemoved 42414 -
    2012-03-13 kieranm Planned Release1.4.1 None
    2011-10-31 idelamer SummaryPPP - lcp.c nak_buffer is too large PPP - change static buffers to PBUFs

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code