You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2024/11/02 18:55:07 UTC

(nuttx) branch master updated: tcp:set NET_TCP_NPOLLWAITERS default value to 2 & add warning of different events having same event bit

This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new 807c3a16e3 tcp:set NET_TCP_NPOLLWAITERS default value to 2 & add warning of different events having same event bit
807c3a16e3 is described below

commit 807c3a16e3101531544807fd299f04a179804c41
Author: wangchen <wa...@xiaomi.com>
AuthorDate: Wed Dec 27 10:27:46 2023 +0800

    tcp:set NET_TCP_NPOLLWAITERS default value to 2 & add warning of different events having same event bit
    
    Signed-off-by: wangchen <wa...@xiaomi.com>
---
 net/tcp/Kconfig       | 2 +-
 net/tcp/tcp_netpoll.c | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/tcp/Kconfig b/net/tcp/Kconfig
index 8b4a2f0a90..fd2bcec121 100644
--- a/net/tcp/Kconfig
+++ b/net/tcp/Kconfig
@@ -99,7 +99,7 @@ config NET_TCP_MAX_CONNS
 
 config NET_TCP_NPOLLWAITERS
 	int "Number of TCP poll waiters"
-	default 1
+	default 2
 
 config NET_TCP_RTO
 	int "RTO of TCP/IP connections"
diff --git a/net/tcp/tcp_netpoll.c b/net/tcp/tcp_netpoll.c
index f31077bcf5..bbcd98b9fe 100644
--- a/net/tcp/tcp_netpoll.c
+++ b/net/tcp/tcp_netpoll.c
@@ -230,6 +230,7 @@ int tcp_pollsetup(FAR struct socket *psock, FAR struct pollfd *fds)
   info = conn->pollinfo;
   while (info->conn != NULL)
     {
+      DEBUGASSERT((fds->events & info->fds->events) != 0);
       if (++info >= &conn->pollinfo[CONFIG_NET_TCP_NPOLLWAITERS])
         {
           DEBUGPANIC();