From owner-freebsd-net@FreeBSD.ORG Mon Apr 20 19:26:25 2015 Return-Path: Delivered-To: freebsd-net@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A574A8E4; Mon, 20 Apr 2015 19:26:25 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id F3BC53E6; Mon, 20 Apr 2015 19:26:21 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id t3KJQIM6060312 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 20 Apr 2015 22:26:18 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id t3KJQIx4060311; Mon, 20 Apr 2015 22:26:18 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Mon, 20 Apr 2015 22:26:18 +0300 From: Gleb Smirnoff To: Mark Johnston Cc: freebsd-net@FreeBSD.org Subject: Re: moving struct bpf_if to bpf.c Message-ID: <20150420192618.GY883@FreeBSD.org> References: <20150418210855.GA50409@charmander.west.isilon.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150418210855.GA50409@charmander.west.isilon.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Apr 2015 19:26:25 -0000 On Sat, Apr 18, 2015 at 02:08:56PM -0700, Mark Johnston wrote: M> At the moment, bpf.h defines struct bpf_if differently depending on M> whether BPF_INTERNAL is #defined. This causes problems with CTF, as it M> results in a sort of bifurcation within the type graph: CTF sees two M> different struct bpf_ifs, and so every struct/union containing a struct M> bpf_if is duplicated, and so on. CTF currently imposes a limit of 2^15 M> distinct types within a container, and several people have been running M> into this limit. The type duplication exacerbates this problem. M> M> The change here fixes the issue by moving the definition of M> struct bpf_if to bpf.c, and making its externally-used fields M> available via struct bpf_if_ext: https://reviews.freebsd.org/D2319 M> M> In particular, the ext fields are at the same offsets within struct M> bpf_if as before, so this change should have no functional impact. M> Moreover, it reduces the number of types from 20879 to 15725 with my M> (stripped-down) kernel config on amd64. Would anyone be willing to M> review the proposed change? I've also placed the raw diff here: M> https://people.freebsd.org/~markj/patches/bpf_entrails.diff What actual software needs to look at struct bpf_if? I wonder if we can fix the software and hide the struct bpf_if into kernel entirely. -- Totus tuus, Glebius.