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=202510 header.b=gt4lFvoi; dkim-atps=neutral Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by passt.top (Postfix) with ESMTPS id 0E5D15A0276 for ; Fri, 28 Nov 2025 02:02:00 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202510; t=1764291716; bh=nnDjz525sJ9+zE08itAivSMYFmhNe5XfO7GSlGmzNcc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=gt4lFvoipS+6q5rNMfKYFm8x73B6QYFbGoZzug0zXXqmx00s0zZAUsjPFAU6pPSkk /7MbOTHGW+HceAjfCm10O/2A7RDAGmfmLVVOOTQ4dTFgjO+vGcNVzfLcwxyINgt7BF cM5yd31a1OuExOZLhDGmbpn4nHOaB2wv/jaxD2LzRuid7belLGQcJf6JVG3w6d4Djg 6nfiWwV3LOqZ/ClwOCr+i5juVeW3HAljvk4w/q4+NLBBcObBvg09bmJWrEtqGnysxc KpuwlyLARcmwrEkTyyKTwVWipTiQYvEAoPedMx9Q6a/NbldFOvjxNWyER9GBFaswhU wwVRrqFekATXQ== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4dHZkr7020z4wHH; Fri, 28 Nov 2025 12:01:56 +1100 (AEDT) Date: Fri, 28 Nov 2025 11:53:56 +1100 From: David Gibson To: Laurent Vivier Subject: Re: [PATCH v2 5/6] flow: Add queue pair tracking to flow management Message-ID: References: <20251121165902.1014964-1-lvivier@redhat.com> <20251121165902.1014964-6-lvivier@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="euDy2PKB/zWbd0QM" Content-Disposition: inline In-Reply-To: Message-ID-Hash: 7QXFPOH3R36TJW3FHR4K4UVX4KLZC2OP X-Message-ID-Hash: 7QXFPOH3R36TJW3FHR4K4UVX4KLZC2OP 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: --euDy2PKB/zWbd0QM Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Nov 27, 2025 at 10:17:43AM +0100, Laurent Vivier wrote: > On 11/26/25 04:41, David Gibson wrote: > > > +/** > > > + * flow_qp() - Get the queue pair for a flow > > > + * @f: Flow to query (may be NULL) > > > + * > > > + * Return: queue pair number for the flow, or 0 if flow is NULL or h= as no > > > + * valid queue pair assignment > > > + */ > > > +unsigned int flow_qp(const struct flow_common *f) > > > +{ > > > + if (f =3D=3D NULL || f->qpair =3D=3D FLOW_QPAIR_INVALID) > > Are there any instances where you actually want to pass a NULL flow to > > this? > >=20 > > If you're going to return 0 anyway, why not just set f->qpair to 0 by > > default, rather than using FLOW_QPAIR_INVALID? > >=20 >=20 > In fact, in the multithread part I need to know if the queue pair has bee= n set or not. > I agree that we should avoid this if possible because it takes one slot in > the array. And as we have 16 qpairs we must use 5 bit (we need 17 values) > rather than 4 bit. I'm reworking the multithread part, I will see if I can > remove this. Ok. It's not obvious to me why there would be a reason to explicitly track "unset" rather than setting a default value early. So, I guess we'll see in the next spin. --=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 --euDy2PKB/zWbd0QM Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmko8qMACgkQzQJF27ox 2Gf+qw//afTW2o43s9QacfhYrg8pyQAChPM0KDdEF1UQeRLO9z8rPo6EGuxa8t2Q tgJ30iLDZGXpiN+kDPqE3f+LDs+hzlZUz1iVZ0DxLFVLogcLR9/fU+qYDLJHCN5m TYrG5yX+7i3027B9sRpSi1WIt5BVvRCfqkCXZZZ0aWEqe7veOLXZSYxhCF5CcO1O 11jcDVaLm/sXoXWe5Op5BrAxx6vK4n6yApH5O0vNJBy13pZZWVwnaT8+K0/Ns5F7 BaEjh0XuhhyYyRSwPbb0g60fjzvQiDT9NacLI9dLwOakUHwRKqrpwak16DyyU6xQ 3dbuENT8JsIkBaEdDc3k7dySvK2AaebeYHZMEp9jfX+OI9ZuoeTRsIM2hwta7FAd rd+Xg0eJDn2OzJdHD2rfWEU9R1mQutuxXaJ0hynyoCZe1BWA1P2jzB3FmCeHtaiL mcxflJ5XCGGZKPVb6+Rr1NNaJY8bEJLmo7Lyqql4zAfAygod1XCyok/EzC7+wbE1 vGu9Xs5DakxG/LKsv8DVB+B26VLsWaje6PbdS9cCQvLyz2kXyolHdj0JBo7syJS0 BnMSgvoR5D83BidPiJUPSY17v3kBiEamPhnA2JDMF+sZOYvORgqwUqLKqVsCtYSU TYa5fnYEUftZBuSejYXOujicMC9QnTIqBIDMAkNpP1k5KpzD4xQ= =PCcO -----END PGP SIGNATURE----- --euDy2PKB/zWbd0QM--