Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 21 Feb 2012 11:08:21 +0200
From:      Konstantin Belousov <kostikbel@gmail.com>
To:        Juli Mallett <jmallett@freebsd.org>
Cc:        Marcel Moolenaar <marcel@xcllnt.net>, Adrian Chadd <adrian@freebsd.org>, Brooks Davis <brooks@freebsd.org>, Luigi Rizzo <rizzo@iet.unipi.it>, net@freebsd.org
Subject:   Re: Abstracting struct ifnet
Message-ID:  <20120221090821.GE55074@deviant.kiev.zoral.com.ua>
In-Reply-To: <CACVs6=9efUMQHTr9RH9SHm=Apo0PV7NeKcwFyV%2B2k9HCFNjS9g@mail.gmail.com>
References:  <338757D1-6B1E-49CF-983F-5D5851066FD3@xcllnt.net> <20120220231601.GA51310@lor.one-eyed-alien.net> <20120221001552.GA60050@onelab2.iet.unipi.it> <CAJ-Vmoni1DHpxet08=JWSDGLFBP7MHO4-WDBLwX9vGxibR=EDA@mail.gmail.com> <CACVs6=_kTVC7tnsPJqgRq3VtUaSefkunVU8JetTdsXjGCmUT7A@mail.gmail.com> <CAJ-Vmo=T28t0XBmzmkNjOEA6wJ-Ub3Bc9DiWu1upDpBt8bM=XA@mail.gmail.com> <CACVs6=9efUMQHTr9RH9SHm=Apo0PV7NeKcwFyV%2B2k9HCFNjS9g@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--4Epv4kl9IRBfg3rk
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Mon, Feb 20, 2012 at 06:42:15PM -0800, Juli Mallett wrote:
> On Mon, Feb 20, 2012 at 18:34, Adrian Chadd <adrian@freebsd.org> 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.
>=20
> 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.
>=20
> > 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.
>=20
> 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.
>=20
> Source compatibility is the biggest win, but a little self-discipline
> to win what measure of binary compatibility we can seems perfectly
> sensible.
>=20
> (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?

You could take a look how mutexes or vm_page_locks are handled,
giving inlines for kernel proper and stable KBI for modules.

--4Epv4kl9IRBfg3rk
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (FreeBSD)

iEYEARECAAYFAk9DXwUACgkQC3+MBN1Mb4hsFwCgr0yi86G8vk6twSzE8mOuIVNU
f4AAoIYmqYiON5SYsi8i4//VuYsrEN37
=xETU
-----END PGP SIGNATURE-----

--4Epv4kl9IRBfg3rk--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120221090821.GE55074>