From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: passt.top; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=LT5HG8uz; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by passt.top (Postfix) with ESMTPS id 2C6DD5A026E for ; Fri, 31 Jul 2026 18:46:35 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1785516394; 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=Yr0RznfrfZ69hrOc0KAu1twP6b7rM6F34IEAKT2Eca8=; b=LT5HG8uzK1lzsULoWssPUiBzdp5DHgm6fReIBSPyxnBb8RKfG0r2u4FB0kSxINZmEizrw4 tolK/9N78X+mIdeus9EiPQdYvkZpWJ0i4Nf/suvSVt5aFGvYdDR/8B0IXyTAcfHMYfSJcs zzbK1WDlUU/gsupl3s7s+bCGOKQczvw= 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-498-lNNnb-aTPaWR50ePl2r_AA-1; Fri, 31 Jul 2026 12:46:31 -0400 X-MC-Unique: lNNnb-aTPaWR50ePl2r_AA-1 X-Mimecast-MFC-AGG-ID: lNNnb-aTPaWR50ePl2r_AA_1785516390 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (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 8BDB018004BB for ; Fri, 31 Jul 2026 16:46:30 +0000 (UTC) Received: from lenovo-t14s.redhat.corp (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id C9D7341C; Fri, 31 Jul 2026 16:46:29 +0000 (UTC) From: Laurent Vivier To: passt-dev@passt.top Subject: [PATCH 0/7] multithreading: Add worker threads for queue pair processing Date: Fri, 31 Jul 2026 18:46:21 +0200 Message-ID: <20260731164628.3556997-1-lvivier@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: 40P0R3e_tV7_ahlf8E3uMqTg8YY2LcRRYB5KSlpIazw_1785516390 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Message-ID-Hash: JWQI7T2CHBGFCQKFQUBTTHW72CCKZ6OC X-Message-ID-Hash: JWQI7T2CHBGFCQKFQUBTTHW72CCKZ6OC X-MailFrom: lvivier@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Laurent Vivier X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: NOTE: This series has known stability issues (hangs and crashes under load) and is submitted for reference and testing purposes. This series adds pthread-based worker threads to enable parallel processing of queue pairs in vhost-user mode. Each queue pair gets its own worker thread with a dedicated epollfd. Thread 0 handles control events (listen sockets, vhost-user commands, repair, netlink) plus queue pair 0. Threads 1-15 handle only their assigned queue pair events. Threads start/stop dynamically via SET_VRING_ENABLE. Known issues include system hangs under load and crashes when virtqueues are exhausted. A temporary workaround in virtio.c masks underlying coordination problems between worker threads that need proper fixes. Based-on: 20260731162329.3552800-1-lvivier@redhat.com Laurent Vivier (7): vhost_user: Reset vq enable flag in vu_cleanup() threading: Add basic threading infrastructure passt: Integrate main event loop with threading infrastructure flow: Delegate epoll file descriptor management to threading subsystem ctx: Remove epollfd from context structure vhost-user: Add per-qpair worker threads virtio: Prevent crash on virtqueue exhaustion with temporary workaround Makefile | 8 +- conf.c | 10 ++- flow.c | 12 +-- flow.h | 4 +- fwd.c | 4 +- isolation.c | 6 +- netlink.c | 4 +- passt.c | 151 ++++++++++++++++++++++++-------------- passt.h | 7 +- pasta.c | 3 +- pif.c | 3 +- repair.c | 12 ++- tap.c | 9 ++- tcp.c | 3 +- tcp_splice.c | 1 + threading.c | 202 +++++++++++++++++++++++++++++++++++++++++++++++++++ threading.h | 22 ++++++ vhost_user.c | 34 +++++++-- vhost_user.h | 1 + virtio.c | 8 +- vu_common.c | 13 ++-- 21 files changed, 417 insertions(+), 100 deletions(-) create mode 100644 threading.c create mode 100644 threading.h -- 2.54.0