From owner-freebsd-net@FreeBSD.ORG Tue Feb 21 02:42: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 374D9106566B; Tue, 21 Feb 2012 02:42:37 +0000 (UTC) (envelope-from juli@clockworksquid.com) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id 60C588FC08; Tue, 21 Feb 2012 02:42:35 +0000 (UTC) Received: by wgbdq11 with SMTP id dq11so5112957wgb.31 for ; Mon, 20 Feb 2012 18:42:35 -0800 (PST) Received: by 10.180.101.200 with SMTP id fi8mr17989688wib.20.1329792155213; Mon, 20 Feb 2012 18:42:35 -0800 (PST) MIME-Version: 1.0 Sender: juli@clockworksquid.com Received: by 10.227.209.78 with HTTP; Mon, 20 Feb 2012 18:42:15 -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> From: Juli Mallett Date: Mon, 20 Feb 2012 18:42:15 -0800 X-Google-Sender-Auth: WEo7rScUTeawExAudPSs_NMW-sw Message-ID: To: Adrian Chadd Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQkJ5J82eUrB0nl6tjmsz1Gp4oC3U6ZDwkf8r8/YToIIPfwR3IDyayGJIt9p0dztUWA0HABO 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:42:37 -0000 On Mon, Feb 20, 2012 at 18:34, Adrian Chadd wrote: > 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. KBI compatibility requires very little discipline and makes loadable modules for network drivers much less hellish. Inlines, macros and full visibility of ifnet in -current may be useful, but unless there's a performance reason for doing so, retaining KBI compatibility *and* the ability to merge ifnet changes to -stable sounds pretty nice to me. > 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. I think that it is rare that this is useful in debugging, and something of a red herring. Even invariants are almost a red herring: really, we shouldn't be using these individual methods to tweak structure fields, either, we should have a way of describing a network driver more semantically, such that the invariants are richer and also not as complicated, and also more comprehensive. Source compatibility is the biggest win, but a little self-discipline to win what measure of binary compatibility we can seems perfectly sensible. (And at some point, we could even replace ifnet with something that's less of a strange grab bag assortment that's awkward to explain to new driver writers, and keep both source and binary compatibility for a reasonable period in doing so. Unlikely to happen in the near term, but wouldn't it be nice?