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

Submitter:  Joan Lledó <jllledo>
Submitted:  Thu 07 Sep 2017 04:43:13 PM UTC
   
 
Category:  sockets/netconn Priority:  5 - Normal
Status:  Done Privacy:  Public
Assigned to:  goldsimon Open/Closed:  Closed
Planned Release:  2.1.0

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>
Group Member
Thu 19 Oct 2017 05:43:41 PM UTC, comment #10: 

Nice. I've already pushed it.

Simon Goldschmidt <goldsimon>
Group administrator
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:

An unsigned integral type used for the number of file descriptors.


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>
Group 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>
Group 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>
Group administrator
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>
Group 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>
Group 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>
Group administrator
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>
Group administrator
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>
Group administrator
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>

 

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

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

    Date Changed by Updated Field Previous Value => Replaced by
    2017-10-16 jcunningham Attached File- Added 0001-sockets-poll-Open-Group-clean-ups.patch, #42171
    2017-10-08 jcunningham Attached File- Added 0001-sockets-poll-clean-ups.patch, #42092
    2017-09-21 goldsimon StatusNone Done
        Assigned toNone goldsimon
        Open/ClosedOpen Closed
        Planned ReleaseNone 2.1.0
    2017-09-21 goldsimon Attached File- Added 0001-PATCH-New-sockets-function-lwip_poll.patch, #41860
    2017-09-07 jllledo Attached File- Added 0001-New-sockets-function-lwip_poll.patch, #41758

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code