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=k6EMHzAg; dkim-atps=neutral Received: from mail.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by passt.top (Postfix) with ESMTPS id 7E37E5A0265 for ; Fri, 19 Jun 2026 08:00:50 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202606; t=1781848848; bh=p5LlE94bS08gOzFBcrmz7M7CmBAUk5q58kQcpc4seyk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=k6EMHzAgngCKBf3HVRMehK0VJnBcC21/GMQMylLi//41NSinQDukWz0UMjpFeOoL5 wAxslLzEQO7SxUkDkwTSJNhFEDvL2vhw5t2h5L5FQMH/776Qs7TvbLMcGzyS3CJyXc 8PMi9stPobjKbUFr1hlvkS7h8/3Z+qE33sp0y2DV5z3uTzWaYhbnEHmiR98me/Un06 d3js44JMv5tZiR2HLjlLoeuem2jpxljVpPATiTU5um1HLc0UsrnLdeU5bYSv91CmAi K/unSrLhixmg00Jzt4rxFUxIdEDiVzrjrKYgjVvjB1esGtbDaUevFGu2a/43JNQIev RGF5hblQRTK3g== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4ghRm01F9qz4wKC; Fri, 19 Jun 2026 16:00:48 +1000 (AEST) Date: Fri, 19 Jun 2026 15:40:36 +1000 From: David Gibson To: Laurent Vivier Subject: Re: [PATCH v5 05/12] arp: Pass queue pair explicitly through ARP send path Message-ID: References: <20260616125130.1324274-1-lvivier@redhat.com> <20260616125130.1324274-6-lvivier@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="x2vQTpdhTVqSnXZO" Content-Disposition: inline In-Reply-To: <20260616125130.1324274-6-lvivier@redhat.com> Message-ID-Hash: IE6QZA6OZPYNWFWVBILIVOPBLVJSBJTX X-Message-ID-Hash: IE6QZA6OZPYNWFWVBILIVOPBLVJSBJTX 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: --x2vQTpdhTVqSnXZO Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jun 16, 2026 at 02:51:23PM +0200, Laurent Vivier wrote: > Add a qpair parameter to arp(), arp_send_init_req(), and > arp_announce(), forwarding it to tap_send_single() instead of > hardcoding QPAIR_DEFAULT. >=20 > tap_start_connection() now consumes the qpair parameter it received > in the previous commit. >=20 > fwd_neigh_table_update() has no queue pair context and keeps using > QPAIR_DEFAULT. >=20 > No functional change. >=20 > Signed-off-by: Laurent Vivier > --- > arp.c | 15 +++++++++------ > arp.h | 6 +++--- > fwd.c | 2 +- > tap.c | 6 ++---- > 4 files changed, 15 insertions(+), 14 deletions(-) >=20 > diff --git a/arp.c b/arp.c > index e97c4de86a99..1dc8b87cd993 100644 > --- a/arp.c > +++ b/arp.c > @@ -63,11 +63,12 @@ static bool ignore_arp(const struct ctx *c, > /** > * arp() - Check if this is a supported ARP message, reply as needed > * @c: Execution context > + * @qpair: Queue pair on which to send the reply > * @data: Single packet with Ethernet buffer > * > * Return: 1 if handled, -1 on failure > */ > -int arp(const struct ctx *c, struct iov_tail *data) > +int arp(const struct ctx *c, unsigned int qpair, struct iov_tail *data) The qpair parameter makes sense to me here: you want to send the reply on the same qpair the request came in on. > { > union inany_addr tgt; > struct { > @@ -112,7 +113,7 @@ int arp(const struct ctx *c, struct iov_tail *data) > memcpy(resp.am.tha, am->sha, sizeof(resp.am.tha)); > memcpy(resp.am.tip, am->sip, sizeof(resp.am.tip)); > =20 > - tap_send_single(c, QPAIR_DEFAULT, &resp, sizeof(resp)); > + tap_send_single(c, qpair, &resp, sizeof(resp)); > =20 > return 1; > } > @@ -120,8 +121,9 @@ int arp(const struct ctx *c, struct iov_tail *data) > /** > * arp_send_init_req() - Send initial ARP request to retrieve guest MAC = address > * @c: Execution context > + * @qpair: Queue pair on which to send the request > */ > -void arp_send_init_req(const struct ctx *c) > +void arp_send_init_req(const struct ctx *c, unsigned int qpair) But I'm dubious about it here. These are unsolicited messages to which we don't expect a reply. They're also low volume, so I don't see that we particularly need to distribute across queues. What's the advantage in putting QPAIR_DEFAULT in the caller, rather than right here? > { > struct { > struct ethhdr eh; > @@ -148,16 +150,17 @@ void arp_send_init_req(const struct ctx *c) > memcpy(req.am.tip, &c->ip4.addr, sizeof(req.am.tip)); > =20 > debug("Sending initial ARP request for guest MAC address"); > - tap_send_single(c, QPAIR_DEFAULT, &req, sizeof(req)); > + tap_send_single(c, qpair, &req, sizeof(req)); > } > =20 > /** > * arp_announce() - Send an ARP announcement for an IPv4 host > * @c: Execution context > + * @qpair: Queue pair on which to send the announcement > * @ip: IPv4 address we announce as owned by @mac > * @mac: MAC address to advertise for @ip > */ > -void arp_announce(const struct ctx *c, struct in_addr *ip, > +void arp_announce(const struct ctx *c, unsigned int qpair, struct in_add= r *ip, > const unsigned char *mac) Similar thoughts here. > { > char ip_str[INET_ADDRSTRLEN]; > @@ -202,5 +205,5 @@ void arp_announce(const struct ctx *c, struct in_addr= *ip, > eth_ntop(mac, mac_str, sizeof(mac_str)); > debug("ARP announcement for %s / %s", ip_str, mac_str); > =20 > - tap_send_single(c, QPAIR_DEFAULT, &msg, sizeof(msg)); > + tap_send_single(c, qpair, &msg, sizeof(msg)); > } > diff --git a/arp.h b/arp.h > index 4b1f38bcec9b..501760393a74 100644 > --- a/arp.h > +++ b/arp.h > @@ -22,9 +22,9 @@ struct arpmsg { > unsigned char tip[4]; > } __attribute__((__packed__)); > =20 > -int arp(const struct ctx *c, struct iov_tail *data); > -void arp_send_init_req(const struct ctx *c); > -void arp_announce(const struct ctx *c, struct in_addr *ip, > +int arp(const struct ctx *c, unsigned int qpair, struct iov_tail *data); > +void arp_send_init_req(const struct ctx *c, unsigned int qpair); > +void arp_announce(const struct ctx *c, unsigned int qpair, struct in_add= r *ip, > const unsigned char *mac); > =20 > #endif /* ARP_H */ > diff --git a/fwd.c b/fwd.c > index c0a6adacd294..0d0e265b7dc0 100644 > --- a/fwd.c > +++ b/fwd.c > @@ -145,7 +145,7 @@ void fwd_neigh_table_update(const struct ctx *c, cons= t union inany_addr *addr, > return; > =20 > if (inany_v4(addr)) > - arp_announce(c, inany_v4(addr), e->mac); > + arp_announce(c, QPAIR_DEFAULT, inany_v4(addr), e->mac); > else > ndp_unsolicited_na(c, &addr->a6); > } > diff --git a/tap.c b/tap.c > index 521ccd6d47e7..66dcb83665a7 100644 > --- a/tap.c > +++ b/tap.c > @@ -741,7 +741,7 @@ resume: > if (!eh) > continue; > if (ntohs(eh->h_proto) =3D=3D ETH_P_ARP) { > - arp(c, &data); > + arp(c, qpair, &data); > continue; > } > =20 > @@ -1453,8 +1453,6 @@ static void tap_start_connection(const struct ctx *= c, unsigned int qpair) > { > union epoll_ref ref =3D { 0 }; > =20 > - (void)qpair; > - > ref.fd =3D c->fd_tap; > switch (c->mode) { > case MODE_PASST: > @@ -1474,7 +1472,7 @@ static void tap_start_connection(const struct ctx *= c, unsigned int qpair) > return; > =20 > if (c->ifi4) > - arp_send_init_req(c); > + arp_send_init_req(c, qpair); > if (c->ifi6 && !c->no_ndp) > ndp_send_init_req(c); > } > --=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 --x2vQTpdhTVqSnXZO Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmo01kgACgkQzQJF27ox 2GdrFg/+NoA8CqZkm1UdEJ4KQR3Mkf1LqutpLAbTMlg89QEBhw/9KlDlSnS8HZxF hNnQGl4IngbQSL2l2AIWo+p2NrJZTklufS2joi+MKb/r3qq21egsS5nZcdoaToyu bdNgRB3iAgblTh/RocefpV8/qKMjWCLNSU70ToG5Xi1WsSGD5ehWIf7MmnXdgzCG pQG36xw8cRRPfYXfTbnkaZ4JqOwK9vw2WzRN9PZo1yS7YKx8oP7gh+LrjPIDlE4k sN5K6ucaL410HVjSEMgOoyO6nn22VeIIS4FvxqL+iIcunX9GW5YEyNPvHdC9NFHC VLBnb/MTdwERgZ7MP1AVi6FnZ/5JgBH1T9XHZ5lAomVhVsiYsp3EZv/0j0+rCUfb fQ/+YdWe4PqlfvYCExbjAU6jgdnNuA3YBgbno5YarlL6Ok5vu2tXVoewW44XmioU lfVkRl6dD0Kh8kNN5gLdNoncxsri55XxsjF4wAFqGfqvrUQzZSR28SAhdNa2a2e/ arrh7UAWdn+uNZo9SLJ0FiaLcuej4CExFGGzqjq5WuyNnntCnomBnhj5htKVxBMZ qjFQs2tuZ0Qr8mQhR7E1rrsduREZbygJSV4pb4IFykwmQQ7svCieLjReD2wcmb/f a5JhJ+3XFPKxlwhBPAczItkVdOTB+RZKuPW8z3nijP8CNFSKQMg= =XEcz -----END PGP SIGNATURE----- --x2vQTpdhTVqSnXZO--