diff mbox series

[ovs-dev,v2,1/4] Use listen backlog = 64 for all connections

Message ID 20231118010703.4154866-2-ihrachys@redhat.com
State Changes Requested
Delegated to: Simon Horman
Headers show
Series Improve unixctl AF_UNIX backlog handling | expand

Checks

Context Check Description
ovsrobot/apply-robot warning apply and check: warning
ovsrobot/github-robot-_Build_and_Test success github build: passed
ovsrobot/intel-ovs-compilation success test: success

Commit Message

Ihar Hrachyshka Nov. 18, 2023, 1:07 a.m. UTC
Before the patch, the size of the backlog depended on the type of socket
(UNIX vs INET) as well as on the language (C vs Python), specifically:

- python used backlog size = 10 for all sockets;
- C used 64 for UNIX sockets but 10 for INET sockets.

This consolidates the values across the board. It effectively bumps the
number of simultaneous connections to python unixctl servers to 64. Also
for INET C servers too.

Signed-off-by: Ihar Hrachyshka <ihrachys@redhat.com>
---
 lib/socket-util.c    | 2 +-
 python/ovs/stream.py | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/lib/socket-util.c b/lib/socket-util.c
index 3eb3a3816..2d89fce85 100644
--- a/lib/socket-util.c
+++ b/lib/socket-util.c
@@ -760,7 +760,7 @@  inet_open_passive(int style, const char *target, int default_port,
     }
 
     /* Listen. */
-    if (style == SOCK_STREAM && listen(fd, 10) < 0) {
+    if (style == SOCK_STREAM && listen(fd, 64) < 0) {
         error = sock_errno();
         VLOG_ERR("%s: listen: %s", target, sock_strerror(error));
         goto error;
diff --git a/python/ovs/stream.py b/python/ovs/stream.py
index 82fbb0d68..dbb6b2e1f 100644
--- a/python/ovs/stream.py
+++ b/python/ovs/stream.py
@@ -620,7 +620,7 @@  class PassiveStream(object):
             raise Exception('Unknown connection string')
 
         try:
-            sock.listen(10)
+            sock.listen(64)
         except socket.error as e:
             vlog.err("%s: listen: %s" % (name, os.strerror(e.error)))
             sock.close()