Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 27 Feb 2015 22:19:16 +0300
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        Mike Karels <mike@karels.net>
Cc:        "freebsd-net@freebsd.org" <freebsd-net@freebsd.org>, Eric Joyner <ricera10@gmail.com>, Jack Vogel <jfvogel@gmail.com>, "freebsd-arch@freebsd.org" <freebsd-arch@freebsd.org>
Subject:   Re: Adding new media types to if_media.h
Message-ID:  <20150227191916.GQ17947@glebius.int.ru>
In-Reply-To: <201502270417.t1R4H37Y058057@mail.karels.net>
References:  <20150226230031.GN17947@glebius.int.ru> <201502270417.t1R4H37Y058057@mail.karels.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Feb 26, 2015 at 10:17:03PM -0600, Mike Karels wrote:
M> > M> I'm not sure what would be different about your approach; you mentioned "n"
M> > M> versions rather than "x" versions of the ioctls, but I don't know what you
M> > M> have in mind for encoding.  Any compatible version would be limited to int.
M> 
M> > The difference is that I suggest to go with a completely new interface. Yep,
M> > as you say, if_media is basically wrong. So new ioctl will use new non-wrong
M> > structure as argument.
M> 
M> I think that part of the wrongness of if_media is to try to create a
M> one-size-fits-all-network-types interface.  If the replacement is a
M> single ioctl, I don't think it's enough of an improvement to break
M> the driver KPI.

The KPI for drivers in 11 will be changed very significantly anyway[1], so
right now we got a chance to make everything properly. Why not to utilize
this chance for ifmedia? Imagine you do this from scratch, and implement
it the right way. And this way it will go into 11. Then shims for 10-merge
can be done. And it would be okay if shims look ugly, since we won't
take them with us into the future.

M> > And we achieve new feature in 10.2 by merging new ioctl back there, where
M> > it will coexist with old unmodified interface. While in head, we no longer
M> > need to carry forth the wrong if_media.
M> 
M> I would think that this would be a huge problem for driver modules.

Why huge? The new functionality is required for a couple of drivers only.
And module KPI is guaranteed to be forward compatible only: one can load
older module on newer kernel, but not vice versa. So, if newer module
requires some functionality from the kernel, its entirely okay.

M> And I think the old if_media will need to be supported for the user-level
M> API for some time, unless someone is going to fix a lot of ports.
M> 
M> Also, many of us are backporting much before 10.2.

Of course old if_media API should remain for ports.

[1] See projects/ifnet subversion branch.

-- 
Totus tuus, Glebius.



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