From owner-freebsd-arch@FreeBSD.ORG Fri Feb 27 19:19:20 2015 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EBD2F94B; Fri, 27 Feb 2015 19:19:20 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 72FECBD1; Fri, 27 Feb 2015 19:19:19 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id t1RJJHQe036826 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 27 Feb 2015 22:19:17 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id t1RJJGWq036825; Fri, 27 Feb 2015 22:19:16 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Fri, 27 Feb 2015 22:19:16 +0300 From: Gleb Smirnoff To: Mike Karels Subject: Re: Adding new media types to if_media.h Message-ID: <20150227191916.GQ17947@glebius.int.ru> References: <20150226230031.GN17947@glebius.int.ru> <201502270417.t1R4H37Y058057@mail.karels.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201502270417.t1R4H37Y058057@mail.karels.net> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: "freebsd-net@freebsd.org" , Eric Joyner , Jack Vogel , "freebsd-arch@freebsd.org" X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Feb 2015 19:19:21 -0000 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.