From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=none (p=none dis=none) header.from=gibson.dropbear.id.au Authentication-Results: passt.top; dkim=pass (2048-bit key; secure) header.d=gibson.dropbear.id.au header.i=@gibson.dropbear.id.au header.a=rsa-sha256 header.s=202608 header.b=Zl2lG9ZW; dkim-atps=neutral Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by passt.top (Postfix) with ESMTPS id 4789C5A0265 for ; Mon, 03 Aug 2026 07:55:49 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202608; t=1785736546; bh=RzM9wAkuLnZPdFuufU6QDoiPOBYDEgWrlA1tNa1HOK8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Zl2lG9ZW0TGO9NzBwls6nJbgww8ypZovv+vcCPjy/9xoVEv3lAmyxFNx6hTLjomwM zL0NoTtaf4dWhScGAdQiwACkDN+slwOnXJQ1E6fzDT7I7+hqKnywP0FaXsKCJfhy9r nuqSK7RrxS1tXyv1MEjUI4e3kGQ9t1PnaPJq+Q9Z9MIsHGVrFm6vPdqpSbVWkeEr3H 4DAg/peOJMAU7enO3h41P70hVJuUOzhofo9QVasFXIvO1c7V54aLZiP/P4LzxuH/gr RyHyW+5kiqfTL7davIo1wkyGcBcK0kNOGIxpZeP9a/w0obQuZjas1Ysj6WUx1gAwts OmFMIsHkhOcnA== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4hD5WQ10xzz4w9j; Mon, 03 Aug 2026 15:55:46 +1000 (AEST) Date: Mon, 3 Aug 2026 15:55:20 +1000 From: David Gibson To: Laurent Vivier Subject: Re: [PATCH v2 02/10] tap: Make L4 sequence pools per-qpair for thread safety Message-ID: References: <20260731162329.3552800-1-lvivier@redhat.com> <20260731162329.3552800-3-lvivier@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="6sVjQ/08VNlS9sRF" Content-Disposition: inline In-Reply-To: Message-ID-Hash: W62AC5EONP7HWSVCM2WMBLOQXIU7SIJW X-Message-ID-Hash: W62AC5EONP7HWSVCM2WMBLOQXIU7SIJW X-MailFrom: dgibson@gandalf.ozlabs.org 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: passt-dev@passt.top 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: --6sVjQ/08VNlS9sRF Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Aug 03, 2026 at 03:43:15PM +1000, David Gibson wrote: > On Fri, Jul 31, 2026 at 06:23:21PM +0200, Laurent Vivier wrote: > > The L4 sequence arrays tap4_l4[] and tap6_l4[] are used to batch > > packets with the same L4 tuple within a single tap_handler() call. > > They are global, but tap_handler() can be called concurrently from > > different worker threads with different qpairs in vhost-user mode. > >=20 > > Make these arrays per-qpair by adding a VHOST_USER_MAX_VQS/2 first > > dimension, indexed by the qpair parameter already available in > > tap4_handler() and tap6_handler(). > >=20 > > Update tap_sock_update_pool() to initialize all qpair*seq entries. > >=20 > > Signed-off-by: Laurent Vivier >=20 > Reviewed-by: David Gibson Although.. it now occurred to me on both this and the previous patch. IIRC, the effective lifetime of these pool structures is just from slurping the packets off the tap interface to processing them through tap[46]_handler(). So, rather than having per queue arrays, would it make more sense to put these on the stack as well? --=20 David Gibson (he or they) | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you, not the other way | around. http://www.ozlabs.org/~dgibson --6sVjQ/08VNlS9sRF Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmpwLT0ACgkQzQJF27ox 2GffLQ/7BHC9a/WirUmjSGgUq9KnAqr7/gUFC+KznH85R/LwVxw+msd/ciBYu9Tl gm+B0UpFA4JCcogy0blgZ9swrmROjjIQ5BfVbXNlGp/XhZG0PQm2LjIVHyFM8ymW ByfN/kajTHmW02bJ8eBSUkm9ashauvob8FukC8Qfw6fAcoPRysGDEE6zCWWt7i8U jPRs9yFD5KWICpDc6TD4eyumNaeIo0Abeyq73ILe25+RtNUhX54YtSBoJWH1dWKR GXyL7skGqibMVCOKEAwiy6gB2q5cGStoVIiW8rtqrLzmQutrSUzO6Z7SxTJ/J4zv joqkG9KpEcrdf8D2N2X/sSSPAdKYGxs5r5X2G5P5q6vlu8RHGS1mHP2+W2p0lGOh c98YjlZqwyMgr1WeIE1W1Mc4p9iIo0ti5/FXiOhU07OlFLMBdt+hlAFfMDflwwO7 6SrA9dTuSqEy4js7NJ/ZNd4FBrn0vjZHQ9sBRrlFLn0fO/d9dmLP3LuZ91EgK7KU 7hjDD/CQPVs3oLGjofHfO9g3b1J2tjpwZg5h9VvofopT7/R0w7QqngIQDH3lmnAa 6+qhkOJAdy6tdgzQ/rU34RG3bNsDux31Yb/fFtargDM778ZbYPsHvYkrET/yp6KN 1wJbrS/5E4cEerMVgKuFHIgjavnQSXaWXrrqEBOpMWd0w9/ukhc= =F4Yh -----END PGP SIGNATURE----- --6sVjQ/08VNlS9sRF--