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=gZE0ALha; dkim-atps=neutral Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by passt.top (Postfix) with ESMTPS id F34ED5A0262 for ; Fri, 19 Jun 2026 08:18:01 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202606; t=1781849877; bh=2VYoOljXUFZsM44WKiv5ZszCsaorohDiS/Q4N5KITzE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=gZE0ALhaBCu5+TcNgP6/4vAtbuNvevSlRuLVrcD7KittCJP6xw+XxGreD4z/31OC5 5/J763z0AFJRLx/nn7C7yjqgbmvIZXoFDHfUAgMVztYwFD4jIQVRs2t60fhsTKMElN PH3MG/p6V3lgeP5LvuJMM6H9Sm4Uh5w+mS70yv3mwgcE9IZQTYU7QivCuVSh7UJ28S 72FwPi7NwxlNyfOra44BvUZRJ2ptYG9nbyNZm5XGin4yjHuT6rkKh1dwLkV5W1z3Go Cn94jtV9AXTlLxjvK5mhobZQVJYpyqRYJNxaDUToceEYEqZAdwOxVG31y9Mkfw7xig NRddWHaoSAV1A== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4ghS7n655Kz58sh; Fri, 19 Jun 2026 16:17:57 +1000 (AEST) Date: Fri, 19 Jun 2026 16:17:46 +1000 From: David Gibson To: Laurent Vivier Subject: Re: [PATCH v5 10/12] ndp: Pass queue pair explicitly through NDP send path Message-ID: References: <20260616125130.1324274-1-lvivier@redhat.com> <20260616125130.1324274-11-lvivier@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="HxmL7LoTFhMZZJKS" Content-Disposition: inline In-Reply-To: <20260616125130.1324274-11-lvivier@redhat.com> Message-ID-Hash: 4I4KPZTCIOO7ONVCTEJDXFA3OPSLHUOJ X-Message-ID-Hash: 4I4KPZTCIOO7ONVCTEJDXFA3OPSLHUOJ 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: --HxmL7LoTFhMZZJKS Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jun 16, 2026 at 02:51:28PM +0200, Laurent Vivier wrote: > Add a qpair parameter to ndp(), ndp_send(), ndp_na(), > ndp_unsolicited_na(), ndp_ra(), and ndp_send_init_req(), forwarding > it to tap_icmp6_send() instead of hardcoding QPAIR_DEFAULT. >=20 > ndp_timer() and fwd_neigh_table_update() have no queue pair context > and keep using QPAIR_DEFAULT. >=20 > No functional change. >=20 > Signed-off-by: Laurent Vivier > --- > fwd.c | 2 +- > ndp.c | 40 ++++++++++++++++++++++++---------------- > ndp.h | 7 ++++--- > tap.c | 4 ++-- > 4 files changed, 31 insertions(+), 22 deletions(-) >=20 > diff --git a/fwd.c b/fwd.c > index 0d0e265b7dc0..1bfe024ada26 100644 > --- a/fwd.c > +++ b/fwd.c > @@ -147,7 +147,7 @@ void fwd_neigh_table_update(const struct ctx *c, cons= t union inany_addr *addr, > if (inany_v4(addr)) > arp_announce(c, QPAIR_DEFAULT, inany_v4(addr), e->mac); > else > - ndp_unsolicited_na(c, &addr->a6); > + ndp_unsolicited_na(c, QPAIR_DEFAULT, &addr->a6); > } > =20 > /** > diff --git a/ndp.c b/ndp.c > index 6269cb38d93f..00d1751ba100 100644 > --- a/ndp.c > +++ b/ndp.c > @@ -175,26 +175,28 @@ struct ndp_ns { > /** > * ndp_send() - Send an NDP message > * @c: Execution context > + * @qpair: Queue pair on which to send the message > * @dst: IPv6 address to send the message to > * @buf: ICMPv6 header + message payload > * @l4len: Length of message, including ICMPv6 header > */ > -static void ndp_send(const struct ctx *c, const struct in6_addr *dst, > - const void *buf, size_t l4len) > +static void ndp_send(const struct ctx *c, unsigned int qpair, > + const struct in6_addr *dst, const void *buf, size_t l4len) > { > const struct in6_addr *src =3D &c->ip6.our_tap_ll; > =20 > - tap_icmp6_send(c, QPAIR_DEFAULT, src, dst, buf, c->our_tap_mac, l4len); > + tap_icmp6_send(c, qpair, src, dst, buf, c->our_tap_mac, l4len); > } > =20 > /** > * ndp_na() - Send an NDP Neighbour Advertisement (NA) message > * @c: Execution context > + * @qpair: Queue pair on which to send the NA > * @dst: IPv6 address to send the NA to > * @addr: IPv6 address to advertise > */ > -static void ndp_na(const struct ctx *c, const struct in6_addr *dst, > - const struct in6_addr *addr) > +static void ndp_na(const struct ctx *c, unsigned int qpair, > + const struct in6_addr *dst, const struct in6_addr *addr) > { > union inany_addr tgt; > struct ndp_na na =3D { > @@ -217,26 +219,30 @@ static void ndp_na(const struct ctx *c, const struc= t in6_addr *dst, > inany_from_af(&tgt, AF_INET6, addr); > fwd_neigh_mac_get(c, &tgt, na.target_l2_addr.mac); > =20 > - ndp_send(c, dst, &na, sizeof(na)); > + ndp_send(c, qpair, dst, &na, sizeof(na)); > } > =20 > /** > * ndp_unsolicited_na() - Send unsolicited NA > * @c: Execution context > + * @qpair: Queue pair on which to send the NA > * @addr: IPv6 address to advertise > */ > -void ndp_unsolicited_na(const struct ctx *c, const struct in6_addr *addr) > +void ndp_unsolicited_na(const struct ctx *c, unsigned int qpair, > + const struct in6_addr *addr) Since this is unsolicited, how would the caller have a better idea of the right qpair than we could here? > { > if (tap_is_ready(c)) > - ndp_na(c, &in6addr_ll_all_nodes, addr); > + ndp_na(c, qpair, &in6addr_ll_all_nodes, addr); > } > =20 > /** > * ndp_ra() - Send an NDP Router Advertisement (RA) message > * @c: Execution context > + * @qpair: Queue pair on which to send the RA > * @dst: IPv6 address to send the RA to > */ > -static void ndp_ra(const struct ctx *c, const struct in6_addr *dst) > +static void ndp_ra(const struct ctx *c, unsigned int qpair, > + const struct in6_addr *dst) > { > struct ndp_ra ra =3D { > .ih =3D { > @@ -344,18 +350,19 @@ static void ndp_ra(const struct ctx *c, const struc= t in6_addr *dst) > memcpy(&ra.source_ll.mac, c->our_tap_mac, ETH_ALEN); > =20 > /* NOLINTNEXTLINE(clang-analyzer-security.PointerSub) */ > - ndp_send(c, dst, &ra, ptr - (unsigned char *)&ra); > + ndp_send(c, qpair, dst, &ra, ptr - (unsigned char *)&ra); > } > =20 > /** > * ndp() - Check for NDP solicitations, reply as needed > * @c: Execution context > + * @qpair: Queue pair on which to send replies > * @saddr: Source IPv6 address > * @data: Single packet with ICMPv6 header > * > * Return: 0 if not handled here, 1 if handled, -1 on failure > */ > -int ndp(const struct ctx *c, const struct in6_addr *saddr, > +int ndp(const struct ctx *c, unsigned int qpair, const struct in6_addr *= saddr, > struct iov_tail *data) > { > struct icmp6hdr ih_storage; > @@ -384,13 +391,13 @@ int ndp(const struct ctx *c, const struct in6_addr = *saddr, > =20 > info("NDP: received NS, sending NA"); > =20 > - ndp_na(c, saddr, &ns->target_addr); > + ndp_na(c, qpair, saddr, &ns->target_addr); > } else if (ih->icmp6_type =3D=3D RS) { > if (c->no_ra) > return 1; > =20 > info("NDP: received RS, sending RA"); > - ndp_ra(c, saddr); > + ndp_ra(c, qpair, saddr); > } > =20 > return 1; > @@ -448,7 +455,7 @@ void ndp_timer(const struct ctx *c, const struct time= spec *now) > =20 > info("NDP: sending unsolicited RA, next in %llds", (long long)interval); > =20 > - ndp_ra(c, &in6addr_ll_all_nodes); > + ndp_ra(c, QPAIR_DEFAULT, &in6addr_ll_all_nodes); > =20 > first: > next_ra =3D now->tv_sec + interval; > @@ -457,8 +464,9 @@ first: > /** > * ndp_send_init_req() - Send initial NDP NS to retrieve guest MAC addre= ss > * @c: Execution context > + * @qpair: Queue pair on which to send the request > */ > -void ndp_send_init_req(const struct ctx *c) > +void ndp_send_init_req(const struct ctx *c, unsigned int qpair) > { > struct ndp_ns ns =3D { > .ih =3D { > @@ -471,5 +479,5 @@ void ndp_send_init_req(const struct ctx *c) > .target_addr =3D c->ip6.addr > }; > debug("Sending initial NDP NS request for guest MAC address"); > - ndp_send(c, &c->ip6.addr, &ns, sizeof(ns)); > + ndp_send(c, qpair, &c->ip6.addr, &ns, sizeof(ns)); > } > diff --git a/ndp.h b/ndp.h > index 56b756d8400b..8c168fc199fe 100644 > --- a/ndp.h > +++ b/ndp.h > @@ -8,10 +8,11 @@ > =20 > struct icmp6hdr; > =20 > -int ndp(const struct ctx *c, const struct in6_addr *saddr, > +int ndp(const struct ctx *c, unsigned int qpair, const struct in6_addr *= saddr, > struct iov_tail *data); > void ndp_timer(const struct ctx *c, const struct timespec *now); > -void ndp_send_init_req(const struct ctx *c); > -void ndp_unsolicited_na(const struct ctx *c, const struct in6_addr *addr= ); > +void ndp_send_init_req(const struct ctx *c, unsigned int qpair); > +void ndp_unsolicited_na(const struct ctx *c, unsigned int qpair, > + const struct in6_addr *addr); > =20 > #endif /* NDP_H */ > diff --git a/tap.c b/tap.c > index de1e5269526c..5e9c7a1701bf 100644 > --- a/tap.c > +++ b/tap.c > @@ -1030,7 +1030,7 @@ resume: > continue; > =20 > ndp_data =3D data; > - if (ndp(c, saddr, &ndp_data)) > + if (ndp(c, qpair, saddr, &ndp_data)) > continue; > =20 > tap_packet_debug(NULL, ip6h, NULL, proto, NULL, 1); > @@ -1470,7 +1470,7 @@ static void tap_start_connection(const struct ctx *= c, unsigned int qpair) > if (c->ifi4) > arp_send_init_req(c, qpair); > if (c->ifi6 && !c->no_ndp) > - ndp_send_init_req(c); > + ndp_send_init_req(c, qpair); > } > =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 --HxmL7LoTFhMZZJKS Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmo03v0ACgkQzQJF27ox 2GcVFg//chJX/xfM6G6GpLGm0RciedMVhDw32SoY25agilu+Y3EOxb9ZZFMJc8kj u4ai+9IigfnGzcFzTWzPv2Tj0B7WyloHlROhw9GKTjhveB328Q4SufFo7iiteIYU Kr7B0lbRpA2PSCkTTKW3/LCKadHh0j8Z/TKJUDrQ4m3kODS3vOOtCpJ0S0Xo0iNu UgFSfsQdkUaER3Cy8rM7Ircrhpy/1B99dabLR1Fs3tzx4IIXEalaR26IoRdOfjon b3xnGwbXIpJ/2e3rY9JdabrSaCN2yRwqJuTyU4nMsBhj6155qZyrgXA6mC6UVUsI Mg7o7njO495S4ioBd9UVRypTxdHnvdkguAWCWq2Zj9F1JnbPtWhGV34rYHvwn/9e kyT2A1bgElU1avta7uCXkicl0wa+1SKMsogdlKRfPY58HL9X/YCX7/ikaAn/bLve 4PJrLODNBZYrwwvXR53mnpF9SJK/s13Pj7JMc6daY35s26vmIiQxAMI0FspFaJ4Z duLKvSGINeX1y9wkVdk9jO9nOP79g95i2+SuhDHlhhbPo5HNVG3iRuBOqh1heMng 8I2f7M7eNyv7JrVap88sGJs2HZm0G5Nib41wH3oVrpA0hi/RBltXr7Z8PZ94+xCe 574Ky2biHtUz/x9y9C6Z9mzdnNhqpA8C6bRQ+jY7hykfLsSnToU= =07Ov -----END PGP SIGNATURE----- --HxmL7LoTFhMZZJKS--