xiaoxiang781216 commented on code in PR #7525: URL: https://github.com/apache/nuttx/pull/7525#discussion_r1110653128
########## net/tcp/Kconfig: ########## @@ -50,11 +50,45 @@ 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" +config NET_TCP_PREALLOC_CONNS + int "Preallocated TCP/IP connections" default 8 ---help--- - Maximum number of TCP/IP connections (all tasks) + Number of TCP/IP connections (all tasks). + + This number of connections will be pre-allocated during system boot. + If dynamic connections allocation is enabled, more connections may + be allocated at a later time, as the system needs them. Else this + will be the maximum number of connections available to the system + at all times. + + Set to 0 to disable (and rely only on dynamic allocations). + +config NET_TCP_ALLOC_CONNS + int "Dynamic TCP/IP connections allocation" + default 0 + ---help--- + Dynamic memory allocations for TCP/IP. + + When set to 0 all dynamic allocations are disabled. + + When set to 1 a new connection will be allocated every time, + and it will be free'd when no longer needed. + + Setting this to 2 or more will allocate the connections in + batches (with batch size equal to this config). When a + connection is no longer needed, it will be returned to the + free connections pool, and it will never be deallocated! + +config NET_TCP_MAX_CONNS + int "Maximum number of TCP/IP connections" + default 0 Review Comment: add depends on NET_TCP_ALLOC_CONNS > 0 ########## net/bluetooth/Kconfig: ########## @@ -22,9 +22,45 @@ config NET_BLUETOOTH if NET_BLUETOOTH -config NET_BLUETOOTH_NCONNS - int "Max Bluetooth sockets" +config NET_BLUETOOTH_PREALLOC_CONNS + int "Preallocated Bluetooth sockets" default 4 + ---help--- + Number of Bluetooth connections (all tasks). + + This number of connections will be pre-allocated during system boot. + If dynamic connections allocation is enabled, more connections may + be allocated at a later time, as the system needs them. Else this + will be the maximum number of connections available to the system + at all times. + + Set to 0 to disable (and rely only on dynamic allocations). + +config NET_BLUETOOTH_ALLOC_CONNS + int "Dynamic Bluetooth connections allocation" + default 0 + ---help--- + Dynamic memory allocations for Bluetooth. + + When set to 0 all dynamic allocations are disabled. + + When set to 1 a new connection will be allocated every time, + and it will be free'd when no longer needed. + + Setting this to 2 or more will allocate the connections in + batches (with batch size equal to this config). When a + connection is no longer needed, it will be returned to the + free connections pool, and it will never be deallocated! + +config NET_BLUETOOTH_MAX_CONNS + int "Maximum number of Bluetooth connections" + default 0 Review Comment: ditto ########## net/netlink/Kconfig: ########## @@ -22,11 +22,45 @@ config NET_NETLINK if NET_NETLINK -config NETLINK_CONNS - int "Number of Netlink connections" +config NETLINK_PREALLOC_CONNS + int "Preallocated Netlink connections" default 4 ---help--- - Maximum number of Netlink connections (all tasks). + Number of Netlink connections (all tasks). + + This number of connections will be pre-allocated during system boot. + If dynamic connections allocation is enabled, more connections may + be allocated at a later time, as the system needs them. Else this + will be the maximum number of connections available to the system + at all times. + + Set to 0 to disable (and rely only on dynamic allocations). + +config NETLINK_ALLOC_CONNS + int "Dynamic Netlink connections allocation" + default 0 + ---help--- + Dynamic memory allocations for Netlink. + + When set to 0 all dynamic allocations are disabled. + + When set to 1 a new connection will be allocated every time, + and it will be free'd when no longer needed. + + Setting this to 2 or more will allocate the connections in + batches (with batch size equal to this config). When a + connection is no longer needed, it will be returned to the + free connections pool, and it will never be deallocated! + +config NETLINK_MAX_CONNS + int "Maximum number of Netlink connections" + default 0 Review Comment: ditto ########## net/can/Kconfig: ########## @@ -30,11 +30,45 @@ config NET_CAN_HAVE_ERRORS bool default n -config CAN_CONNS - int "Max number of CAN socket connections" +config CAN_PREALLOC_CONNS + int "Preallocated CAN socket connections" default 4 ---help--- - Maximum number of CAN connections (all tasks). + Number of CAN connections (all tasks). + + This number of connections will be pre-allocated during system boot. + If dynamic connections allocation is enabled, more connections may + be allocated at a later time, as the system needs them. Else this + will be the maximum number of connections available to the system + at all times. + + Set to 0 to disable (and rely only on dynamic allocations). + +config CAN_ALLOC_CONNS + int "Dynamic CAN connections allocation" + default 0 + ---help--- + Dynamic memory allocations for CAN. + + When set to 0 all dynamic allocations are disabled. + + When set to 1 a new connection will be allocated every time, + and it will be free'd when no longer needed. + + Setting this to 2 or more will allocate the connections in + batches (with batch size equal to this config). When a + connection is no longer needed, it will be returned to the + free connections pool, and it will never be deallocated! + +config CAN_MAX_CONNS + int "Maximum number of CAN connections" + default 0 Review Comment: ditto ########## net/icmp/Kconfig: ########## @@ -32,9 +32,45 @@ config NET_ICMP_SOCKET if NET_ICMP_SOCKET -config NET_ICMP_NCONNS - int "Max ICMP packet sockets" +config NET_ICMP_PREALLOC_CONNS + int "Preallocated ICMP packet sockets" default 4 + ---help--- + Number of ICMP connections (all tasks). + + This number of connections will be pre-allocated during system boot. + If dynamic connections allocation is enabled, more connections may + be allocated at a later time, as the system needs them. Else this + will be the maximum number of connections available to the system + at all times. + + Set to 0 to disable (and rely only on dynamic allocations). + +config NET_ICMP_ALLOC_CONNS + int "Dynamic ICMP connections allocation" + default 0 + ---help--- + Dynamic memory allocations for ICMP. + + When set to 0 all dynamic allocations are disabled. + + When set to 1 a new connection will be allocated every time, + and it will be free'd when no longer needed. + + Setting this to 2 or more will allocate the connections in + batches (with batch size equal to this config). When a + connection is no longer needed, it will be returned to the + free connections pool, and it will never be deallocated! + +config NET_ICMP_MAX_CONNS + int "Maximum number of ICMP connections" + default 0 Review Comment: add dependence too ########## include/nuttx/net/netconfig.h: ########## @@ -318,11 +318,11 @@ /* The maximum amount of concurrent UDP connection, Default: 10 */ -#ifndef CONFIG_NET_UDP_CONNS -# ifdef CONFIG_NET_UDP -# define CONFIG_NET_UDP_CONNS 10 +#ifndef CONFIG_NET_UDP_PREALLOC_CONNS Review Comment: let's remove too ########## net/udp/Kconfig: ########## @@ -36,11 +36,45 @@ 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" +config NET_UDP_PREALLOC_CONNS + int "Preallocated UDP sockets" default 8 ---help--- - The maximum amount of open concurrent UDP sockets + Number of UDP connections (all tasks). + + This number of connections will be pre-allocated during system boot. + If dynamic connections allocation is enabled, more connections may + be allocated at a later time, as the system needs them. Else this + will be the maximum number of connections available to the system + at all times. + + Set to 0 to disable (and rely only on dynamic allocations). + +config NET_UDP_ALLOC_CONNS + int "Dynamic UDP connections allocation" + default 0 + ---help--- + Dynamic memory allocations for UDP. + + When set to 0 all dynamic allocations are disabled. + + When set to 1 a new connection will be allocated every time, + and it will be free'd when no longer needed. + + Setting this to 2 or more will allocate the connections in + batches (with batch size equal to this config). When a + connection is no longer needed, it will be returned to the + free connections pool, and it will never be deallocated! + +config NET_UDP_MAX_CONNS + int "Maximum number of UDP connections" + default 0 Review Comment: add depends on NET_UDP_ALLOC_CONNS > 0 ########## include/nuttx/net/netconfig.h: ########## @@ -451,11 +451,11 @@ * connection requires approximately 30 bytes of memory. */ -#ifndef CONFIG_NET_TCP_CONNS -# ifdef CONFIG_NET_TCP -# define CONFIG_NET_TCP_CONNS 10 +#ifndef CONFIG_NET_TCP_PREALLOC_CONNS Review Comment: let's assume that CONFIG_NET_TCP_PREALLOC_CONNS is always defined and remove line 454 to 460, ########## net/usrsock/Kconfig: ########## @@ -25,15 +25,49 @@ config NET_USRSOCK if NET_USRSOCK -config NET_USRSOCK_CONNS - int "Number of usrsock connections" +config NET_USRSOCK_PREALLOC_CONNS + int "Preallocated usrsock connections" default 6 ---help--- - Maximum number of usrsock connections (all tasks). + Number of usrsock connections (all tasks). + + This number of connections will be pre-allocated during system boot. + If dynamic connections allocation is enabled, more connections may + be allocated at a later time, as the system needs them. Else this + will be the maximum number of connections available to the system + at all times. + + Set to 0 to disable (and rely only on dynamic allocations). Note: Usrsock daemon can impose additional restrictions for maximum number of concurrent connections supported. +config NET_USRSOCK_ALLOC_CONNS + int "Dynamic usrsock connections allocation" + default 0 + ---help--- + Dynamic memory allocations for usrsock. + + When set to 0 all dynamic allocations are disabled. + + When set to 1 a new connection will be allocated every time, + and it will be free'd when no longer needed. + + Setting this to 2 or more will allocate the connections in + batches (with batch size equal to this config). When a + connection is no longer needed, it will be returned to the + free connections pool, and it will never be deallocated! + +config NET_USRSOCK_MAX_CONNS + int "Maximum number of usrsock connections" + default 0 Review Comment: add dependence too ########## net/pkt/pkt_conn.c: ########## @@ -106,20 +106,30 @@ void pkt_initialize(void) FAR struct pkt_conn_s *pkt_alloc(void) { FAR struct pkt_conn_s *conn; -#ifdef CONFIG_NET_ALLOC_CONNS +#if CONFIG_NET_PKT_ALLOC_CONNS > 0 int i; #endif /* The free list is protected by a mutex. */ nxmutex_lock(&g_free_lock); -#ifdef CONFIG_NET_ALLOC_CONNS +#if CONFIG_NET_PKT_ALLOC_CONNS > 0 if (dq_peek(&g_free_pkt_connections) == NULL) { - conn = kmm_zalloc(sizeof(*conn) * CONFIG_NET_PKT_CONNS); +#if CONFIG_NET_PKT_MAX_CONNS > 0 + if (dq_count(&g_active_pkt_connections) + CONFIG_NET_PKT_ALLOC_CONNS + >= CONFIG_NET_PKT_MAX_CONNS) + { + nxmutex_unlock(&g_free_lock); + return NULL; + } +#endif + + conn = kmm_zalloc(sizeof(*conn) * CONFIG_NET_PKT_ALLOC_CONNS); + Review Comment: ditto ########## net/icmpv6/Kconfig: ########## @@ -200,9 +200,45 @@ endif # NET_ICMPv6_ROUTER if NET_ICMPv6_SOCKET -config NET_ICMPv6_NCONNS - int "Max ICMPv6 packet sockets" +config NET_ICMPv6_PREALLOC_CONNS + int "Preallocated ICMPv6 packet sockets" default 4 + ---help--- + Number of ICMPv6 connections (all tasks). + + This number of connections will be pre-allocated during system boot. + If dynamic connections allocation is enabled, more connections may + be allocated at a later time, as the system needs them. Else this + will be the maximum number of connections available to the system + at all times. + + Set to 0 to disable (and rely only on dynamic allocations). + +config NET_ICMPv6_ALLOC_CONNS + int "Dynamic ICMPv6 connections allocation" + default 0 + ---help--- + Dynamic memory allocations for ICMPv6. + + When set to 0 all dynamic allocations are disabled. + + When set to 1 a new connection will be allocated every time, + and it will be free'd when no longer needed. + + Setting this to 2 or more will allocate the connections in + batches (with batch size equal to this config). When a + connection is no longer needed, it will be returned to the + free connections pool, and it will never be deallocated! + +config NET_ICMPv6_MAX_CONNS + int "Maximum number of ICMPv6 connections" + default 0 Review Comment: ditto ########## net/pkt/Kconfig: ########## @@ -22,9 +22,45 @@ config NET_PKT if NET_PKT -config NET_PKT_CONNS - int "Max packet sockets" +config NET_PKT_PREALLOC_CONNS + int "Preallocated packet sockets" default 1 + ---help--- + Number of packet connections (all tasks). + + This number of connections will be pre-allocated during system boot. + If dynamic connections allocation is enabled, more connections may + be allocated at a later time, as the system needs them. Else this + will be the maximum number of connections available to the system + at all times. + + Set to 0 to disable (and rely only on dynamic allocations). + +config NET_PKT_ALLOC_CONNS + int "Dynamic packet connections allocation" + default 0 + ---help--- + Dynamic memory allocations for packet sockets. + + When set to 0 all dynamic allocations are disabled. + + When set to 1 a new connection will be allocated every time, + and it will be free'd when no longer needed. + + Setting this to 2 or more will allocate the connections in + batches (with batch size equal to this config). When a + connection is no longer needed, it will be returned to the + free connections pool, and it will never be deallocated! + +config NET_PKT_MAX_CONNS + int "Maximum number of packet connections" + default 0 Review Comment: ditto ########## include/nuttx/net/netconfig.h: ########## @@ -316,16 +316,6 @@ /* UDP configuration options */ -/* The maximum amount of concurrent UDP connection, Default: 10 */ - -#ifndef CONFIG_NET_UDP_PREALLOC_CONNS Review Comment: move to udp patch ########## net/ieee802154/Kconfig: ########## @@ -33,9 +33,45 @@ config NET_IEEE802154_FRAMELEN This setting is currently used only for detection data transfers that would exceed the radio frame length. -config NET_IEEE802154_NCONNS - int "Max IEEE 802.15.4 sockets" +config NET_IEEE802154_PREALLOC_CONNS + int "Preallocated IEEE 802.15.4 sockets" default 4 + ---help--- + Number of IEEE 802.15.4 connections (all tasks). + + This number of connections will be pre-allocated during system boot. + If dynamic connections allocation is enabled, more connections may + be allocated at a later time, as the system needs them. Else this + will be the maximum number of connections available to the system + at all times. + + Set to 0 to disable (and rely only on dynamic allocations). + +config NET_IEEE802154_ALLOC_CONNS + int "Dynamic IEEE 802.15.4 connections allocation" + default 0 + ---help--- + Dynamic memory allocations for IEEE 802.15.4. + + When set to 0 all dynamic allocations are disabled. + + When set to 1 a new connection will be allocated every time, + and it will be free'd when no longer needed. + + Setting this to 2 or more will allocate the connections in + batches (with batch size equal to this config). When a + connection is no longer needed, it will be returned to the + free connections pool, and it will never be deallocated! + +config NET_IEEE802154_MAX_CONNS + int "Maximum number of IEEE 802.15.4 connections" + default 0 Review Comment: ditto ########## include/nuttx/net/netconfig.h: ########## @@ -444,21 +434,6 @@ /* TCP configuration options */ -/* The maximum number of simultaneously open TCP connections. Review Comment: move to tcp patch ########## net/devif/devif_callback.c: ########## @@ -43,8 +43,8 @@ * Private Data ****************************************************************************/ -#ifndef CONFIG_NET_ALLOC_CONNS -static struct devif_callback_s g_cbprealloc[CONFIG_NET_NACTIVESOCKETS]; +#if CONFIG_NET_PREALLOC_SOCKETS > 0 Review Comment: should we change NET_PREALLOC_SOCKETS to NET_PREALLOC_CALLBACK or NET_PREALLOC_DEVIF_CALLBACK? ########## net/can/can_conn.c: ########## @@ -101,20 +101,30 @@ void can_initialize(void) FAR struct can_conn_s *can_alloc(void) { FAR struct can_conn_s *conn; -#ifdef CONFIG_NET_ALLOC_CONNS +#if CONFIG_CAN_ALLOC_CONNS > 0 int i; #endif /* The free list is protected by a a mutex. */ nxmutex_lock(&g_free_lock); -#ifdef CONFIG_NET_ALLOC_CONNS +#if CONFIG_CAN_ALLOC_CONNS > 0 if (dq_peek(&g_free_can_connections) == NULL) { - conn = kmm_zalloc(sizeof(*conn) * CONFIG_CAN_CONNS); +#if CONFIG_CAN_MAX_CONNS > 0 + if (dq_count(&g_active_can_connections) + CONFIG_CAN_ALLOC_CONNS + >= CONFIG_CAN_MAX_CONNS) + { + nxmutex_unlock(&g_free_lock); + return NULL; + } +#endif + + conn = kmm_zalloc(sizeof(*conn) * CONFIG_CAN_ALLOC_CONNS); + Review Comment: remove the blank line ########## net/ieee802154/ieee802154_conn.c: ########## @@ -107,20 +107,31 @@ void ieee802154_conn_initialize(void) FAR struct ieee802154_conn_s *ieee802154_conn_alloc(void) { FAR struct ieee802154_conn_s *conn; -#ifdef CONFIG_NET_ALLOC_CONNS +#if CONFIG_NET_IEEE802154_ALLOC_CONNS > 0 int i; #endif /* The free list is protected by the network lock. */ net_lock(); -#ifdef CONFIG_NET_ALLOC_CONNS +#if CONFIG_NET_IEEE802154_ALLOC_CONNS > 0 if (dq_peek(&g_free_ieee802154_connections) == NULL) { - conn = kmm_zalloc(sizeof(*conn) * CONFIG_NET_IEEE802154_NCONNS); +#if CONFIG_NET_IEEE802154_MAX_CONNS > 0 + if (dq_count(&g_active_ieee802154_connections) + + CONFIG_NET_IEEE802154_ALLOC_CONNS + >= CONFIG_NET_IEEE802154_MAX_CONNS) + { + net_unlock(); + return NULL; + } +#endif + + conn = kmm_zalloc(sizeof(*conn) * CONFIG_NET_IEEE802154_ALLOC_CONNS); + Review Comment: ditto ########## net/netlink/netlink_conn.c: ########## @@ -131,20 +132,30 @@ void netlink_initialize(void) FAR struct netlink_conn_s *netlink_alloc(void) { FAR struct netlink_conn_s *conn; -#ifdef CONFIG_NET_ALLOC_CONNS +#if CONFIG_NETLINK_ALLOC_CONNS > 0 int i; #endif /* The free list is protected by a mutex. */ nxmutex_lock(&g_free_lock); -#ifdef CONFIG_NET_ALLOC_CONNS +#if CONFIG_NETLINK_ALLOC_CONNS > 0 if (dq_peek(&g_free_netlink_connections) == NULL) { - conn = kmm_zalloc(sizeof(*conn) * CONFIG_NETLINK_CONNS); +#if CONFIG_NETLINK_MAX_CONNS > 0 + if (dq_count(&g_active_netlink_connections) + + CONFIG_NETLINK_ALLOC_CONNS >= CONFIG_NETLINK_MAX_CONNS) + { + nxmutex_unlock(&g_free_lock); + return NULL; + } +#endif + + conn = kmm_zalloc(sizeof(*conn) * CONFIG_NETLINK_ALLOC_CONNS); + Review Comment: remove the blank line ########## net/bluetooth/bluetooth_conn.c: ########## @@ -113,20 +113,30 @@ void bluetooth_conn_initialize(void) FAR struct bluetooth_conn_s *bluetooth_conn_alloc(void) { FAR struct bluetooth_conn_s *conn; -#ifdef CONFIG_NET_ALLOC_CONNS +#if CONFIG_NET_BLUETOOTH_ALLOC_CONNS > 0 int i; #endif /* The free list is protected by the network lock */ net_lock(); -#ifdef CONFIG_NET_ALLOC_CONNS +#if CONFIG_NET_BLUETOOTH_ALLOC_CONNS > 0 if (dq_peek(&g_active_bluetooth_connections) == NULL) { - conn = kmm_zalloc(sizeof(*conn) * CONFIG_NET_BLUETOOTH_NCONNS); +#if CONFIG_NET_BLUETOOTH_MAX_CONNS > 0 + if (dq_count(&g_active_bluetooth_connections) + + CONFIG_NET_BLUETOOTH_ALLOC_CONNS >= CONFIG_NET_BLUETOOTH_MAX_CONNS) + { + net_unlock(); + return NULL; + } +#endif + + conn = kmm_zalloc(sizeof(*conn) * CONFIG_NET_BLUETOOTH_ALLOC_CONNS); + Review Comment: ditto ########## net/icmpv6/icmpv6_conn.c: ########## @@ -109,13 +110,23 @@ FAR struct icmpv6_conn_s *icmpv6_alloc(void) ret = nxmutex_lock(&g_free_lock); if (ret >= 0) { -#ifdef CONFIG_NET_ALLOC_CONNS +#if CONFIG_NET_ICMPv6_ALLOC_CONNS > 0 if (dq_peek(&g_active_icmpv6_connections) == NULL) { - conn = kmm_zalloc(sizeof(*conn) * CONFIG_NET_ICMPv6_NCONNS); +#if CONFIG_NET_ICMPv6_MAX_CONNS > 0 + if (dq_count(&g_active_icmpv6_connections) + + CONFIG_NET_ICMPv6_ALLOC_CONNS >= CONFIG_NET_ICMPv6_MAX_CONNS) + { + nxmutex_unlock(&g_free_lock); + return NULL; + } +#endif + + conn = kmm_zalloc(sizeof(*conn) * CONFIG_NET_ICMPv6_ALLOC_CONNS); + Review Comment: ditto ########## net/icmp/icmp_conn.c: ########## @@ -109,13 +109,23 @@ FAR struct icmp_conn_s *icmp_alloc(void) ret = nxmutex_lock(&g_free_lock); if (ret >= 0) { -#ifdef CONFIG_NET_ALLOC_CONNS +#if CONFIG_NET_ICMP_ALLOC_CONNS > 0 if (dq_peek(&g_free_icmp_connections) == NULL) { - conn = kmm_zalloc(sizeof(*conn) * CONFIG_NET_ICMP_NCONNS); +#if CONFIG_NET_ICMP_MAX_CONNS > 0 + if (dq_count(&g_active_icmp_connections) + + CONFIG_NET_ICMP_ALLOC_CONNS >= CONFIG_NET_ICMP_MAX_CONNS) + { + nxmutex_unlock(&g_free_lock); + return NULL; + } +#endif + + conn = kmm_zalloc(sizeof(*conn) * CONFIG_NET_ICMP_ALLOC_CONNS); + Review Comment: ditto ########## net/usrsock/usrsock_conn.c: ########## @@ -77,20 +78,30 @@ static dq_queue_t g_active_usrsock_connections; FAR struct usrsock_conn_s *usrsock_alloc(void) { FAR struct usrsock_conn_s *conn; -#ifdef CONFIG_NET_ALLOC_CONNS +#if CONFIG_NET_USRSOCK_ALLOC_CONNS > 0 int i; #endif /* The free list is protected by a a mutex. */ nxmutex_lock(&g_free_lock); -#ifdef CONFIG_NET_ALLOC_CONNS +#if CONFIG_NET_USRSOCK_ALLOC_CONNS > 0 if (dq_peek(&g_free_usrsock_connections) == NULL) { - conn = kmm_zalloc(sizeof(*conn) * CONFIG_NET_USRSOCK_CONNS); +#if CONFIG_NET_USRSOCK_MAX_CONNS > 0 + if (dq_count(&g_active_usrsock_connections) + + CONFIG_NET_USRSOCK_ALLOC_CONNS >= CONFIG_NET_USRSOCK_MAX_CONNS) + { + nxmutex_unlock(&g_free_lock); + return NULL; + } +#endif + + conn = kmm_zalloc(sizeof(*conn) * CONFIG_NET_USRSOCK_ALLOC_CONNS); + Review Comment: ditto ########## net/tcp/tcp_conn.c: ########## @@ -449,16 +449,25 @@ FAR struct tcp_conn_s *tcp_alloc_conn(void) if (dq_peek(&g_free_tcp_connections) == NULL) { +#if CONFIG_NET_TCP_MAX_CONNS > 0 + if (dq_count(&g_active_tcp_connections) + CONFIG_NET_TCP_ALLOC_CONNS + >= CONFIG_NET_TCP_MAX_CONNS) + { + return NULL; + } +#endif + conn = kmm_zalloc(sizeof(struct tcp_conn_s) * - CONFIG_NET_TCP_CONNS); + CONFIG_NET_TCP_ALLOC_CONNS); + Review Comment: remove the blank line ########## net/udp/udp_conn.c: ########## @@ -472,16 +472,25 @@ FAR struct udp_conn_s *udp_alloc_conn(void) if (dq_peek(&g_free_udp_connections) == NULL) { +#if CONFIG_NET_UDP_MAX_CONNS > 0 + if (dq_count(&g_active_udp_connections) + CONFIG_NET_UDP_ALLOC_CONNS + >= CONFIG_NET_UDP_MAX_CONNS) + { + return NULL; + } +#endif + conn = kmm_zalloc(sizeof(struct udp_conn_s) * - CONFIG_NET_UDP_CONNS); + CONFIG_NET_UDP_ALLOC_CONNS); + Review Comment: remove the blank line -- 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-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org