Date: Fri, 21 Feb 2025 00:35:17 +0000 From: Paul Vixie <paul@redbarn.org> To: freebsd-net@freebsd.org Cc: freebsd-net@freebsd.org, Santiago Martinez <sm@codenetworks.net>, Jamie Landeg-Jones <jamie@catflap.org>, Mark Johnston <markj@freebsd.org> Subject: Re: fibnum2.diff (Re: per-FIB socket binding) Message-ID: <2299619.iZASKD2KPV@localhost> In-Reply-To: <Z7dcrX8rJ0OD1vEJ@nuc> References: <7772475.EvYhyI6sBW@dhcp-151.access.rits.tisf.net> <2522290.jE0xQCEvom@localhost> <Z7dcrX8rJ0OD1vEJ@nuc>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thursday, February 20, 2025 4:47:41 PM UTC Mark Johnston wrote: > On Tue, Feb 18, 2025 at 05:16:07AM +0000, Paul Vixie wrote: > > this is the second fibnum patch, ... > > The high-level changes seem to be: > - If a TCP listening socket's FIB is 0, then the FIB of incoming > connections matched to that socket will be the FIB of the interface on > which the initial SYN was received. > - When a socket is bound to a specific address, its FIB is set to the > FIB of the interface which owns the address. yes. > The logic seems reasonable to me. > > The handling of the second point seems incomplete: it doesn't update the > FIB number stored in the socket itself. Gleb and I talked a bit about > eliminating that field entirely so that there's only one source of > truth, and I think we'll eventually do that, but in the meantime, > in_pcbbind() needs to update so_fibnum as well. the real fix is to not have an architecture that requires things like this in in_pcballoc(), which triggered a Hairball Alert during the fibnum2 work: > inp->inp_pcbinfo = pcbinfo; > inp->inp_socket = so; > inp->inp_cred = crhold(so->so_cred); > inp->inp_inc.inc_fibnum = so->so_fibnum; i'm totally willing to floss all of this out and get us down to a single source of truth if there are willing reviewers for it. meanwhile, i'll add the corresponding logic to in_pcbbind(), with an XXX marker. > > comments, questions, and especially testing results would be very welcome. > > This patch doesn't apply to main. Did you write it against stable/14? i've been working in a 14.2 context but i'll foreport and test. thanks for engaging. -- Paul Vixie
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?2299619.iZASKD2KPV>
