You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2021/12/29 09:27:09 UTC

[GitHub] [incubator-nuttx] anchao opened a new pull request #5104: net/tcp/udp: allocate tcp/udp connect dynamically

anchao opened a new pull request #5104:
URL: https://github.com/apache/incubator-nuttx/pull/5104


   ## Summary
   
   net/udp: rename NET_UDP_CONNS to NET_UDP_CONNS_PER_BLOCK
   net/tcp: rename NET_TCP_CONNS to NET_TCP_CONNS_PER_BLOCK
   net/udp: allocate udp connect dynamically
   net/tcp: allocate tcp connect dynamically
   
   ## Impact
   
   tcp/udp connect instance allocate
   
   ## Testing
   
   tcp/udp client/server test


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] anchao commented on a change in pull request #5104: net/tcp/udp: allocate tcp/udp connect dynamically

Posted by GitBox <gi...@apache.org>.
anchao commented on a change in pull request #5104:
URL: https://github.com/apache/incubator-nuttx/pull/5104#discussion_r776466658



##########
File path: net/udp/Kconfig
##########
@@ -50,11 +50,12 @@ config NET_UDP_CHECKSUMS
 		Enable/disable UDP checksum support.  UDP checksum support is
 		REQUIRED for IPv6.
 
-config NET_UDP_CONNS
-	int "Number of UDP sockets"
-	default 8
+config NET_UDP_CONNS_PER_ALLOC
+	int "Number of UDP sockets per block(one for each open)"

Review comment:
       Done




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] anchao commented on pull request #5104: net/tcp/udp: allocate tcp/udp connect dynamically

Posted by GitBox <gi...@apache.org>.
anchao commented on pull request #5104:
URL: https://github.com/apache/incubator-nuttx/pull/5104#issuecomment-1003101975


   The current static configuration is no longer suitable for business situation, this is intention of pull request,
   In terms of real products, NuttX is not just running in simple IOT devices,
   we already have a demand for full-featured business terminal, We have online video/audio streaming services,
   stream transfer services, adb network bridges, high-level application networking services, etc.
   Most of the time we serve in an environment where the number of connections is unknown,
   For example if multicast or mesh network device as long as there is one more hardware device connected to our service in the local area network, the number of connections will increase by one. this is common scene of smart homes.
   
   We hope to find a balance to enhance the scalability of NuttX. In most cases, other developers will have similar situations.
   
   This connection information is dumped from Smart Speaker, the number of connections is still growing from application developers ...
   
   ```
    [TCP]                 LADDR    LPORT             RADDR      RPORT  RCVBUFS  SNDBUFS  SNDPEND  RCVPEND   RCVOOO
    TCP   [ 0]: [       127.0.0.1: 12904] -> [       127.0.0.1: 12903]    16384    16384        0        0        0
    TCP   [ 1]: [       127.0.0.1: 12903] -> [       127.0.0.1: 12904]    16384    16384        0        0        0
    TCP   [ 2]: [         0.0.0.0: 12905] -> [       127.0.0.1: 54322]    16384    16384        0        0        0
    TCP   [ 3]: [         0.0.0.0: 12906] -> [       127.0.0.1: 54323]    16384    16384        0        0        0
    TCP   [ 4]: [       127.0.0.1: 54322] -> [       127.0.0.1: 12905]    16384    16384        0        0        0
    TCP   [ 5]: [       127.0.0.1: 54323] -> [       127.0.0.1: 12906]    16384    16384        0        0        0
    TCP   [ 6]: [         0.0.0.0: 12908] -> [ ***************:   443]    16384    16384        0        0        0
    TCP   [ 7]: [         0.0.0.0: 12924] -> [ ***************:    80]    16384    16384        0        0        0
    TCP   [ 8]: [         0.0.0.0: 13689] -> [ ***************:    80]   131070    16384        0      541        0
    TCP   [ 9]: [         0.0.0.0: 13763] -> [ ***************:   443]    16384    16384        0        0      213
    TCP   [10]: [         0.0.0.0: 14322] -> [ ***************:   645]    16384    16384        0        0        0
    TCP   [11]: [         0.0.0.0: 14323] -> [ ***************:    80]   131070    16384        0        0        0
    TCP   [12]: [         0.0.0.0: 14633] -> [ ***************:   443]    16384    16384        0        0        0
    TCP   [13]: [         0.0.0.0: 14634] -> [ ***************:   443]    16384    16384        0        0        0
    TCP   [14]: [         0.0.0.0: 14711] -> [ ***************:    80]   131070    16384        0      123        0
    -----------------------
    [UDP]                 LADDR    LPORT             RADDR      RPORT  RCVBUFS  SNDBUFS  SNDPEND  RCVPEND
    UDP   [ 0] [         0.0.0.0: 54321] -> [    36.156.49.91:   443]:    16384    16384        0        0
    UDP   [ 1] [         0.0.0.0: 21355] -> [  111.202.86.129:  6666]:    16384    16384        0        0
    UDP   [ 2] [         0.0.0.0: 10010] -> [         0.0.0.0:     0]:    16384    16384        0        0
    UDP   [ 3] [         0.0.0.0: 21356] -> [   192.168.31.93: 29443]:   262144   262144        0        0
    UDP   [ 4] [         0.0.0.0: 21357] -> [ ***************: 10010]:    16384    16384        0        0
    UDP   [ 5] [         0.0.0.0: 21340] -> [   192.168.31.96: 29443]:    16384    16384        0        0
    UDP   [ 6] [         0.0.0.0: 21341] -> [ ***************: 10010]:    16384    16384        0        0
    UDP   [ 7] [         0.0.0.0: 21345] -> [  192.168.31.133: 29443]:    16384    16384        0        0
    UDP   [ 8] [         0.0.0.0: 21365] -> [ ***************:  6432]:    16384    16384        0        0
    UDP   [ 9] [         0.0.0.0: 21377] -> [  192.168.31.147: 29443]:   262144   262144        0        0
    UDP   [10] [         0.0.0.0: 21378] -> [ ***************:  7981]:    16384    16384        0        0
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] anchao commented on a change in pull request #5104: net/tcp/udp: allocate tcp/udp connect dynamically

Posted by GitBox <gi...@apache.org>.
anchao commented on a change in pull request #5104:
URL: https://github.com/apache/incubator-nuttx/pull/5104#discussion_r776329530



##########
File path: net/tcp/tcp_conn.c
##########
@@ -110,15 +108,12 @@ static FAR struct tcp_conn_s *
   tcp_listener(uint8_t domain, FAR const union ip_addr_u *ipaddr,
                uint16_t portno)
 {
-  FAR struct tcp_conn_s *conn;
-  int i;
+  FAR struct tcp_conn_s *conn = NULL;

Review comment:
       NULL indicates to get the active list from tcp_nextconn()




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] davids5 commented on a change in pull request #5104: net/tcp/udp: allocate tcp/udp connect dynamically

Posted by GitBox <gi...@apache.org>.
davids5 commented on a change in pull request #5104:
URL: https://github.com/apache/incubator-nuttx/pull/5104#discussion_r776464268



##########
File path: net/udp/Kconfig
##########
@@ -50,11 +50,12 @@ config NET_UDP_CHECKSUMS
 		Enable/disable UDP checksum support.  UDP checksum support is
 		REQUIRED for IPv6.
 
-config NET_UDP_CONNS
-	int "Number of UDP sockets"
-	default 8
+config NET_UDP_CONNS_PER_ALLOC
+	int "Number of UDP sockets per block(one for each open)"

Review comment:
       Number of UDP sockets per allocation.

##########
File path: net/udp/Kconfig
##########
@@ -50,11 +50,12 @@ config NET_UDP_CHECKSUMS
 		Enable/disable UDP checksum support.  UDP checksum support is
 		REQUIRED for IPv6.
 
-config NET_UDP_CONNS
-	int "Number of UDP sockets"
-	default 8
+config NET_UDP_CONNS_PER_ALLOC
+	int "Number of UDP sockets per block(one for each open)"
+	default 1 if DEFAULT_SMALL
+	default 4
 	---help---
-		The maximum amount of open concurrent UDP sockets
+		The amount of open concurrent UDP sockets per allocation

Review comment:
       The number of UDP sockets allocated per allocation that occurs when none are available.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] gustavonihei commented on pull request #5104: net/tcp/udp: allocate tcp/udp connect dynamically

Posted by GitBox <gi...@apache.org>.
gustavonihei commented on pull request #5104:
URL: https://github.com/apache/incubator-nuttx/pull/5104#issuecomment-1003021377


   What's the motivation for allocating the resources dynamically?
   The decision for this type of change should consider an analysis of the tradeoffs.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] anchao commented on a change in pull request #5104: net/tcp/udp: allocate tcp/udp connect dynamically

Posted by GitBox <gi...@apache.org>.
anchao commented on a change in pull request #5104:
URL: https://github.com/apache/incubator-nuttx/pull/5104#discussion_r776337610



##########
File path: net/tcp/tcp_conn.c
##########
@@ -538,22 +570,10 @@ static inline int tcp_ipv6_bind(FAR struct tcp_conn_s *conn,
 
 void tcp_initialize(void)
 {
-  int i;
-
   /* Initialize the queues */
 
   dq_init(&g_free_tcp_connections);
   dq_init(&g_active_tcp_connections);
-
-  /* Now initialize each connection structure */
-
-  for (i = 0; i < CONFIG_NET_TCP_CONNS; i++)
-    {
-      /* Mark the connection closed and move it to the free list */
-
-      g_tcp_connections[i].tcpstateflags = TCP_CLOSED;

Review comment:
       line 548 - 550
   https://github.com/apache/incubator-nuttx/pull/5104/commits/6038a35bc5c57d17c6ab277906d5c3e696a43c27#diff-fd66b1e5b4be7133f600f2a9089d2415165ef1fd8ff957e8aef261b119f7394eR548-R550




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] anchao commented on a change in pull request #5104: net/tcp/udp: allocate tcp/udp connect dynamically

Posted by GitBox <gi...@apache.org>.
anchao commented on a change in pull request #5104:
URL: https://github.com/apache/incubator-nuttx/pull/5104#discussion_r776330976



##########
File path: include/nuttx/net/netconfig.h
##########
@@ -456,11 +456,11 @@
  * connection requires approximately 30 bytes of memory.
  */
 
-#ifndef CONFIG_NET_TCP_CONNS
+#ifndef CONFIG_NET_TCP_CONNS_PER_BLOCK
 #  ifdef CONFIG_NET_TCP
-#   define CONFIG_NET_TCP_CONNS 10
+#   define CONFIG_NET_TCP_CONNS_PER_BLOCK 10

Review comment:
       Done




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] davids5 commented on a change in pull request #5104: net/tcp/udp: allocate tcp/udp connect dynamically

Posted by GitBox <gi...@apache.org>.
davids5 commented on a change in pull request #5104:
URL: https://github.com/apache/incubator-nuttx/pull/5104#discussion_r776320437



##########
File path: include/nuttx/net/netconfig.h
##########
@@ -456,11 +456,11 @@
  * connection requires approximately 30 bytes of memory.
  */
 
-#ifndef CONFIG_NET_TCP_CONNS
+#ifndef CONFIG_NET_TCP_CONNS_PER_BLOCK
 #  ifdef CONFIG_NET_TCP
-#   define CONFIG_NET_TCP_CONNS 10
+#   define CONFIG_NET_TCP_CONNS_PER_BLOCK 10

Review comment:
       The new default in Kconfig is `default 4`  is it better these this match?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] acassis commented on a change in pull request #5104: net/tcp/udp: allocate tcp/udp connect dynamically

Posted by GitBox <gi...@apache.org>.
acassis commented on a change in pull request #5104:
URL: https://github.com/apache/incubator-nuttx/pull/5104#discussion_r776715996



##########
File path: net/tcp/tcp_conn.c
##########
@@ -110,15 +107,12 @@ static FAR struct tcp_conn_s *
   tcp_listener(uint8_t domain, FAR const union ip_addr_u *ipaddr,
                uint16_t portno)
 {
-  FAR struct tcp_conn_s *conn;
-  int i;
+  FAR struct tcp_conn_s *conn = NULL;
 
   /* Check if this port number is in use by any active UIP TCP connection */
 
-  for (i = 0; i < CONFIG_NET_TCP_CONNS; i++)
+  while ((conn = tcp_nextconn(conn)) != NULL)

Review comment:
       I think we need to have a CONFIG_MAX_NET_TCP_CONNS, otherwise it could be possible to exhaust the RAM memory easily and it could be a source of "Denial of Service" attack for IoT systems.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 commented on pull request #5104: net/tcp/udp: allocate tcp/udp connect dynamically

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on pull request #5104:
URL: https://github.com/apache/incubator-nuttx/pull/5104#issuecomment-1003053356


   > I think dynamic allocation in the kernel makes NuttX more unpredictable for realtime applications.
   
   Yes, TLSF allocator may improve the real time a little bit(http://www.gii.upv.es/tlsf/).
   
   > Maybe it could be dependent of some option like CONFIG_ALLOW_NON_RT_BEHAVIOR. What do you think?
   
   or we can do the initial allocation in initialization since the realtime behavior is same as before until we use up the reserved conn.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 commented on pull request #5104: net/tcp/udp: allocate tcp/udp connect dynamically

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on pull request #5104:
URL: https://github.com/apache/incubator-nuttx/pull/5104#issuecomment-1003372761


   @acassis do you think the new implementation is good to merge?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] anchao commented on a change in pull request #5104: net/tcp/udp: allocate tcp/udp connect dynamically

Posted by GitBox <gi...@apache.org>.
anchao commented on a change in pull request #5104:
URL: https://github.com/apache/incubator-nuttx/pull/5104#discussion_r777023382



##########
File path: net/Kconfig
##########
@@ -312,6 +312,15 @@ source "net/ipforward/Kconfig"
 
 endmenu # Internet Protocol Selection
 
+config NET_ALLOC_CONNS
+	bool "Allocate connect instance dynamically support"

Review comment:
       Done

##########
File path: net/Kconfig
##########
@@ -312,6 +312,15 @@ source "net/ipforward/Kconfig"
 
 endmenu # Internet Protocol Selection
 
+config NET_ALLOC_CONNS
+	bool "Allocate connect instance dynamically support"
+	default n
+	---help---
+		Enable the function of Allocate connect instance dynamically.
+		If the connections can not be estimated, the stack will abandon
+		static pre-allocate connection entries, all connections will be
+		dynamically allocated from heap.
+

Review comment:
       Done




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] davids5 commented on a change in pull request #5104: net/tcp/udp: allocate tcp/udp connect dynamically

Posted by GitBox <gi...@apache.org>.
davids5 commented on a change in pull request #5104:
URL: https://github.com/apache/incubator-nuttx/pull/5104#discussion_r776371181



##########
File path: net/tcp/Kconfig
##########
@@ -50,11 +50,11 @@ config NET_TCPURGDATA
 		compiled in. Urgent data (out-of-band data) is a rarely used TCP feature
 		that is very seldom would be required.
 
-config NET_TCP_CONNS
-	int "Number of TCP/IP connections"
-	default 8
+config NET_TCP_CONNS_PER_BLOCK
+	int "Number of TCP/IP connections per block(one for each open)"
+	default 4
 	---help---
-		Maximum number of TCP/IP connections (all tasks)
+		Maximum number of TCP/IP connections per block(all tasks)

Review comment:
       What aboutn NET_{UDP|TCP}_CONNS_PER_BLOCK -> NET_{UDP|TCP}_CONNS_PER_ALLOC  so it is consistent with this behavior that is not the same as the FD change that is blocks?

##########
File path: net/tcp/Kconfig
##########
@@ -50,11 +50,11 @@ config NET_TCPURGDATA
 		compiled in. Urgent data (out-of-band data) is a rarely used TCP feature
 		that is very seldom would be required.
 
-config NET_TCP_CONNS
-	int "Number of TCP/IP connections"
-	default 8
+config NET_TCP_CONNS_PER_BLOCK
+	int "Number of TCP/IP connections per block(one for each open)"
+	default 4
 	---help---
-		Maximum number of TCP/IP connections (all tasks)
+		Maximum number of TCP/IP connections per block(all tasks)

Review comment:
       What about NET_{UDP|TCP}_CONNS_PER_BLOCK -> NET_{UDP|TCP}_CONNS_PER_ALLOC  so it is consistent with this behavior that is not the same as the FD change that is blocks?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] anchao commented on a change in pull request #5104: net/tcp/udp: allocate tcp/udp connect dynamically

Posted by GitBox <gi...@apache.org>.
anchao commented on a change in pull request #5104:
URL: https://github.com/apache/incubator-nuttx/pull/5104#discussion_r776330878



##########
File path: net/tcp/tcp_conn.c
##########
@@ -61,6 +61,8 @@
 #include <nuttx/net/ip.h>
 #include <nuttx/net/tcp.h>
 
+#include <nuttx/kmalloc.h>

Review comment:
       Done

##########
File path: net/tcp/tcp_conn.c
##########
@@ -656,8 +677,6 @@ FAR struct tcp_conn_s *tcp_alloc(uint8_t domain)
     }
 #endif
 
-  net_unlock();

Review comment:
       Done




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 merged pull request #5104: net/tcp/udp: allocate tcp/udp connect dynamically

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 merged pull request #5104:
URL: https://github.com/apache/incubator-nuttx/pull/5104


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] acassis commented on a change in pull request #5104: net/tcp/udp: allocate tcp/udp connect dynamically

Posted by GitBox <gi...@apache.org>.
acassis commented on a change in pull request #5104:
URL: https://github.com/apache/incubator-nuttx/pull/5104#discussion_r776738830



##########
File path: net/tcp/tcp_conn.c
##########
@@ -110,15 +107,12 @@ static FAR struct tcp_conn_s *
   tcp_listener(uint8_t domain, FAR const union ip_addr_u *ipaddr,
                uint16_t portno)
 {
-  FAR struct tcp_conn_s *conn;
-  int i;
+  FAR struct tcp_conn_s *conn = NULL;
 
   /* Check if this port number is in use by any active UIP TCP connection */
 
-  for (i = 0; i < CONFIG_NET_TCP_CONNS; i++)
+  while ((conn = tcp_nextconn(conn)) != NULL)

Review comment:
       I think so! Also imagine a board connected to a Wi-Fi router, anyone in the same network could explore it.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a change in pull request #5104: net/tcp/udp: allocate tcp/udp connect dynamically

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on a change in pull request #5104:
URL: https://github.com/apache/incubator-nuttx/pull/5104#discussion_r776734912



##########
File path: net/tcp/tcp_conn.c
##########
@@ -110,15 +107,12 @@ static FAR struct tcp_conn_s *
   tcp_listener(uint8_t domain, FAR const union ip_addr_u *ipaddr,
                uint16_t portno)
 {
-  FAR struct tcp_conn_s *conn;
-  int i;
+  FAR struct tcp_conn_s *conn = NULL;
 
   /* Check if this port number is in use by any active UIP TCP connection */
 
-  for (i = 0; i < CONFIG_NET_TCP_CONNS; i++)
+  while ((conn = tcp_nextconn(conn)) != NULL)

Review comment:
       Should we protect DoS from the server level? Since it's hard to estimate a good value when multiple servers run at the same time. Also, many servers support limitation of the concurrent connection by default.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] davids5 commented on a change in pull request #5104: net/tcp/udp: allocate tcp/udp connect dynamically

Posted by GitBox <gi...@apache.org>.
davids5 commented on a change in pull request #5104:
URL: https://github.com/apache/incubator-nuttx/pull/5104#discussion_r777017992



##########
File path: net/Kconfig
##########
@@ -312,6 +312,15 @@ source "net/ipforward/Kconfig"
 
 endmenu # Internet Protocol Selection
 
+config NET_ALLOC_CONNS
+	bool "Allocate connect instance dynamically support"

Review comment:
       ```suggestion
   	bool "Allocate connect instance dynamically"
   ```

##########
File path: net/Kconfig
##########
@@ -312,6 +312,15 @@ source "net/ipforward/Kconfig"
 
 endmenu # Internet Protocol Selection
 
+config NET_ALLOC_CONNS
+	bool "Allocate connect instance dynamically support"
+	default n
+	---help---
+		Enable the function of Allocate connect instance dynamically.
+		If the connections can not be estimated, the stack will abandon
+		static pre-allocate connection entries, all connections will be
+		dynamically allocated from heap.
+

Review comment:
       Please reformat but use this wording. 

##########
File path: net/Kconfig
##########
@@ -312,6 +312,15 @@ source "net/ipforward/Kconfig"
 
 endmenu # Internet Protocol Selection
 
+config NET_ALLOC_CONNS
+	bool "Allocate connect instance dynamically support"
+	default n
+	---help---
+		Enable the function of Allocate connect instance dynamically.
+		If the connections can not be estimated, the stack will abandon
+		static pre-allocate connection entries, all connections will be
+		dynamically allocated from heap.
+

Review comment:
       ```suggestion
   		Enable to allocate connection instances dynamically.  
   		Use this feature if the number of connections can not be determined at 
   		compile time. When enabled the stack will be compiled without the static 
   		pre-allocate connection list and all connection instances will be dynamically 
   		allocated from heap at run time.
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 commented on pull request #5104: net/tcp/udp: allocate tcp/udp connect dynamically

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on pull request #5104:
URL: https://github.com/apache/incubator-nuttx/pull/5104#issuecomment-1003553339


   @anchao please make the similar change to other implementation


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] acassis commented on pull request #5104: net/tcp/udp: allocate tcp/udp connect dynamically

Posted by GitBox <gi...@apache.org>.
acassis commented on pull request #5104:
URL: https://github.com/apache/incubator-nuttx/pull/5104#issuecomment-1003045355


   I think dynamic allocation in the kernel makes NuttX more unpredictable for realtime applications. Maybe it could be dependent of some option like CONFIG_ALLOW_NON_RT_BEHAVIOR. What do you think?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] anchao edited a comment on pull request #5104: net/tcp/udp: allocate tcp/udp connect dynamically

Posted by GitBox <gi...@apache.org>.
anchao edited a comment on pull request #5104:
URL: https://github.com/apache/incubator-nuttx/pull/5104#issuecomment-1003079486


   How about adding an dynamic enable option? If dynamic allocate is enabled on the basis of the pre-allocation pool, 
   then we will allocate new connection instances from the heap.
   Of course, we will also add the maximum limit config to protect the system from malicious attacks.
   
   CONFIG_NET_DYNAMIC_CONNS
   CONFIG_NET_DYNAMIC_CONNS_PER_ALLOC
   CONFIG_NET_MAX_DYNAMIC_CONNS


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] anchao commented on pull request #5104: net/tcp/udp: allocate tcp/udp connect dynamically

Posted by GitBox <gi...@apache.org>.
anchao commented on pull request #5104:
URL: https://github.com/apache/incubator-nuttx/pull/5104#issuecomment-1003079486


   How about adding an dynamic enable option? If dynamic allocate is enabled on the basis of the pre-allocation pool, 
   then we will allocate new connection instances from the heap.
   Of course, we will also add the maximum limit config to protect the system from malicious attacks.
   
   CONFIG_NET_DYNAMIC_CONNS
   CONFIG_NET_MAX_DYNAMIC_CONNS


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] acassis commented on pull request #5104: net/tcp/udp: allocate tcp/udp connect dynamically

Posted by GitBox <gi...@apache.org>.
acassis commented on pull request #5104:
URL: https://github.com/apache/incubator-nuttx/pull/5104#issuecomment-1003117736


   > How about adding an dynamic enable option? If dynamic allocate is enabled on the basis of the pre-allocation pool, then we will allocate new connection instances from the heap. Of course, we will also add the maximum limit config to protect the system from malicious attacks.
   > 
   > CONFIG_NET_DYNAMIC_CONNS CONFIG_NET_DYNAMIC_CONNS_PER_ALLOC CONFIG_NET_MAX_DYNAMIC_CONNS
   
   Yes, seams a good approach!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a change in pull request #5104: net/tcp/udp: allocate tcp/udp connect dynamically

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on a change in pull request #5104:
URL: https://github.com/apache/incubator-nuttx/pull/5104#discussion_r776734912



##########
File path: net/tcp/tcp_conn.c
##########
@@ -110,15 +107,12 @@ static FAR struct tcp_conn_s *
   tcp_listener(uint8_t domain, FAR const union ip_addr_u *ipaddr,
                uint16_t portno)
 {
-  FAR struct tcp_conn_s *conn;
-  int i;
+  FAR struct tcp_conn_s *conn = NULL;
 
   /* Check if this port number is in use by any active UIP TCP connection */
 
-  for (i = 0; i < CONFIG_NET_TCP_CONNS; i++)
+  while ((conn = tcp_nextconn(conn)) != NULL)

Review comment:
       Should we protect DoS from the server level?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] anchao commented on pull request #5104: net/tcp/udp: allocate tcp/udp connect dynamically

Posted by GitBox <gi...@apache.org>.
anchao commented on pull request #5104:
URL: https://github.com/apache/incubator-nuttx/pull/5104#issuecomment-1003298938


   Update the request,  add new config about connec dynamic allocate:
   
   `CONFIG_NET_ALLOC_CONNS`
   
   if CONFIG_NET_ALLOC_CONNS is enabled, the static pre-applied connection entries will be disabled,
   all connections will be dynamically allocated from heap. about the maximum number of connections,
   we prepare implement the limitation from the VFS layer:
   
   ```
   _POSIX_OPEN_MAX
   RLIMIT_NOFILE
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a change in pull request #5104: net/tcp/udp: allocate tcp/udp connect dynamically

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on a change in pull request #5104:
URL: https://github.com/apache/incubator-nuttx/pull/5104#discussion_r776311207



##########
File path: net/tcp/tcp_conn.c
##########
@@ -110,15 +108,12 @@ static FAR struct tcp_conn_s *
   tcp_listener(uint8_t domain, FAR const union ip_addr_u *ipaddr,
                uint16_t portno)
 {
-  FAR struct tcp_conn_s *conn;
-  int i;
+  FAR struct tcp_conn_s *conn = NULL;

Review comment:
       don't need `= NULL;`

##########
File path: net/tcp/tcp_conn.c
##########
@@ -656,8 +677,6 @@ FAR struct tcp_conn_s *tcp_alloc(uint8_t domain)
     }
 #endif
 
-  net_unlock();

Review comment:
       let's move tcp_alloc_conn after net_unlock?

##########
File path: net/tcp/tcp_conn.c
##########
@@ -61,6 +61,8 @@
 #include <nuttx/net/ip.h>
 #include <nuttx/net/tcp.h>
 
+#include <nuttx/kmalloc.h>

Review comment:
       move before line 57




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] davids5 commented on a change in pull request #5104: net/tcp/udp: allocate tcp/udp connect dynamically

Posted by GitBox <gi...@apache.org>.
davids5 commented on a change in pull request #5104:
URL: https://github.com/apache/incubator-nuttx/pull/5104#discussion_r776336621



##########
File path: net/tcp/tcp_conn.c
##########
@@ -538,22 +570,10 @@ static inline int tcp_ipv6_bind(FAR struct tcp_conn_s *conn,
 
 void tcp_initialize(void)
 {
-  int i;
-
   /* Initialize the queues */
 
   dq_init(&g_free_tcp_connections);
   dq_init(&g_active_tcp_connections);
-
-  /* Now initialize each connection structure */
-
-  for (i = 0; i < CONFIG_NET_TCP_CONNS; i++)
-    {
-      /* Mark the connection closed and move it to the free list */
-
-      g_tcp_connections[i].tcpstateflags = TCP_CLOSED;

Review comment:
       Where is this functionality now?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a change in pull request #5104: net/tcp/udp: allocate tcp/udp connect dynamically

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on a change in pull request #5104:
URL: https://github.com/apache/incubator-nuttx/pull/5104#discussion_r776365570



##########
File path: net/tcp/Kconfig
##########
@@ -50,11 +50,11 @@ config NET_TCPURGDATA
 		compiled in. Urgent data (out-of-band data) is a rarely used TCP feature
 		that is very seldom would be required.
 
-config NET_TCP_CONNS
-	int "Number of TCP/IP connections"
-	default 8
+config NET_TCP_CONNS_PER_BLOCK
+	int "Number of TCP/IP connections per block(one for each open)"
+	default 4

Review comment:
       let's default to 1 when DEFAULT_SMALL is true

##########
File path: net/tcp/Kconfig
##########
@@ -50,11 +50,11 @@ config NET_TCPURGDATA
 		compiled in. Urgent data (out-of-band data) is a rarely used TCP feature
 		that is very seldom would be required.
 
-config NET_TCP_CONNS
-	int "Number of TCP/IP connections"
-	default 8
+config NET_TCP_CONNS_PER_BLOCK
+	int "Number of TCP/IP connections per block(one for each open)"
+	default 4
 	---help---
-		Maximum number of TCP/IP connections (all tasks)
+		Maximum number of TCP/IP connections per block(all tasks)

Review comment:
       The  number of TCP/IP connections per allocation(all tasks)

##########
File path: net/udp/Kconfig
##########
@@ -50,11 +50,11 @@ config NET_UDP_CHECKSUMS
 		Enable/disable UDP checksum support.  UDP checksum support is
 		REQUIRED for IPv6.
 
-config NET_UDP_CONNS
-	int "Number of UDP sockets"
-	default 8
+config NET_UDP_CONNS_PER_BLOCK
+	int "Number of UDP sockets per block(one for each open)"
+	default 4
 	---help---
-		The maximum amount of open concurrent UDP sockets
+		The maximum amount of open concurrent UDP sockets per block

Review comment:
       The amount of open concurrent UDP sockets per allocation

##########
File path: net/udp/udp_conn.c
##########
@@ -62,6 +62,8 @@
 #include <nuttx/net/ip.h>
 #include <nuttx/net/udp.h>
 
+#include <nuttx/kmalloc.h>

Review comment:
       move before nuttx/clock.h too

##########
File path: net/udp/Kconfig
##########
@@ -50,11 +50,11 @@ config NET_UDP_CHECKSUMS
 		Enable/disable UDP checksum support.  UDP checksum support is
 		REQUIRED for IPv6.
 
-config NET_UDP_CONNS
-	int "Number of UDP sockets"
-	default 8
+config NET_UDP_CONNS_PER_BLOCK
+	int "Number of UDP sockets per block(one for each open)"
+	default 4

Review comment:
       default to 1 in the small config




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] anchao commented on a change in pull request #5104: net/tcp/udp: allocate tcp/udp connect dynamically

Posted by GitBox <gi...@apache.org>.
anchao commented on a change in pull request #5104:
URL: https://github.com/apache/incubator-nuttx/pull/5104#discussion_r776466629



##########
File path: net/udp/Kconfig
##########
@@ -50,11 +50,12 @@ config NET_UDP_CHECKSUMS
 		Enable/disable UDP checksum support.  UDP checksum support is
 		REQUIRED for IPv6.
 
-config NET_UDP_CONNS
-	int "Number of UDP sockets"
-	default 8
+config NET_UDP_CONNS_PER_ALLOC
+	int "Number of UDP sockets per block(one for each open)"
+	default 1 if DEFAULT_SMALL
+	default 4
 	---help---
-		The maximum amount of open concurrent UDP sockets
+		The amount of open concurrent UDP sockets per allocation

Review comment:
       Done




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 commented on pull request #5104: net/tcp/udp: allocate tcp/udp connect dynamically

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on pull request #5104:
URL: https://github.com/apache/incubator-nuttx/pull/5104#issuecomment-1003050437


   > What's the motivation for allocating the resources dynamically? The decision for this type of change should consider an analysis of the tradeoffs.
   
   To support the complex system better, we have saw in a production system:
   
   1. Application or server may create more socket in some special case
   2. New version may create more socket and then old config stop working
   3. TIME_WAIT state in TCP make the situation even worse:
       http://www.serverframework.com/asynchronousevents/2011/01/time-wait-and-its-design-implications-for-protocols-and-scalable-servers.html
   
   Yes, it's a tradeoff, but dynamic allocation already exist inside socket API before this patch.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] anchao edited a comment on pull request #5104: net/tcp/udp: allocate tcp/udp connect dynamically

Posted by GitBox <gi...@apache.org>.
anchao edited a comment on pull request #5104:
URL: https://github.com/apache/incubator-nuttx/pull/5104#issuecomment-1003101975


   The current static configuration is no longer suitable for business situation, this is intention of pull request,
   In terms of real products, NuttX is not just running in simple IOT devices,
   we already have a demand for full-featured business terminal, We have online video/audio streaming services,
   stream transfer services, adb network bridges, high-level application networking services, etc.
   Most of the time we serve in an environment where the number of connections is unknown,
   For example if multicast or mesh network device as long as there is one more hardware device connected to our service in the local area network, the number of connections will increase by one. this is common scene of smart homes.
   
   We hope to find a balance to enhance the scalability of NuttX. In most cases, other developers will have similar situations.
   
   This connection information is dumped from Smart Speaker, the number of connections is still growing from application developers ...
   
   ```
    [TCP]                 LADDR    LPORT             RADDR      RPORT  RCVBUFS  SNDBUFS  SNDPEND  RCVPEND   RCVOOO
    TCP   [ 0]: [       127.0.0.1: 12904] -> [       127.0.0.1: 12903]    16384    16384        0        0        0
    TCP   [ 1]: [       127.0.0.1: 12903] -> [       127.0.0.1: 12904]    16384    16384        0        0        0
    TCP   [ 2]: [         0.0.0.0: 12905] -> [       127.0.0.1: 54322]    16384    16384        0        0        0
    TCP   [ 3]: [         0.0.0.0: 12906] -> [       127.0.0.1: 54323]    16384    16384        0        0        0
    TCP   [ 4]: [       127.0.0.1: 54322] -> [       127.0.0.1: 12905]    16384    16384        0        0        0
    TCP   [ 5]: [       127.0.0.1: 54323] -> [       127.0.0.1: 12906]    16384    16384        0        0        0
    TCP   [ 6]: [         0.0.0.0: 12908] -> [ ***************:   443]    16384    16384        0        0        0
    TCP   [ 7]: [         0.0.0.0: 12924] -> [ ***************:    80]    16384    16384        0        0        0
    TCP   [ 8]: [         0.0.0.0: 13689] -> [ ***************:    80]   131070    16384        0      541        0
    TCP   [ 9]: [         0.0.0.0: 13763] -> [ ***************:   443]    16384    16384        0        0      213
    TCP   [10]: [         0.0.0.0: 14322] -> [ ***************:   645]    16384    16384        0        0        0
    TCP   [11]: [         0.0.0.0: 14323] -> [ ***************:    80]   131070    16384        0        0        0
    TCP   [12]: [         0.0.0.0: 14633] -> [ ***************:   443]    16384    16384        0        0        0
    TCP   [13]: [         0.0.0.0: 14634] -> [ ***************:   443]    16384    16384        0        0        0
    TCP   [14]: [         0.0.0.0: 14711] -> [ ***************:    80]   131070    16384        0      123        0
    -----------------------
    [UDP]                 LADDR    LPORT             RADDR      RPORT  RCVBUFS  SNDBUFS  SNDPEND  RCVPEND
    UDP   [ 0] [         0.0.0.0: 54321] -> [ ***************:   443]:    16384    16384        0        0
    UDP   [ 1] [         0.0.0.0: 21355] -> [ ***************:  6666]:    16384    16384        0        0
    UDP   [ 2] [         0.0.0.0: 10010] -> [         0.0.0.0:     0]:    16384    16384        0        0
    UDP   [ 3] [         0.0.0.0: 21356] -> [   192.168.31.93: 29443]:   262144   262144        0        0
    UDP   [ 4] [         0.0.0.0: 21357] -> [ ***************: 10010]:    16384    16384        0        0
    UDP   [ 5] [         0.0.0.0: 21340] -> [   192.168.31.96: 29443]:    16384    16384        0        0
    UDP   [ 6] [         0.0.0.0: 21341] -> [ ***************: 10010]:    16384    16384        0        0
    UDP   [ 7] [         0.0.0.0: 21345] -> [  192.168.31.133: 29443]:    16384    16384        0        0
    UDP   [ 8] [         0.0.0.0: 21365] -> [ ***************:  6432]:    16384    16384        0        0
    UDP   [ 9] [         0.0.0.0: 21377] -> [  192.168.31.147: 29443]:   262144   262144        0        0
    UDP   [10] [         0.0.0.0: 21378] -> [ ***************:  7981]:    16384    16384        0        0
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] anchao edited a comment on pull request #5104: net/tcp/udp: allocate tcp/udp connect dynamically

Posted by GitBox <gi...@apache.org>.
anchao edited a comment on pull request #5104:
URL: https://github.com/apache/incubator-nuttx/pull/5104#issuecomment-1003298938


   Update the request,  add new config about connect dynamic allocate:
   
   `CONFIG_NET_ALLOC_CONNS`
   
   if CONFIG_NET_ALLOC_CONNS is enabled, the static pre-allocate connection entries will be disabled,
   all connections will be dynamically allocated from heap. about the maximum number of connections,
   we prepare implement the limitation from the VFS layer:
   
   ```
   _POSIX_OPEN_MAX
   RLIMIT_NOFILE
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] anchao commented on a change in pull request #5104: net/tcp/udp: allocate tcp/udp connect dynamically

Posted by GitBox <gi...@apache.org>.
anchao commented on a change in pull request #5104:
URL: https://github.com/apache/incubator-nuttx/pull/5104#discussion_r776451230



##########
File path: net/udp/Kconfig
##########
@@ -50,11 +50,11 @@ config NET_UDP_CHECKSUMS
 		Enable/disable UDP checksum support.  UDP checksum support is
 		REQUIRED for IPv6.
 
-config NET_UDP_CONNS
-	int "Number of UDP sockets"
-	default 8
+config NET_UDP_CONNS_PER_BLOCK
+	int "Number of UDP sockets per block(one for each open)"
+	default 4
 	---help---
-		The maximum amount of open concurrent UDP sockets
+		The maximum amount of open concurrent UDP sockets per block

Review comment:
       Done

##########
File path: net/udp/Kconfig
##########
@@ -50,11 +50,11 @@ config NET_UDP_CHECKSUMS
 		Enable/disable UDP checksum support.  UDP checksum support is
 		REQUIRED for IPv6.
 
-config NET_UDP_CONNS
-	int "Number of UDP sockets"
-	default 8
+config NET_UDP_CONNS_PER_BLOCK
+	int "Number of UDP sockets per block(one for each open)"
+	default 4

Review comment:
       Done

##########
File path: net/tcp/Kconfig
##########
@@ -50,11 +50,11 @@ config NET_TCPURGDATA
 		compiled in. Urgent data (out-of-band data) is a rarely used TCP feature
 		that is very seldom would be required.
 
-config NET_TCP_CONNS
-	int "Number of TCP/IP connections"
-	default 8
+config NET_TCP_CONNS_PER_BLOCK
+	int "Number of TCP/IP connections per block(one for each open)"
+	default 4
 	---help---
-		Maximum number of TCP/IP connections (all tasks)
+		Maximum number of TCP/IP connections per block(all tasks)

Review comment:
       Done

##########
File path: net/tcp/Kconfig
##########
@@ -50,11 +50,11 @@ config NET_TCPURGDATA
 		compiled in. Urgent data (out-of-band data) is a rarely used TCP feature
 		that is very seldom would be required.
 
-config NET_TCP_CONNS
-	int "Number of TCP/IP connections"
-	default 8
+config NET_TCP_CONNS_PER_BLOCK
+	int "Number of TCP/IP connections per block(one for each open)"
+	default 4

Review comment:
       Done

##########
File path: net/udp/udp_conn.c
##########
@@ -62,6 +62,8 @@
 #include <nuttx/net/ip.h>
 #include <nuttx/net/udp.h>
 
+#include <nuttx/kmalloc.h>

Review comment:
       Done




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org