public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
From: Stefano Brivio <sbrivio@redhat.com>
To: David Gibson <david@gibson.dropbear.id.au>
Cc: Jon Maloy <jmaloy@redhat.com>, passt-dev@passt.top
Subject: Re: [PATCH v7 08/13] conf, pasta: Track observed guest IPv4 addresses in unified address array
Date: Thu, 25 Jun 2026 00:56:59 +0200 (CEST)	[thread overview]
Message-ID: <20260625005659.47d0b293@elisabeth> (raw)
In-Reply-To: <ajiUBRLRHMQqGKjv@zatzit>

On Mon, 22 Jun 2026 11:46:45 +1000
David Gibson <david@gibson.dropbear.id.au> wrote:

> On Sat, Jun 20, 2026 at 12:10:41AM +0200, Stefano Brivio wrote:
> > On Sun, 12 Apr 2026 20:53:14 -0400
> > Jon Maloy <jmaloy@redhat.com> wrote:
> >   
> > > We remove the addr_seen field in struct ip4_ctx and replace it by
> > > setting a new CONF_ADDR_OBSERVED flag in the corresponding entry
> > > in the unified address array.
> > > 
> > > The observed IPv4 address is always added at or moved to position 0,
> > > increasing chances for a fast lookup.
> > > 
> > > Signed-off-by: Jon Maloy <jmaloy@redhat.com>
> > > 
> > > ---
> > > v4: - Removed migration protocol update, to be added in later commit
> > >     - Allow only one OBSERVED address at a time
> > >     - Some other changes based on feedback from David G
> > > v5: - Allowing multiple observed IPv4 addresses
> > > v6: - Refactored fwd_set_addr(), notably:
> > >       o Limited number of allowed observed addresses to four per protocol
> > >       o I kept the memmove() calls, since I find no more elegant way to
> > >         do this. Performance cost should be minimal, since these parts
> > >         of the code will execute only very exceptionally. Note that
> > >         removing the 'oldest' entry implicitly means removing the least
> > >         used one, since the latter will migrate to the highest position
> > >         after a few iterations of remove/add.
> > >       o Also kept the prefix_len update. Not sure about this, but I
> > >         cannot see how the current approach can cause any harm.
> > >     - Other changes suggested by David G, notably reversing some
> > >       residues after an accidental merge/re-split with the next
> > >       commit.
> > > v7: - Changed fwd_set_addr() to only accept keeping one observed-only
> > >       address per protocol, as suggested by David.  
> > 
> > Sorry, I just spotted this in David's review of v6. Actually, I
> > think that keeping track of a few multiple observed addresses
> > (especially with different scope) might be convenient and it would
> > already be useful here together with 4/13 to avoid resolving via ARP
> > any of a few addresses recently seen from the guest.  
> 
> So.. not resolving ARPs is the one thing where we could actualy use
> multiple guest observed addresses - mostly we use it for directing
> traffic to the guest, for which we need a single address.
> 
> But.. I feel like switching the ARP resolution from "everything
> except" to "only these" would be a better solution.  That also lets
> the guest move to a brand new unused address without getting bogus DAD
> failures.

See my follow-up on 2/13 for the general topic. Specifically about
duplicate address detection: that's NDP, not ARP, and it already works
without failures because of this check in ndp(), ndp.c:

		if (IN6_IS_ADDR_UNSPECIFIED(saddr))
			return 1;

which is based on the fact that duplicate address detection packets are
sent to the unspecified address (RFC 4862, 5.4.2).

The DHCP / ARP equivalent is also taken care of because we assume we
are the relevant DHCP server for any guest / container and in that case
we wouldn't resolve duplicate address probes for IPv4 either, as we
just assigned that address to the guest / container.

-- 
Stefano


  reply	other threads:[~2026-06-24 22:57 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-13  0:53 [PATCH v7 00/13] Introduce multiple addresses and late binding Jon Maloy
2026-04-13  0:53 ` [PATCH v7 01/13] dhcpv6: Fix reply destination to match client's source address Jon Maloy
2026-05-14  5:21   ` David Gibson
2026-06-19 22:11     ` Stefano Brivio
2026-06-22  3:39       ` David Gibson
2026-06-19 22:09   ` Stefano Brivio
2026-04-13  0:53 ` [PATCH v7 02/13] passt, pasta: Introduce unified multi-address data structures Jon Maloy
2026-05-14  6:30   ` David Gibson
2026-05-14 23:28     ` Stefano Brivio
2026-05-25  9:35       ` David Gibson
2026-06-19 22:09   ` Stefano Brivio
2026-06-22  1:39     ` David Gibson
2026-06-24 22:56       ` Stefano Brivio
2026-04-13  0:53 ` [PATCH v7 03/13] fwd: Unify guest accessibility checks with unified address array Jon Maloy
2026-05-25  9:38   ` David Gibson
2026-06-19 22:09   ` Stefano Brivio
2026-04-13  0:53 ` [PATCH v7 04/13] arp: Check all configured addresses in ARP filtering Jon Maloy
2026-06-19 22:10   ` Stefano Brivio
2026-04-13  0:53 ` [PATCH v7 05/13] conf: Allow multiple -a/--address options per address family Jon Maloy
2026-05-25  9:47   ` David Gibson
2026-06-19 22:10   ` Stefano Brivio
2026-04-13  0:53 ` [PATCH v7 06/13] netlink, conf: Read all addresses from template interface at startup Jon Maloy
2026-04-13  0:53 ` [PATCH v7 07/13] netlink, pasta: refactor function pasta_ns_conf() Jon Maloy
2026-05-26  1:58   ` David Gibson
2026-04-13  0:53 ` [PATCH v7 08/13] conf, pasta: Track observed guest IPv4 addresses in unified address array Jon Maloy
2026-05-27  2:46   ` David Gibson
2026-06-19 22:10   ` Stefano Brivio
2026-06-22  1:46     ` David Gibson
2026-06-24 22:56       ` Stefano Brivio [this message]
2026-04-13  0:53 ` [PATCH v7 09/13] conf, pasta: Track observed guest IPv6 " Jon Maloy
2026-05-27  3:40   ` David Gibson
2026-06-19 22:11     ` Stefano Brivio
2026-04-13  0:53 ` [PATCH v7 10/13] migrate: Update protocol to v3 for multi-address support Jon Maloy
2026-05-27  3:55   ` David Gibson
2026-06-19 22:11   ` Stefano Brivio
2026-04-13  0:53 ` [PATCH v7 11/13] dhcp: Select address for DHCP distribution Jon Maloy
2026-05-27  4:30   ` David Gibson
2026-06-19 22:11   ` Stefano Brivio
2026-04-13  0:53 ` [PATCH v7 12/13] dhcpv6: Select addresses for DHCPv6 distribution Jon Maloy
2026-05-27  4:40   ` David Gibson
2026-06-19 22:11   ` Stefano Brivio
2026-04-13  0:53 ` [PATCH v7 13/13] ndp: Support advertising multiple prefixes in Router Advertisements Jon Maloy
2026-05-27  4:52   ` David Gibson
2026-06-19 22:11   ` Stefano Brivio

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260625005659.47d0b293@elisabeth \
    --to=sbrivio@redhat.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=jmaloy@redhat.com \
    --cc=passt-dev@passt.top \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://passt.top/passt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for IMAP folder(s).