Skip to content

Commit d7ee8b3

Browse files
rluboscfriedt
authored andcommitted
net: Deprecate CONFIG_NET_SOCKETS_POLL_MAX
CONFIG_ZVFS_POLL_MAX is now used to control the maximum number of poll() entires. Thereby, CONFIG_NET_SOCKETS_POLL_MAX is redundant and shall be deprecated. Modify the defaults for NET_SOCKETS_POLL_MAX and ZVS_POLL_MAX so that the deprecation actually makes sense instead of symbol removal. In case the application still sets the old config, it will modify the ZVS_POLL_MAX default. Signed-off-by: Robert Lubos <[email protected]> Signed-off-by: Chris Friedt <[email protected]>
1 parent 6af3acb commit d7ee8b3

File tree

41 files changed

+54
-52
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+54
-52
lines changed

doc/connectivity/networking/net_config_guide.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ Connection Options
8383
Socket Options
8484
**************
8585

86-
:kconfig:option:`CONFIG_NET_SOCKETS_POLL_MAX`
86+
:kconfig:option:`CONFIG_ZVFS_POLL_MAX`
8787
Maximum number of supported poll() entries. One needs to select proper value here depending
8888
on how many BSD sockets are polled in the system.
8989

doc/releases/migration-guide-4.0.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,9 @@ Networking
474474
* The ``work_q`` parameter to ``NET_SOCKET_SERVICE_SYNC_DEFINE`` and
475475
``NET_SOCKET_SERVICE_SYNC_DEFINE_STATIC`` has been removed as it was always ignored. (:github:`79446`)
476476

477+
* Deprecated the :kconfig:option:`CONFIG_NET_SOCKETS_POLL_MAX` option in favour of
478+
:kconfig:option:`CONFIG_ZVFS_POLL_MAX`.
479+
477480
Other Subsystems
478481
****************
479482

doc/services/portability/posix/kconfig/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ implementation of the POSIX API.
1717
* :kconfig:option:`CONFIG_MSG_SIZE_MAX`
1818
* :kconfig:option:`CONFIG_NET_SOCKETPAIR`
1919
* :kconfig:option:`CONFIG_NET_SOCKETS`
20-
* :kconfig:option:`CONFIG_NET_SOCKETS_POLL_MAX`
20+
* :kconfig:option:`CONFIG_ZVFS_POLL_MAX`
2121
* :kconfig:option:`CONFIG_ZVFS_OPEN_MAX`
2222
* :kconfig:option:`CONFIG_POSIX_API`
2323
* :kconfig:option:`CONFIG_POSIX_OPEN_MAX`

drivers/modem/modem_socket.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ int modem_socket_poll(struct modem_socket_config *cfg, struct zsock_pollfd *fds,
269269
int ret, i;
270270
uint8_t found_count = 0;
271271

272-
if (!cfg || nfds > CONFIG_NET_SOCKETS_POLL_MAX) {
272+
if (!cfg || nfds > CONFIG_ZVFS_POLL_MAX) {
273273
return -EINVAL;
274274
}
275275
struct k_poll_event events[nfds];

include/zephyr/net/dns_resolve.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,9 @@ enum dns_query_type {
141141
/** How many sockets the dispatcher is able to poll. */
142142
#define DNS_DISPATCHER_MAX_POLL (DNS_RESOLVER_MAX_POLL + MDNS_MAX_POLL + LLMNR_MAX_POLL)
143143

144-
#if defined(CONFIG_NET_SOCKETS_POLL_MAX)
145-
BUILD_ASSERT(CONFIG_NET_SOCKETS_POLL_MAX >= DNS_DISPATCHER_MAX_POLL,
146-
"CONFIG_NET_SOCKETS_POLL_MAX must be larger than " STRINGIFY(DNS_DISPATCHER_MAX_POLL));
144+
#if defined(CONFIG_ZVFS_POLL_MAX)
145+
BUILD_ASSERT(CONFIG_ZVFS_POLL_MAX >= DNS_DISPATCHER_MAX_POLL,
146+
"CONFIG_ZVFS_POLL_MAX must be larger than " STRINGIFY(DNS_DISPATCHER_MAX_POLL));
147147
#endif
148148

149149
/** @brief What is the type of the socket given to DNS socket dispatcher,

lib/os/zvfs/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ if ZVFS_POLL
4343

4444
config ZVFS_POLL_MAX
4545
int "Max number of supported zvfs_poll() entries"
46+
default NET_SOCKETS_POLL_MAX if NET_SOCKETS_POLL_MAX > 0
4647
default 6 if WIFI_NM_WPA_SUPPLICANT
4748
default 4 if SHELL_BACKEND_TELNET
4849
default 3

samples/net/cloud/tagoio_http_post/prj.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ CONFIG_NET_SHELL=y
1717

1818
# Sockets
1919
CONFIG_NET_SOCKETS=y
20-
CONFIG_NET_SOCKETS_POLL_MAX=4
20+
CONFIG_ZVFS_POLL_MAX=4
2121

2222
# Network driver config
2323
CONFIG_TEST_RANDOM_GENERATOR=y

samples/net/dns_resolve/prj.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ CONFIG_NET_IPV6=y
1414
CONFIG_NET_IPV4=y
1515
CONFIG_NET_DHCPV4=n
1616

17-
CONFIG_NET_SOCKETS_POLL_MAX=5
17+
CONFIG_ZVFS_POLL_MAX=5
1818
CONFIG_ZVFS_OPEN_MAX=5
1919

2020
# Enable the DNS resolver

samples/net/mdns_responder/prj.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ CONFIG_NET_IPV4=y
88
CONFIG_NET_IF_MAX_IPV6_COUNT=3
99
CONFIG_NET_IF_MAX_IPV4_COUNT=3
1010

11-
CONFIG_NET_SOCKETS_POLL_MAX=7
11+
CONFIG_ZVFS_POLL_MAX=7
1212

1313
CONFIG_NET_HOSTNAME_ENABLE=y
1414
CONFIG_NET_HOSTNAME_UNIQUE=n

samples/net/sockets/coap_client/prj.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ CONFIG_NET_IPV6=y
55
CONFIG_NET_UDP=y
66

77
CONFIG_NET_SOCKETS=y
8-
CONFIG_NET_SOCKETS_POLL_MAX=4
8+
CONFIG_ZVFS_POLL_MAX=4
99
CONFIG_POSIX_API=y
1010

1111
CONFIG_COAP=y

0 commit comments

Comments
 (0)