From patchwork Sat Nov 18 01:07:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ihar Hrachyshka X-Patchwork-Id: 1865343 X-Patchwork-Delegate: horms@verge.net.au Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=bz+Qof34; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=2605:bc80:3010::136; helo=smtp3.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=patchwork.ozlabs.org) Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4SXFx55GDBz1yRb for ; Sat, 18 Nov 2023 12:07:21 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 8715561367; Sat, 18 Nov 2023 01:07:18 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 8715561367 Authentication-Results: smtp3.osuosl.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=bz+Qof34 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 31Q23CW8w2yK; Sat, 18 Nov 2023 01:07:17 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp3.osuosl.org (Postfix) with ESMTPS id 9928160BEC; Sat, 18 Nov 2023 01:07:16 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 9928160BEC Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 8B8D4C0DD3; Sat, 18 Nov 2023 01:07:15 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by lists.linuxfoundation.org (Postfix) with ESMTP id 0D7C3C0DD2 for ; Sat, 18 Nov 2023 01:07:15 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id D047060C10 for ; Sat, 18 Nov 2023 01:07:14 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org D047060C10 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id NHUgrBjEQbi0 for ; Sat, 18 Nov 2023 01:07:12 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by smtp3.osuosl.org (Postfix) with ESMTPS id AE0F360BD4 for ; Sat, 18 Nov 2023 01:07:12 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org AE0F360BD4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1700269631; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=wIAtlRYjuLStpSA8py51CnoY79zYr7C+0qM80WmB9qI=; b=bz+Qof34PAtCHi2nXL4rbnDcmzfd3CpwlAa1RL5CbW1gKKbds2TJrKa7Z3I5N5OBTcL/at WESbZFoqi1dbJP06eShBhVQ9jeC7dkhYRutwvYYHiTVLbzNNI3zFYI8gc4RqT4ehMIFAGi L3JmVX7spRkVkvD1H/0twjGFBZJEp8g= Received: from mail-qt1-f198.google.com (mail-qt1-f198.google.com [209.85.160.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-452-vEv9m7ydOdKcZD9PwbjFqA-1; Fri, 17 Nov 2023 20:07:10 -0500 X-MC-Unique: vEv9m7ydOdKcZD9PwbjFqA-1 Received: by mail-qt1-f198.google.com with SMTP id d75a77b69052e-41cca916954so31234041cf.2 for ; Fri, 17 Nov 2023 17:07:10 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700269629; x=1700874429; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wIAtlRYjuLStpSA8py51CnoY79zYr7C+0qM80WmB9qI=; b=tm1brYPw8mzUjmj4uC3k2KzrJAzeq2NMqe5SGr/dupg5LDQln/Sv+9nqs8mhFY6dtV cNyoWdOMFZkrLmvBU2QYSgqh5PBjchjVd45+OktvStAbEXfiZEMLc0UwTEIwrRBHQlDq cqGb1JkHPvB6qVAs7IuJY7bQJcV8NO/JeNbmhnhc91pWF6oEGEkNsqydLSEuEufcomWO 7s1U8q5udUjZ/KP1UdmDMnbVGHf1AIm8vQM2CFJgqnt9P4n2VVxmdj8WA262dZgkl4m4 kLuEZjGFGpevGA2TNTWgPulMJ5gXc1xKAAPOfgbEWbyMAqOt63JUdylVMwanr1HT7nmv j5KA== X-Gm-Message-State: AOJu0YzTPVxlkybqjdU4od+Eu+ZWOi/WzOf/8+4ReUqsRlRbj0sIbcl9 LJHHELCr+tbsJ5LePEITW5rJ4UZWJUoVvh73cg1GodLAXtTs3jponw23iH+LpGl+aHmE0igRQ7H yfdJ2cZPhafvdlqLwa1BC/cGcwjYXtcZXsGPJI8LIhmAlvPQv7Z7cI0nXySfpzvBqcU9gJ1ks X-Received: by 2002:a05:622a:13cc:b0:41e:415c:728f with SMTP id p12-20020a05622a13cc00b0041e415c728fmr1531076qtk.38.1700269628847; Fri, 17 Nov 2023 17:07:08 -0800 (PST) X-Google-Smtp-Source: AGHT+IGTUniCTbOGZvprrygGg6kPBXHFRcJ8/GJEgLOD2/1mhQYB6OIlva0EztmCUIg73KeeQULxSA== X-Received: by 2002:a05:622a:13cc:b0:41e:415c:728f with SMTP id p12-20020a05622a13cc00b0041e415c728fmr1531048qtk.38.1700269628280; Fri, 17 Nov 2023 17:07:08 -0800 (PST) Received: from fedora38.localdomain.com (cpe-172-73-180-250.carolina.res.rr.com. [172.73.180.250]) by smtp.gmail.com with ESMTPSA id b3-20020ac86783000000b004196a813639sm965694qtp.17.2023.11.17.17.07.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Nov 2023 17:07:06 -0800 (PST) From: Ihar Hrachyshka To: dev@openvswitch.org Date: Sat, 18 Nov 2023 01:07:00 +0000 Message-ID: <20231118010703.4154866-2-ihrachys@redhat.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231118010703.4154866-1-ihrachys@redhat.com> References: <20231118010703.4154866-1-ihrachys@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [ovs-dev] [PATCH v2 1/4] Use listen backlog = 64 for all connections X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" 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 --- lib/socket-util.c | 2 +- python/ovs/stream.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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()