From owner-freebsd-current@FreeBSD.ORG Tue Sep 9 11:01:17 2014 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F0047287; Tue, 9 Sep 2014 11:01:16 +0000 (UTC) Received: from mail-la0-x231.google.com (mail-la0-x231.google.com [IPv6:2a00:1450:4010:c03::231]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 39CE96E6; Tue, 9 Sep 2014 11:01:16 +0000 (UTC) Received: by mail-la0-f49.google.com with SMTP id b17so19073911lan.22 for ; Tue, 09 Sep 2014 04:01:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=9MUqWfJJuxSQU/+IGUvDsJ/qX3Cj2/2bnC2WI3r/sns=; b=HdGEW46viOfcM+NFP/P7D6I+2WxfiJeQhfkcsZ5DCUxkFXiQIY3i0YXUhIjKTpW42J vheusx9JPa1EMDWHse03R58JanMxNsFkrAY+C8PPGA9V5QGDUA3gOVRgr+h5KVweQTQc 2ZxsJ9C5tKphdEAH3KXGWe9SFJ+qswQWvl35P7B0tehJ0QXeKIHW9HHfHDwQKooxMNDl q8DJidy6lf/bHKBfBGp2HJVxQu/Y3T138W50F2E4Yhe4kq4m0rRhY9z3GMTbdWkPgN7X L/Fb1Cw0oEJsveEZhciD4l7+fW8zg/kbM56bRaW0ycwMAx+2Wr/P8uVZE+1X7mNx/gEh tC8A== MIME-Version: 1.0 X-Received: by 10.112.130.101 with SMTP id od5mr33254511lbb.76.1410260473970; Tue, 09 Sep 2014 04:01:13 -0700 (PDT) Sender: rizzo.unipi@gmail.com Received: by 10.114.26.37 with HTTP; Tue, 9 Sep 2014 04:01:13 -0700 (PDT) In-Reply-To: <20140909103719.GB17059@glebius.int.ru> References: <20140909103719.GB17059@glebius.int.ru> Date: Tue, 9 Sep 2014 13:01:13 +0200 X-Google-Sender-Auth: 51kn4HFxsS9QR60eJGrxZ4E5LyI Message-ID: Subject: Re: RFC: please put back spare fields in struct ifnet (removed in svn 270870) From: Luigi Rizzo To: Gleb Smirnoff Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 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 11:01:17 -0000 On Tue, Sep 9, 2014 at 12:37 PM, Gleb Smirnoff wrote: > 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> =E2=80=8Bwhich 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 problem with _not_ having spares is that you have to recompile everything after patching the headers. With the spares, i could make netmap a simple add-on kernel module with no dependencies. Same on linux for what matters (there wasn't a spare there, but nobody used ax25 and i could check and reuse it). Of course you can easily emulate extension fields for stuff that is not accessed frequently (tough a version number would help), but there are cases when you do need the extra info on a per-packet basis. > 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. > =E2=80=8Bspare fields <-> spare accessors=E2=80=8B > I'm afraid that if fields are there back, the situation that > happened with netmap (use of spare field) would repeat. > =E2=80=8Bthe spare pointer used by netmap was clearly indicated by a commen= t, and giving it a dedicated name instead of if_pspare[0] was expected to happen (hopefully together with a __FreeBSD_version bump, which has not happened). I am not worried that the name change was missed when deleting if_pspare[]. Mistakes happen and the error was promptly corrected (apart from the version bump). What worries me is losing some flexibility in dealing with out-of-tree kernel modules. =E2=80=8Bcheers luigi=E2=80=8B