patchlwIP - A Lightweight TCP/IP stack - Patches: patch #6861, Support for proper system...

 
 

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

patch #6861: Support for proper system termination in lwIP

Submitter:  Laura Garrett <laura4garrett>
Submitted:  Thu 09 Jul 2009 01:18:31 PM UTC
   
 
Category:  None Priority:  5 - Normal
Status:  Wont Do Privacy:  Public
Assigned to:  goldsimon Open/Closed:  Closed
Planned Release:  None

Wed 07 Oct 2009 06:13:50 PM UTC, comment #4: 

Still, the patch doesn't do what you want: we rely pretty much on implicit variable initialization (for variables initialized to NULL, zero or something like that). And mailboxes, semaphores and so on aren't deleted, as I already mentioned.

As such and as this patch bloats the code even if shutdown is not used, I vote against it.

Please repoen if you disagree.

Simon Goldschmidt <goldsimon>
Group administrator
Tue 14 Jul 2009 02:35:06 PM UTC, comment #3: 


>In the past, there have been multiple requests for 'graceful >shutdown' of the stack and every time, we decided to not >implement it because it's not used on most platforms (embedded >systems just power off)

There are exceptions. We have a battery powered GPRS terminal which acquires information and goes online only for a minute or two every day in order to send it. I bet there are much users that have similar needs.

We solved the problem by creating and assigning separate .text, .data and .bss sections only for lwip+netif+ping/.... Then I wrote lwip_reinit() which does exactly what the startup code in crt0.s does (note: we had to add the -fno-common compiler option in order to place all lwip's variables in the dedicated section). We don't need lwip_shutdown() function, we just stop calling the tcp_tmr(). We don't use an OS if it matters.

> and it requires much code most people will never use

It can be surrounded by something like #if LWIP_SHUTDOWN_SUPPORT

>So, any reason to leave this open?

How about schedule it for 1.4?

Regards,
Iordan

Iordan Neshev <iordan_neshev>
Thu 09 Jul 2009 04:49:49 PM UTC, comment #2: 

Seems like it's meant as local reference to the global 'mbox', which could have to be deleted when the stack is shut down, although that part seems to be missing (at least in the diff).

However, that doesn't mean everything is cleaned up correctly: what about memp- or mem-memory that is still allocated? Or with data that might have been allocated and references stored in pcb->arg of one of the protocols?

In the past, there have been multiple requests for 'graceful shutdown' of the stack and every time, we decided to not implement it because it's not used on most platforms (embedded systems just power off) and it requires much code most people will never use (see local_mbox and SYS_ARCH_GET()...).

So, any reason to leave this open?

Simon Goldschmidt <goldsimon>
Group administrator
Thu 09 Jul 2009 03:02:59 PM UTC, comment #1: 

Can you explain more about why all the local_mbox stuff is necessary?

Kieran Mansley <kieranm>
Group Member
Thu 09 Jul 2009 01:18:31 PM UTC, original submission:  

Hi,

Attached is a patch implementing graceful shutdown of the lwip stack. This patch required adding another arch dependent function (thread-join), which I implemented for the win32 platform.

I would be grateful for comments about it, and will be very happy to fix it until it is accepted to lwip's trunk.

 

Regards,
Laura Garrett

Laura Garrett <laura4garrett>

 

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

Attached Files
file #18394:  terminate.diff added by laura4garrett (8KiB - application/octet-stream - The patch.)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by iordan_neshev (Posted a comment)
  • -email is unavailable- added by goldsimon (Posted a comment)
  • -email is unavailable- added by kieranm (Posted a comment)
  • -email is unavailable- added by laura4garrett (Submitted the item)
  • -email is unavailable- added by laura4garrett
  •  

    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
    2009-10-07 goldsimon Open/ClosedOpen Closed
        Assigned toNone goldsimon
        StatusNone Wont Do
    2009-07-09 laura4garrett Attached File- Added terminate.diff, #18394
        Carbon-Copy- Added -email is unavailable-

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code