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=202410 header.b=mN2Uo6bG; dkim-atps=neutral Received: from mail.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by passt.top (Postfix) with ESMTPS id B86DB5A004E for ; Thu, 24 Oct 2024 06:59:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202410; t=1729745963; bh=IzpaA3mwLNsu540NzJxc+nmpK5M+VeIGBik2yoZsnPs=; h=From:To:Cc:Subject:Date:From; b=mN2Uo6bG6cNWVzZ5BYRFMcaM1mduU9VaHjp/D7meSAsQrSpTvT+HZztSeCBUQ8a9+ KPYJUDmXddaCn75bCQnvVKSlPv6h6Qjrqpmr/1qRsKTPfcvOXEXbU8mP/8BARLCNhd SQoOm5V73dzZv49qIAgAoVJ4WfUnMqBuFc3mN/q4kC82zBzMutdxt1/E26scUkXEKw ttLGKsrbdLuyp1w6mJ8yMsc0wH0p3kDwjx1ij2Apo5hPx+H4lYUwm5KINnl+HXjXq+ luTs7RO7WXyasl7fq2LsCRI+PzcwRzINSGVreqNdv7ywWhfaeUz4o9ul45+1jHXbty hUqaQdVAOvHRA== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4XYtxR1VqZz4wxm; Thu, 24 Oct 2024 15:59:23 +1100 (AEDT) From: David Gibson To: passt-dev@passt.top, Stefano Brivio Subject: [PATCH v2 0/3] tcp: Runtime checks for availability of TCP_INFO fields Date: Thu, 24 Oct 2024 15:59:19 +1100 Message-ID: <20241024045922.3900584-1-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.47.0 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: WDDGVOWK3P24AWAWSQDSSRSH2BSXBRBN X-Message-ID-Hash: WDDGVOWK3P24AWAWSQDSSRSH2BSXBRBN 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: David Gibson 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: We have a number of Makefile tests for the presence of various fields in tcp_info. However that only tells us if they're present in the kernel headers against which we're compiling, not whether they're available in the kernel we're running on. For anything outside the earliest forms of TCP_INFO (as described in netinet/tcp.h and shared with BSD), we should verify at runtime if the kernel is returning that information. This was supposed to be leading into improved handling of lazily calling TCP_INFO, but I hit additional complications there, so I've postponed it. Might as well get these bits merged, though. v2: * Previous version removed some #ifdefs that were still needed. Simply putting them back leads to awkward duplication between the "compile time missing" and "run time missing" cases, so take a different approach which allows us to remove all of them. * Some wording changes David Gibson (3): tcp: Remove compile-time dependency on struct tcp_info version tcp: Generalise probing for tcpi_snd_wnd field tcp: Use runtime tests for TCP_INFO fields Makefile | 15 ------- tcp.c | 114 ++++++++++++++++++++++------------------------ tcp_info.h | 120 +++++++++++++++++++++++++++++++++++++++++++++++++ tcp_internal.h | 4 +- 4 files changed, 176 insertions(+), 77 deletions(-) create mode 100644 tcp_info.h -- 2.47.0