buglwIP - A Lightweight TCP/IP stack - Bugs: bug #40245, unix port minimal project has...

 
 

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

bug #40245: unix port minimal project has abundant timers

Submitted by:  chrysn <chrysn>
Submitted on:  Fri 11 Oct 2013 04:33:17 PM UTC  
 
Category: ContribSeverity: 3 - Normal
Item Group: Change RequestStatus: Fixed
Privacy: PublicAssigned to: Simon Goldschmidt <goldsimon>
Open/Closed: ClosedPlanned Release: None
lwIP version: git head

Sat 21 Feb 2015 12:53:33 PM UTC, comment #5:

> Thanks for the patches. Although (unfortunately) I do not have a working
> unix/linux environment to test, I went ahead and applied+committed your
> patches. Sadly, they partly did not apply so I had to (partly) apply them
> manually. Sine I'm not in a position to check them right now, could you
> check that this didn't go wrong?


Unfortunately it didn't, I fixed the FTB.

By the way, you should have kept the authorship, this is chrysn's patch even if you had to rebase it, Git allows you to commit with a custom author.

> BTW: why does the unix port have 2 tapif implementations (netif/tapif.c vs. proj/minimal/mintapif.c)?


I really don't know :-)

> BTW2: it would be cool if we could merge the win32 pcapif to work with unix/linux libpcap, too...


What's the usage case of pcapif here ?

Sylvain

Sylvain Rochet <gradator>
Project Member
Thu 12 Feb 2015 09:37:33 PM UTC, comment #4:

Thanks for the patches. Although (unfortunately) I do not have a working unix/linux environment to test, I went ahead and applied+committed your patches. Sadly, they partly did not apply so I had to (partly) apply them manually. Sine I'm not in a position to check them right now, could you check that this didn't go wrong?

Getting my raspi A to run these shouldn't take too long, but I still haven't managed to find the time for it :-)

BTW: why does the unix port have 2 tapif implementations (netif/tapif.c vs. proj/minimal/mintapif.c)?

BTW2: it would be cool if we could merge the win32 pcapif to work with unix/linux libpcap, too...

Simon Goldschmidt <goldsimon>
Project AdministratorIn charge of this item.
Fri 21 Feb 2014 12:15:11 AM UTC, comment #3:

i forgot to mention in the commit message and the comments here: the mintapif_wait i've dropped was, from all i've seen in the history, the precedessor of the now modified mintapif_select function -- code that has been dead for some time.

chrysn <chrysn>
Thu 20 Feb 2014 11:37:38 PM UTC, comment #2:

how could i resist such a nice smiley? ;-)

the patches created for this are threefold:

  • 0001-minimal-patch-to-fix-40245.patch just solves the issue at hand, but the main loop stays relatively complex, and snmp application-level functionality stays intermingled with the interrupt handling.
  • 0002-further-simplification-on-the-minimal-unix-example.patch does away with all custom timer handling, leaving the main loop at `while(1) { mintapif_select(&netif); sys_check_timeouts(); }` -- it uses the select call to sleep until the next timeout is due, but requires
  • 0001-introduce-sys_timeouts_sleeptime.patch on lwip, which adds a NO_SYS=1 function sys_timeouts_sleeptime (which i'd need on microprocessors too anyway).

the lwip patch can't do any harm for it's just a new function; the new version of mintapif works well for me, but i have to admit i did not test it with bigger applications and did not access snmp.

(if you are more familiar with snmp, you might know how strict the requirements on uptime are; now that we don't need the regular wakeups any more, they feel like more overhead than before ... but that's really out of scope here.)

(file #30621, file #30622, file #30623)

chrysn <chrysn>
Thu 20 Feb 2014 09:11:06 PM UTC, comment #1:

Could you provide a patch? Please? :-)

Simon Goldschmidt <goldsimon>
Project AdministratorIn charge of this item.
Fri 11 Oct 2013 04:33:17 PM UTC, original submission:

the mininal project in the unix port of contrib (lwip-contrib/ports/unix/proj/minimal/main.c) contains explicit timer handlers for tcp, reassembly and etharp.

the relevant code sections are `timer_testclr_evt(TIMER_EVT_TCPTMR)`... in the main loop and and `timer_set_interval...` in the setup part.

the setup part can be dropped without replacement, the part in the mainloop replaced with a single sys_check_timeouts() call, which does all this since a566f9d8, i assume.

not only will this make the main program more compact, it will also allow ditching large parts of timer.[hc] (not all; without calling timer_init, no signals fire up at all, but i figure that's only related to the sigalarm initialization done there), bringing the example closer to a minimal example, and better show the features of modern lwip.

chrysn <chrysn>

 

Attached Files
file #30621:  0001-introduce-sys_timeouts_sleeptime.patch added by chrysn (1KiB - application/octet-stream)
file #30623:  0001-minimal-patch-to-fix-40245.patch added by chrysn (5KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by gradator (Posted a comment)
  • -unavailable- added by goldsimon (Posted a comment)
  • -unavailable- added by chrysn (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 12 Feb 2015 09:37:33 PM UTCgoldsimonStatusNone=>Fixed
      Assigned toNone=>goldsimon
      Open/ClosedOpen=>Closed
    Thu 20 Feb 2014 11:37:38 PM UTCchrysnAttached File-=>Added 0001-introduce-sys_timeouts_sleeptime.patch, #30621
      Attached File-=>Added 0002-further-simplification-on-the-minimal-unix-example.patch, #30622
      Attached File-=>Added 0001-minimal-patch-to-fix-40245.patch, #30623

    Back to the top


    Powered by Savane 3.1-cleanup1