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=202606 header.b=d6qiLXML; dkim-atps=neutral Received: from mail.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by passt.top (Postfix) with ESMTPS id 888A25A0265 for ; Fri, 19 Jun 2026 08:10:56 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202606; t=1781849453; bh=tLCCboh0XJAqYm5LWRn77l1/LQKhXwcSCLGPrDFQDgk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=d6qiLXMLf2ePG/RFORUmcXZV4O0rUMUOwX0fWMey4f6XDSwrX0R8dyqeF/B5cklOD 6EKLoBI19DnlnjW3GBlii5VTtwbGq3XO/2L/3F+7G1LyT0pwFkfXQ7AHnJDeBb6L6/ bOUfamDOGN8iJwd+MGzxNd2huvxmWJzBLUeJrOdMTo0KUFs+5u2/JswYwJGSPSHHv3 ZkBvxGmBi1ALxr7nbnYuupXvQJR2AsT7ZRfh17K+1etBGOPcxWKgjB6ei2/WEJwmlj IGnhp7yTDws2LOayA5DbbbAQka5o3xsTyjayALzV/zHj2y54arEdoD+ZcgJUyzdL3G FNYwzN7p0Ieag== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4ghRzd2mFyz4wLd; Fri, 19 Jun 2026 16:10:53 +1000 (AEST) Date: Fri, 19 Jun 2026 16:10:49 +1000 From: David Gibson To: Laurent Vivier Subject: Re: [PATCH v5 08/12] dhcp/dhcpv6: Pass queue pair explicitly through DHCP send path Message-ID: References: <20260616125130.1324274-1-lvivier@redhat.com> <20260616125130.1324274-9-lvivier@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="XbP0FkiJWiZQvzTf" Content-Disposition: inline In-Reply-To: <20260616125130.1324274-9-lvivier@redhat.com> Message-ID-Hash: NWZLDGXOUTVMVT5AMN6JOCR7VF5POYHW X-Message-ID-Hash: NWZLDGXOUTVMVT5AMN6JOCR7VF5POYHW 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: --XbP0FkiJWiZQvzTf Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jun 16, 2026 at 02:51:26PM +0200, Laurent Vivier wrote: > Add a qpair parameter to dhcp(), dhcpv6(), and > dhcpv6_send_ia_notonlink(), forwarding it to tap_udp4_send() and > tap_udp6_send() instead of hardcoding QPAIR_DEFAULT. >=20 > No functional change. >=20 > Signed-off-by: Laurent Vivier These ones make sense to me since a) there's no associated flow and b) we're always sending in direct response to a guest message that must have come on a particular queue. Reviewed-by: David Gibson > --- > dhcp.c | 6 +++--- > dhcp.h | 2 +- > dhcpv6.c | 12 +++++++----- > dhcpv6.h | 2 +- > tap.c | 4 ++-- > 5 files changed, 14 insertions(+), 12 deletions(-) >=20 > diff --git a/dhcp.c b/dhcp.c > index e652659138b8..6ff094c9179e 100644 > --- a/dhcp.c > +++ b/dhcp.c > @@ -296,11 +296,12 @@ static void opt_set_dns_search(const struct ctx *c,= size_t max_len) > /** > * dhcp() - Check if this is a DHCP message, reply as needed > * @c: Execution context > + * @qpair: Queue pair on which to send the reply > * @data: Single packet with Ethernet buffer > * > * Return: 0 if it's not a DHCP message, 1 if handled, -1 on failure > */ > -int dhcp(const struct ctx *c, struct iov_tail *data) > +int dhcp(const struct ctx *c, unsigned int qpair, struct iov_tail *data) > { > char macstr[ETH_ADDRSTRLEN]; > size_t mlen, dlen, opt_len; > @@ -473,8 +474,7 @@ int dhcp(const struct ctx *c, struct iov_tail *data) > else > dst =3D c->ip4.addr; > =20 > - tap_udp4_send(c, QPAIR_DEFAULT, c->ip4.our_tap_addr, 67, dst, 68, > - &reply, dlen); > + tap_udp4_send(c, qpair, c->ip4.our_tap_addr, 67, dst, 68, &reply, dlen); > =20 > return 1; > } > diff --git a/dhcp.h b/dhcp.h > index cd50c99b8856..6d034f0c58af 100644 > --- a/dhcp.h > +++ b/dhcp.h > @@ -6,7 +6,7 @@ > #ifndef DHCP_H > #define DHCP_H > =20 > -int dhcp(const struct ctx *c, struct iov_tail *data); > +int dhcp(const struct ctx *c, unsigned int qpair, struct iov_tail *data); > void dhcp_init(void); > =20 > #endif /* DHCP_H */ > diff --git a/dhcpv6.c b/dhcpv6.c > index f4ebeccf912c..3c97c921a849 100644 > --- a/dhcpv6.c > +++ b/dhcpv6.c > @@ -370,12 +370,13 @@ notonlink: > /** > * dhcpv6_send_ia_notonlink() - Send NotOnLink status > * @c: Execution context > + * @qpair: Queue pair on which to send the reply > * @ia_base: Non-appropriate IA_NA or IA_TA base > * @client_id_base: Client ID message option base > * @len: Client ID length > * @xid: Transaction ID for message exchange > */ > -static void dhcpv6_send_ia_notonlink(struct ctx *c, > +static void dhcpv6_send_ia_notonlink(struct ctx *c, unsigned int qpair, > const struct iov_tail *ia_base, > const struct iov_tail *client_id_base, > int len, uint32_t xid) > @@ -405,7 +406,7 @@ static void dhcpv6_send_ia_notonlink(struct ctx *c, > =20 > resp_not_on_link.hdr.xid =3D xid; > =20 > - tap_udp6_send(c, QPAIR_DEFAULT, src, 547, tap_ip6_daddr(c, src), 546, > + tap_udp6_send(c, qpair, src, 547, tap_ip6_daddr(c, src), 546, > xid, &resp_not_on_link, n); > } > =20 > @@ -542,13 +543,14 @@ static size_t dhcpv6_client_fqdn_fill(const struct = iov_tail *data, > /** > * dhcpv6() - Check if this is a DHCPv6 message, reply as needed > * @c: Execution context > + * @qpair: Queue pair on which to send the reply > * @data: Single packet starting from UDP header > * @saddr: Source IPv6 address of original message > * @daddr: Destination IPv6 address of original message > * > * Return: 0 if it's not a DHCPv6 message, 1 if handled, -1 on failure > */ > -int dhcpv6(struct ctx *c, struct iov_tail *data, > +int dhcpv6(struct ctx *c, unsigned int qpair, struct iov_tail *data, > const struct in6_addr *saddr, const struct in6_addr *daddr) > { > const struct opt_server_id *server_id =3D NULL; > @@ -630,7 +632,7 @@ int dhcpv6(struct ctx *c, struct iov_tail *data, > =20 > if (dhcpv6_ia_notonlink(data, &c->ip6.addr)) { > =20 > - dhcpv6_send_ia_notonlink(c, data, &client_id_base, > + dhcpv6_send_ia_notonlink(c, qpair, data, &client_id_base, > ntohs(client_id->l), mh->xid); > =20 > return 1; > @@ -680,7 +682,7 @@ int dhcpv6(struct ctx *c, struct iov_tail *data, > =20 > resp.hdr.xid =3D mh->xid; > =20 > - tap_udp6_send(c, QPAIR_DEFAULT, src, 547, tap_ip6_daddr(c, src), 546, > + tap_udp6_send(c, qpair, src, 547, tap_ip6_daddr(c, src), 546, > mh->xid, &resp, n); > c->ip6.addr_seen =3D c->ip6.addr; > =20 > diff --git a/dhcpv6.h b/dhcpv6.h > index c706dfdbb2ac..3a249b39e6c7 100644 > --- a/dhcpv6.h > +++ b/dhcpv6.h > @@ -6,7 +6,7 @@ > #ifndef DHCPV6_H > #define DHCPV6_H > =20 > -int dhcpv6(struct ctx *c, struct iov_tail *data, > +int dhcpv6(struct ctx *c, unsigned int qpair, struct iov_tail *data, > struct in6_addr *saddr, struct in6_addr *daddr); > void dhcpv6_init(const struct ctx *c); > =20 > diff --git a/tap.c b/tap.c > index e8fd3661ebb5..8e19390f7273 100644 > --- a/tap.c > +++ b/tap.c > @@ -805,7 +805,7 @@ resume: > struct iov_tail eh_data; > =20 > packet_get(pool_tap4, i, &eh_data); > - if (dhcp(c, &eh_data)) > + if (dhcp(c, qpair, &eh_data)) > continue; > } > =20 > @@ -1049,7 +1049,7 @@ resume: > if (proto =3D=3D IPPROTO_UDP) { > struct iov_tail uh_data =3D data; > =20 > - if (dhcpv6(c, &uh_data, saddr, daddr)) > + if (dhcpv6(c, qpair, &uh_data, saddr, daddr)) > continue; > } > =20 > --=20 > 2.54.0 >=20 --=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 --XbP0FkiJWiZQvzTf Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmo03WQACgkQzQJF27ox 2GfSEQ//XQ6/khLv+yePSkB0HnpgyvtlgVRwmbRaOp1AcNGCgef0OLz5s3F7d4sU byheBr1ysS45J183X4FkvQ9Y8bSxFZkcYaX67p/0RmY/aTPPKX7SSf75zLlpM85m ub4d0V0USvjnuoHh1Nt5/Gw6dlVMZiWjhULns7eoHOLbV/CKMBjkIL3261iQL7qy oXEBw7UrUj6FRB8KjbIukvBTYrAmUsWoKCM334l9BR3AGdvGkD7/PgeTCXEi85Eb b6Wtu0Lg4BUIEIX76AnCk9dfPPfxZxX4hy1MDfKXRLKfutjdnihpfcUZD7yWFbcw WwF4W5Ycl+GHZoIVb3Oc9KQVQC9Nr6cCdlTzZnlY4eXg9lATRiAeiEytT9mHQfSc iHI7mD78QSTXM6Oj8ALz0ngh+tudTLXHpxeqoGkWgkeNY3k67h9SoEVKso3gjc/1 rY6Z/HF5Nn28uk4hjPHaE5jnUVvWkto98W5hTnkrAyWvoE4Nsr+EmLGTjAOJuWWA Fm3F0xFW5h6nLE/U46KYw9rNMT0FCeioDLqugTJo29MbpbpmrWqrwXOgiLBTDHwR 5r1fWMdiRs9zp3UVdxkLN1yqqP1Pi58M6a3Y/hi3JyeRTm3dxluZOQ4yEQ5V5b/8 TGlEBRvlcMGSg8PjHFJYwaqpsgBuilFsTHNLetBDhRD2FJMI2RU= =uQCK -----END PGP SIGNATURE----- --XbP0FkiJWiZQvzTf--