[patch #9431] Removing the restriction on number of sockets

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[patch #9431] Removing the restriction on number of sockets

madhu
URL:
  <http://savannah.nongnu.org/patch/?9431>

                 Summary: Removing the restriction on number of sockets
                 Project: lwIP - A Lightweight TCP/IP stack
            Submitted by: jllledo
            Submitted on: Tue 08 Aug 2017 07:32:30 PM CEST
                Category: None
                Priority: 5 - Normal
                  Status: None
                 Privacy: Public
             Assigned to: None
        Originator Email:
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: None

    _______________________________________________________

Details:

This comes from [1]

Attached is a patch that adds a new macro to allow the user to remove the
limit on number of sockets.


------------
[1] http://lists.nongnu.org/archive/html/lwip-devel/2017-08/msg00029.html



    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Tue 08 Aug 2017 07:32:30 PM CEST  Name:
0001-New-option-LWIP_SOCKET_OPEN_COUNT-in-opts.h.patch  Size: 7KiB   By:
jllledo

<http://savannah.nongnu.org/patch/download.php?file_id=41453>

    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/patch/?9431>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/


_______________________________________________
lwip-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-devel
Reply | Threaded
Open this post in threaded view
|

[patch #9431] Removing the restriction on number of sockets

madhu
Follow-up Comment #1, patch #9431 (project lwip):

The patch has some drawbacks:
- duplicated code in alloc_socket(): this is really bad as two #if/else blocks
do the same. A bug fixed in one bug can remain in the 2nd block. Never do
this!
- LWIP_SOCKET_OFFSET is not checked/obeyed everywhere
- alloc_socket() doesn't check for int overflow
- free_socket() doesn't follow our (old) C standard where variable
declarations and code must not be mixed
- Why is MEMP_MEM_MALLOC needed?

So far to the patch, I'll reply to the general discussion on the list.

    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/patch/?9431>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/


_______________________________________________
lwip-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-devel
Reply | Threaded
Open this post in threaded view
|

[patch #9431] Removing the restriction on number of sockets

madhu
Follow-up Comment #2, patch #9431 (project lwip):

Here's a new patch with those issues solved.

Regarding the MEMP_MEM_MALLOC requirement, it's there for the number of
sockets to not be limited by MEMP_NUM_* macros as you suggested. Do you want
me to remove it?

(file #41472)
    _______________________________________________________

Additional Item Attachment:

File name: 0001-New-option-LWIP_SOCKET_OPEN_COUNT-in-opts.h.patch Size:7 KB


    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/patch/?9431>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/


_______________________________________________
lwip-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-devel
Reply | Threaded
Open this post in threaded view
|

[patch #9431] Removing the restriction on number of sockets

madhu
Follow-up Comment #3, patch #9431 (project lwip):

Hello,

I updated the patch to the current source, in this version, MEMP_MEM_MALLOC is
not required.

About the problem with the FD_SET, I couldn't find a solution, that's why I
decided to force LWIP_SOCKET_SELECT==0 when LWIP_SOCKET_OPEN_COUNT==1, and
force clients to use the poll() API if they want to have unlimited number of
sockets.

(file #45358)
    _______________________________________________________

Additional Item Attachment:

File name: 0001-Implement-sockets-open-count.patch Size:10 KB


    _______________________________________________________

Reply to this item at:

  <https://savannah.nongnu.org/patch/?9431>

_______________________________________________
  Message sent via Savannah
  https://savannah.nongnu.org/


_______________________________________________
lwip-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-devel
Reply | Threaded
Open this post in threaded view
|

[patch #9431] Removing the restriction on number of sockets

madhu
Follow-up Comment #4, patch #9431 (project lwip):

Hmm, I also had a try at this some weeks ago. I think it would be good to
separate out the allocation scheme (not calling mem_malloc hard).

Also, looking at what linux does, by now I think an overridable define for
FD_SETSIZE is good enough (my linux box fixes this at 1024).

Give me some time to merge your patch with mine...

    _______________________________________________________

Reply to this item at:

  <https://savannah.nongnu.org/patch/?9431>

_______________________________________________
  Message sent via Savannah
  https://savannah.nongnu.org/


_______________________________________________
lwip-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-devel