From patchwork Tue Mar 31 12:34:20 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Timothy Redaelli X-Patchwork-Id: 2218112 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=bvA2SuAn; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=2605:bc80:3010::137; helo=smtp4.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=patchwork.ozlabs.org) Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) (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 4flSHs543wz1yCp for ; Tue, 31 Mar 2026 23:35:05 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 6BB8F40426; Tue, 31 Mar 2026 12:34:58 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id VLo1C7DqCwYg; Tue, 31 Mar 2026 12:34:57 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=2605:bc80:3010:104::8cd3:938; helo=lists.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 5E8E5401F7 Authentication-Results: smtp4.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=bvA2SuAn Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp4.osuosl.org (Postfix) with ESMTPS id 5E8E5401F7; Tue, 31 Mar 2026 12:34:57 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 17F10C054A; Tue, 31 Mar 2026 12:34:57 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) by lists.linuxfoundation.org (Postfix) with ESMTP id A2AFEC0549 for ; Tue, 31 Mar 2026 12:34:55 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 803E3807C2 for ; Tue, 31 Mar 2026 12:34:55 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id OTp_YfVGn_HJ for ; Tue, 31 Mar 2026 12:34:54 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=170.10.133.124; helo=us-smtp-delivery-124.mimecast.com; envelope-from=tredaelli@redhat.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp1.osuosl.org 56ECF80786 Authentication-Results: smtp1.osuosl.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 56ECF80786 Authentication-Results: smtp1.osuosl.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=bvA2SuAn Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by smtp1.osuosl.org (Postfix) with ESMTPS id 56ECF80786 for ; Tue, 31 Mar 2026 12:34:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1774960492; 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; bh=wy/uYKuG3N1Qrn1BBDLo6vwO2a6OkjMgVbgUuC0cA3w=; b=bvA2SuAnmDzl773qYTPM8lMEY3CKYGrw3AOrMoRxNvwjMOgfq0Z3btQv2XoxOijgaoLb1p o9WCqNZJoCtJjWdasKngyAGJUjlGt7s2Jrw2Xro9JXWtuepoJ0ovgdnsSM/Eae3/OknwEM W1UrGzn2lTDB0IiOqL54lPBoIItZhw0= Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-104-FXmAWcGdP9SIebgTZGbkcg-1; Tue, 31 Mar 2026 08:34:51 -0400 X-MC-Unique: FXmAWcGdP9SIebgTZGbkcg-1 X-Mimecast-MFC-AGG-ID: FXmAWcGdP9SIebgTZGbkcg_1774960490 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 54A9418005B4 for ; Tue, 31 Mar 2026 12:34:50 +0000 (UTC) Received: from aldebaran.char-dominant.ts.net (unknown [10.44.32.65]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 5DCF019560AB; Tue, 31 Mar 2026 12:34:49 +0000 (UTC) To: dev@openvswitch.org Date: Tue, 31 Mar 2026 14:34:20 +0200 Message-ID: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: N7Y6kAIbSrJLXP4zBfAb0R4GTd1oOhIQTaX9RoPbDN4_1774960490 X-Mimecast-Originator: redhat.com Subject: [ovs-dev] [PATCH v2 0/5] Add systemd socket activation for ovsdb-server X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Timothy Redaelli via dev From: Timothy Redaelli Reply-To: Timothy Redaelli Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" Currently ovsdb-server creates its own Unix domain socket at /run/openvswitch/db.sock, and dependent services need explicit ordering and assertion checks to ensure the socket is available. This series transfers socket ownership to systemd, which creates the listening socket before any service starts. The socket remains available across service restarts, so clients queue instead of getting connection failures. Changes since v1: - stream: Use str_to_long() instead of strtol(); return EINVAL instead of ERANGE on invalid fd number (Aaron Conole). - ovs-ctl: Also unset LISTEN_PIDFDID when clearing socket activation environment variables (Aaron Conole). Timothy Redaelli (5): stream: Add "pfd:" passive stream for pre-opened file descriptors. ovs-ctl: Detect systemd socket activation. rhel: Add ovsdb-server.socket unit for systemd socket activation. debian: Add ovsdb-server.socket unit for systemd socket activation. tests: Add pfd stream tests. Documentation/ref/ovsdb.7.rst | 12 + debian/automake.mk | 1 + debian/openvswitch-switch.install | 1 + .../openvswitch-switch.ovs-vswitchd.service | 5 +- .../openvswitch-switch.ovsdb-server.service | 1 + debian/openvswitch-switch.ovsdb-server.socket | 11 + lib/stream-provider.h | 1 + lib/stream-unix.c | 52 ++++ lib/stream.c | 5 + ovsdb/ovsdb-server.c | 23 +- rhel/automake.mk | 1 + rhel/openvswitch-fedora.spec.in | 4 + ..._system_ovs-delete-transient-ports.service | 3 +- ...lib_systemd_system_ovs-vswitchd.service.in | 5 +- ...sr_lib_systemd_system_ovsdb-server.service | 1 + ...usr_lib_systemd_system_ovsdb-server.socket | 17 ++ tests/automake.mk | 1 + tests/pfd-stream.at | 248 ++++++++++++++++++ tests/testsuite.at | 1 + utilities/ovs-ctl.in | 8 +- 20 files changed, 391 insertions(+), 10 deletions(-) create mode 100644 debian/openvswitch-switch.ovsdb-server.socket create mode 100644 rhel/usr_lib_systemd_system_ovsdb-server.socket create mode 100644 tests/pfd-stream.at