From owner-freebsd-net@FreeBSD.ORG Sat Apr 18 21:09:53 2015 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 153C5C9E for ; Sat, 18 Apr 2015 21:09:53 +0000 (UTC) Received: from mail-pa0-x22c.google.com (mail-pa0-x22c.google.com [IPv6:2607:f8b0:400e:c03::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DC161195 for ; Sat, 18 Apr 2015 21:09:52 +0000 (UTC) Received: by pacyx8 with SMTP id yx8so163197993pac.1 for ; Sat, 18 Apr 2015 14:09:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:subject:message-id:mime-version:content-type :content-disposition:user-agent; bh=BAxon2ki+qTESVk6jsr0xX0UWLiRbaji+aFRQOksKdE=; b=IO4f2aTSCo/bY7uhdcQDXK7/5Sdaf+Ic3rdLL7XLa4/uZJ5b+rkJlq74ifEit52ygL 87YH7aDVOxo2OU7Fw5UNva3PEf4UDMzUzvyHqVP/KeIItPcAfOuAM+JmNj4rUY5ha2hw vW9fSCkC3gJ9QJE8VUwQa4cLTdxVxv0HeVVxFHX2HLXqRWl5aGkN91gOAzxAqjdmNBhu wmH/w/wNI6Ttf8LB5cLUxN2OE2o+su+cQG/5Tz28U8wtxJ86mQFhP2Oollv+k8aMM3pl 7S3vhb0wYKnllEdlrGuvyGqHnGhUABNrBNNbVPHaETJDrPAfiGmvdISG/0uQ5HHaclVb WZfQ== X-Received: by 10.67.3.195 with SMTP id by3mr15951072pad.109.1429391392455; Sat, 18 Apr 2015 14:09:52 -0700 (PDT) Received: from charmander.west.isilon.com ([104.232.114.184]) by mx.google.com with ESMTPSA id qv9sm13833237pab.27.2015.04.18.14.09.50 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 18 Apr 2015 14:09:51 -0700 (PDT) Sender: Mark Johnston Date: Sat, 18 Apr 2015 14:08:56 -0700 From: Mark Johnston To: freebsd-net@FreeBSD.org Subject: moving struct bpf_if to bpf.c Message-ID: <20150418210855.GA50409@charmander.west.isilon.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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: Sat, 18 Apr 2015 21:09:53 -0000 Hello, At the moment, bpf.h defines struct bpf_if differently depending on whether BPF_INTERNAL is #defined. This causes problems with CTF, as it results in a sort of bifurcation within the type graph: CTF sees two different struct bpf_ifs, and so every struct/union containing a struct bpf_if is duplicated, and so on. CTF currently imposes a limit of 2^15 distinct types within a container, and several people have been running into this limit. The type duplication exacerbates this problem. The change here fixes the issue by moving the definition of struct bpf_if to bpf.c, and making its externally-used fields available via struct bpf_if_ext: https://reviews.freebsd.org/D2319 In particular, the ext fields are at the same offsets within struct bpf_if as before, so this change should have no functional impact. Moreover, it reduces the number of types from 20879 to 15725 with my (stripped-down) kernel config on amd64. Would anyone be willing to review the proposed change? I've also placed the raw diff here: https://people.freebsd.org/~markj/patches/bpf_entrails.diff Thanks, -Mark