From nobody Fri Feb 21 00:35:17 2025 X-Original-To: freebsd-net@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YzWPW4ml0z5nfXf for ; Fri, 21 Feb 2025 00:35:27 +0000 (UTC) (envelope-from paul@redbarn.org) Received: from util.redbarn.org (util.redbarn.org [24.104.150.222]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "*.redbarn.org", Issuer "RapidSSL TLS RSA CA G1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YzWPV1SN4z3lg7; Fri, 21 Feb 2025 00:35:26 +0000 (UTC) (envelope-from paul@redbarn.org) Authentication-Results: mx1.freebsd.org; none Received: from family.redbarn.org (family.redbarn.org [24.104.150.213]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "*.redbarn.org", Issuer "RapidSSL TLS RSA CA G1" (not verified)) by util.redbarn.org (Postfix) with ESMTPS id 4BBFB160C24; Fri, 21 Feb 2025 00:35:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=redbarn.org; s=util; t=1740098118; bh=ueNLGF6coGwVeOdUnsukTnuybtWdtWMtHxY3BAE8YXI=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=FNRnhB/95uWMj/hXHoyijU/beBkwMQUFLdAqxdPqezls5GIaJi7CQhFtxfI17uB1b oE5/2R/XYIzlIBrEJoGht38tpcxi9e9rTKcA9Ds1RG9Wbjp5BhO/7VLc22jKdJgo3A Y5pwfd0xzc1vNWNuzINEsU8uwFmTKbGxL3l00by0= Received: from localhost.localnet (unknown [IPv6:2600:1010:b038:b2c1:7626:419f:cc30:d59f]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by family.redbarn.org (Postfix) with ESMTPSA id D61D1C3F10; Fri, 21 Feb 2025 00:35:17 +0000 (UTC) From: Paul Vixie To: freebsd-net@freebsd.org Cc: freebsd-net@freebsd.org, Santiago Martinez , Jamie Landeg-Jones , Mark Johnston Subject: Re: fibnum2.diff (Re: per-FIB socket binding) Date: Fri, 21 Feb 2025 00:35:17 +0000 Message-ID: <2299619.iZASKD2KPV@localhost> Organization: FW In-Reply-To: References: <7772475.EvYhyI6sBW@dhcp-151.access.rits.tisf.net> <2522290.jE0xQCEvom@localhost> List-Id: Networking and TCP/IP with FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-net List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-net@FreeBSD.org MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:33651, ipnet:24.104.150.0/24, country:US] X-Rspamd-Queue-Id: 4YzWPV1SN4z3lg7 X-Spamd-Bar: ---- 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