patchlwIP - A Lightweight TCP/IP stack - Patches: patch #7702, Include ability to increase the...

 
 

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

patch #7702: Include ability to increase the socket number with defined offset

Submitter:  Nick van IJzendoorn <dipswitch_>
Submitted:  Thu 12 Jan 2012 10:24:25 AM UTC
   
 
Category:  sockets/netconn Priority:  5 - Normal
Status:  Done Privacy:  Public
Assigned to:  goldsimon Open/Closed:  Closed
Planned Release:  None

Wed 11 Feb 2015 10:07:03 PM UTC, comment #4: 

Done, but changed the FD_SET (etc.) macros to calculate on the socket passed instead of making the array bigger. Works for me.

Thanks for the idea and the patch.

Simon Goldschmidt <goldsimon>
Group administrator
Wed 11 Feb 2015 09:08:52 PM UTC, comment #3: 

This response might come a bit late, but...:

> Perhaps it would be better to have a range though - LWIP_SOCKET_MIN and LWIP_SOCKET_MAX


LWIP_SOCKET_MAX is implicitly defined by MEMP_NUM_NETCONN, so I don't see a need for it.

> You should be cautious with that since you can easily make an configuration error if [..]


You can make this configuration error today if MEMP_NUM_NETCONN is too small, so no problem there...

> Another idea would be to force the LWIP_SOCKET_MIN / LWIP_SOCKET_OFFSET to be byte alignment so you can reduce the performance loss


Are we talking about performance loss coming from "(x)-LWIP_SOCKET_OFFSET"? In that case, I don't see a problem: you'd rather switch to raw API if this would be a problem...

However, the original patch is indeed very wasteful in FD_SETSIZE!

Simon Goldschmidt <goldsimon>
Group administrator
Tue 17 Jan 2012 08:44:49 PM UTC, comment #2: 

You should be cautious with that since you can easily make an configuration error if (LWIP_SOCKET_MAX - LWIP_SOCKET_MIN) < (MEMP_NUM_RAW_PCB + MEMP_NUM_UDP_PCB + MEMP_NUM_TCP_PCB + MEMP_NUM_TCP_PCB_LISTEN)

Another idea would be to force the LWIP_SOCKET_MIN / LWIP_SOCKET_OFFSET to be byte alignment so you can reduce the performance loss on redirecting the FD_SET in select to the appropriate drivers. Since you can then quickly check each byte and copy it to an shadow FD_SET.

Nick van IJzendoorn <dipswitch_>
Fri 13 Jan 2012 07:37:32 PM UTC, comment #1: 

I can't see any problem with this.  Perhaps it would be better to have a range though - LWIP_SOCKET_MIN and LWIP_SOCKET_MAX as that is a bit more flexible.

Kieran Mansley <kieranm>
Group Member
Thu 12 Jan 2012 10:24:25 AM UTC, original submission:  

Would it be possible to add an socket offset to the socket API so the socket number is increased with the defined number?

Something like:
LWIP_SOCKET_OFFSET==n: Increases the file descriptor number created by LwIP with n. This can be usefull when there are multiple API's which create file descriptors. When they all start with a different offset and you won't make them overlap you can re implement
read/write/close/ioctl/fnctl to send the requested action to the right library.

The only problem is that select would need a quite expensive wrapper anyway because you would need to split the fd_set's to the appropriate library's.

I provided a patch against v1.4.0.

Nick van IJzendoorn <dipswitch_>

 

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

Attached Files
file #24805:  lwip-socket.patch added by dipswitch_ (3KiB - application/octet-stream - Included a patch for select it's quite useless to start counting from 0 when LWIP_SOCKET_OFFSET would be set to 50 or so)
file #24804:  lwip-socket.patch added by dipswitch_ (2KiB - 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 goldsimon (Updated the item)
  • -email is unavailable- added by kieranm (Posted a comment)
  • -email is unavailable- added by dipswitch_ (Submitted the item)
  • -email is unavailable- added by dipswitch_
  •  

    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 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-02-11 goldsimon StatusNone Done
        Assigned toNone goldsimon
        Open/ClosedOpen Closed
    2013-01-15 goldsimon CategoryNone sockets/netconn
    2012-01-12 dipswitch_ Attached File- Added lwip-socket.patch, #24805
    2012-01-12 dipswitch_ Attached File- Added lwip-socket.patch, #24804
        Carbon-Copy- Added dipswitch_

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code