patchlwIP - A Lightweight TCP/IP stack - Patches: patch #9450, New sockets function: lwip_poll

 
 

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

patch #9450: New sockets function: lwip_poll

Submitted by:  Joan Lledó <jllledo>
Submitted on:  Thu 07 Sep 2017 04:43:13 PM UTC  
 
Category: sockets/netconnPriority: 5 - Normal
Status: DonePrivacy: Public
Assigned to: Simon Goldschmidt <goldsimon>Open/Closed: Closed
Planned Release: 2.1.0

(Jump to the original submission Jump to the original submission)

Thu 19 Oct 2017 07:05:19 PM UTC, comment #11:

> Nice. I've already pushed it.


I didn't see any change in git. I went ahead and pushed my version of the commit (9c175835d5eab03c8b4213bb02a6e83f9925cf44) thanks!

Joel Cunningham <jcunningham>
Project Member
Thu 19 Oct 2017 05:43:41 PM UTC, comment #10:

Nice. I've already pushed it.

Simon Goldschmidt <goldsimon>
Project AdministratorIn charge of this item.
Mon 16 Oct 2017 08:04:53 PM UTC, comment #9:

Attached is some additional poll cleans in regards to Open Group.

I enabled libcurl's poll support with LwIP, but had some issues where POLLPRI and POLLHUP are referenced, but LwIP didn't have a definition. I have added the remaining open group constants and documented them as unimplemented. GNU libc poll extensions (POLLMSG, POLLREMOVE, POLLRDHUP) remain absent.

While reading the open group specification, I found that nfds_t is:

So I have changed the type from int to unsigned int in my patch as well

http://pubs.opengroup.org/onlinepubs/007908799/xsh/poll.h.html

(file #42171)

Joel Cunningham <jcunningham>
Project Member
Mon 16 Oct 2017 01:08:20 PM UTC, comment #8:

Patch pushed in 0882e0ba894ab21a5fb6e7ce31a58fe5d3f43d32 with suggested nfds > 0 change, thanks!

Joel Cunningham <jcunningham>
Project Member
Mon 16 Oct 2017 08:03:32 AM UTC, comment #7:

Looks good.
You could change the check for "nfds != 0" to "nfds > 0", since nfds_t is a signed type...

Simon Goldschmidt <goldsimon>
Project AdministratorIn charge of this item.
Fri 13 Oct 2017 05:04:30 PM UTC, comment #6:

Ping! Did anyone have a chance to look at my cleanup patch (it's minor)? Thanks

Joel Cunningham <jcunningham>
Project Member
Sun 08 Oct 2017 04:14:31 AM UTC, comment #5:

I had a chance to review the poll changes and spotted a couple minor things to clean up:

1) lwip_poll() will data abort inside of lwip_pollscan() if fds is NULL and nfds > 0. We can handle this by checking for this case in lwip_poll() and returning -1 with errno = EINVAL. Also might be good to error for fds != NULL and nfds == 0.

2) lwip_poll_should_wake() should be using has_recvevent, has_sendevent, and has_errevent available in select_check_waiters() rather using the sock pointer. The has_* copies are meant to store the events after we have called SYS_ARCH_UNPROTECT and left the critical section

I'll post a patch in the next couple of days

Joel Cunningham <jcunningham>
Project Member
Thu 21 Sep 2017 08:25:50 PM UTC, comment #4:

Some things have moved from sockets.c to sockets_priv.h. I thought git might handle this, but apparently it doesn't...

Simon Goldschmidt <goldsimon>
Project AdministratorIn charge of this item.
Thu 21 Sep 2017 08:21:17 PM UTC, comment #3:

What's the error? I may be creating the patch with the wrong command. Or maybe the sources have changed since I wrote the patch and the lines aren't matching.

Joan Lledó <jllledo>
Thu 21 Sep 2017 08:20:45 PM UTC, comment #2:

I've pushed the patch. Cleaned it up a bit, too. Having LWIP_SOCKET_POLL==2 is just not the lwIP way. I guess we have patch #9350 for that...

What remains is that it seems to me as we could probably share more code between select and poll...

Simon Goldschmidt <goldsimon>
Project AdministratorIn charge of this item.
Thu 21 Sep 2017 06:51:04 PM UTC, comment #1:

Don't know why, but again, this patch didn't apply for me.

I've took the time to port it to current master:

(file #41860)

Simon Goldschmidt <goldsimon>
Project AdministratorIn charge of this item.
Thu 07 Sep 2017 04:43:13 PM UTC, original submission:

Hello,

This patch adds a new poll() function for the Sockets API. The patch has been modified to include the new features added to lwip_select() after the release 2.0.1, for which the patch was originally written.

The patch has been tested and is working fine for the unixsim example in lwip-contrib. But no further tests have been made.

Joan Lledó <jllledo>

 

Attached Files
file #42092:  0001-sockets-poll-clean-ups.patch added by jcunningham (4KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by jcunningham (Posted a comment)
  • -unavailable- added by goldsimon (Updated the item)
  • -unavailable- added by jllledo (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 8 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 16 Oct 2017 08:04:53 PM UTCjcunninghamAttached File-=>Added 0001-sockets-poll-Open-Group-clean-ups.patch, #42171
    Sun 08 Oct 2017 03:48:46 PM UTCjcunninghamAttached File-=>Added 0001-sockets-poll-clean-ups.patch, #42092
    Thu 21 Sep 2017 08:20:45 PM UTCgoldsimonStatusNone=>Done
      Assigned toNone=>goldsimon
      Open/ClosedOpen=>Closed
      Planned ReleaseNone=>2.1.0
    Thu 21 Sep 2017 06:51:04 PM UTCgoldsimonAttached File-=>Added 0001-PATCH-New-sockets-function-lwip_poll.patch, #41860
    Thu 07 Sep 2017 04:43:13 PM UTCjllledoAttached File-=>Added 0001-New-sockets-function-lwip_poll.patch, #41758

    Back to the top


    Powered by Savane 3.1-cleanup1