From owner-freebsd-net@FreeBSD.ORG Tue Feb 21 02:34:37 2012 Return-Path: Delivered-To: net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6ACE6106566C; Tue, 21 Feb 2012 02:34:37 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-wi0-f182.google.com (mail-wi0-f182.google.com [209.85.212.182]) by mx1.freebsd.org (Postfix) with ESMTP id 9A2A98FC08; Tue, 21 Feb 2012 02:34:36 +0000 (UTC) Received: by wibhn14 with SMTP id hn14so5149840wib.13 for ; Mon, 20 Feb 2012 18:34:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=78TlP/oOPs+Ka0eiGptwP/Ifoy2UpEHva9/lZJY3Sz8=; b=AREBx+mvrd3CqSkilsvCQV0QkASg5TS3YIgwVkbwxBOdB6qL5eX+nInpDOjJFStuOS JIiZ8EXnvezOlI9D3x2otPYhjUKC4zLRdX2ctEX2vmV2AMgiAOldgx5dgcCQnMOlKk14 RNpsv3hTlHwuKddwCi4dDA+NzpFLrNUwmVpNI= MIME-Version: 1.0 Received: by 10.180.95.1 with SMTP id dg1mr18009870wib.21.1329791675696; Mon, 20 Feb 2012 18:34:35 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.216.154.199 with HTTP; Mon, 20 Feb 2012 18:34:35 -0800 (PST) In-Reply-To: References: <338757D1-6B1E-49CF-983F-5D5851066FD3@xcllnt.net> <20120220231601.GA51310@lor.one-eyed-alien.net> <20120221001552.GA60050@onelab2.iet.unipi.it> Date: Mon, 20 Feb 2012 18:34:35 -0800 X-Google-Sender-Auth: U21Xb_dQEXHgsXmzVgkDb8Zspdc Message-ID: From: Adrian Chadd To: Juli Mallett Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: net@freebsd.org, Brooks Davis , Luigi Rizzo , Marcel Moolenaar Subject: Re: Abstracting struct ifnet X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Feb 2012 02:34:37 -0000 On 20 February 2012 18:21, Juli Mallett wrote: > > It's not just about Juniper, though, it's about us, and how much this > buys us. =A0Using inlines buys us some source compatibility and the > ability to add some invariants, but is no different to macros in terms > of KBI within a version of FreeBSD, or between versions. =A0We can't > make ifnet opaque with inlines. =A0Adding a member to ifnet which is > opaque[*] and which has the fields most likely to change in size, > order, existence, etc., and leaving a few that are needed in the fast > path and will be used by macros/inlines is probably where we should > end up. > > *: Obviously ifnet should be a value member of the opaque type, and > the ifnet should include a pointer to the opaque type, or something > like that, since you can't make an opaque struct a value member, which > is probably obvious, but I wanted to be clearish. Is the target though _binary_ compatibility? Just having a blessed method of doing accessor method things will buy more source flexibility. The KBI can stay the same in the default case and IMHO this kind of thing gives developers more power to do smart invariant and debugging things. Being able to say "inform me every time an interface flag changes" would actually be kind of nice when debugging some of the issues i've been facing with ath. I've been half tempted to do this -inside- the ath driver, partially to restore the OS portability it once tried to achieve. Adrian