From owner-freebsd-current@FreeBSD.ORG Tue Sep 9 10:37:24 2014 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 55542636 for ; Tue, 9 Sep 2014 10:37:24 +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 C7F091B2 for ; Tue, 9 Sep 2014 10:37:22 +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 s89AbJ8f044560 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 9 Sep 2014 14:37:19 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id s89AbJJX044559; Tue, 9 Sep 2014 14:37:19 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Tue, 9 Sep 2014 14:37:19 +0400 From: Gleb Smirnoff To: Luigi Rizzo Subject: Re: RFC: please put back spare fields in struct ifnet (removed in svn 270870) Message-ID: <20140909103719.GB17059@glebius.int.ru> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Cc: George Neville-Neil , FreeBSD Current , Stefano Garzarella X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Sep 2014 10:37:24 -0000 Luigi, On Tue, Sep 09, 2014 at 12:13:42PM +0200, Luigi Rizzo wrote: L> svn 270870 removed all the if_*spare fields in struct ifnet. L> They are replaced with the following comment L> L> /* L> * Spare fields to be added before branching a stable branch, so L> * that structure can be enhanced without changing the kernel L> * binary interface. L> */ L> L> ​which leaves me a bit unhappy. L> Having a stable ABI is useful not only for stable branches, L> but also (I would say even more) with head, so people can L> run experimental code with limited modifications to the sources. L> L> Cases in point: L> - we used one spare field extensively when experimenting L> with netmap, and being able to just build a module without having L> to recompile the whole kernel was a big win. L> - we are developing some software GSO and again it was great to have L> the spares in the tcpcb and in the ifnet so we could limit L> modifications to headers used by multiple sources. L> L> I would kindly suggest to put the spares back. L> I can't see how they can possibly harm. The harm is obvious: someone commits code that _uses_ spare field without assigning it a new name. Spare field is a placeholder. Of course you can use it while you experiment. However, I don't see problem with patching your source tree where you experiment. The ABI plan for 'struct ifnet' is that the struct becomes opaque for device drivers. So its size and alignment no longer matters. Those who want to add new fields to struct ifnet, would also need to add accessor methods. Bits of this plan are already committed by Marcel, but its only first step. I'm afraid that if fields are there back, the situation that happened with netmap (use of spare field) would repeat. -- Totus tuus, Glebius.