From owner-freebsd-current@FreeBSD.ORG Wed Jun 8 05:49:24 2011 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1D2071065670 for ; Wed, 8 Jun 2011 05:49:24 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: from onelab2.iet.unipi.it (onelab2.iet.unipi.it [131.114.59.238]) by mx1.freebsd.org (Postfix) with ESMTP id DB6DB8FC0C for ; Wed, 8 Jun 2011 05:49:23 +0000 (UTC) Received: by onelab2.iet.unipi.it (Postfix, from userid 275) id 3178E7300A; Wed, 8 Jun 2011 08:05:32 +0200 (CEST) Date: Wed, 8 Jun 2011 08:05:32 +0200 From: Luigi Rizzo To: current@freebsd.org Message-ID: <20110608060532.GA18045@onelab2.iet.unipi.it> References: <20110607061417.GA5483@onelab2.iet.unipi.it> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110607061417.GA5483@onelab2.iet.unipi.it> User-Agent: Mutt/1.4.2.3i Cc: Subject: IFCAP_CANTCHANGE ? (Re: RFC: need one IFCAP bit for NETMAP) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 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: Wed, 08 Jun 2011 05:49:24 -0000 On Tue, Jun 07, 2011 at 08:14:17AM +0200, Luigi Rizzo wrote: > hi, > in order to import netmap support into the tree (see > http://info.iet.unipi.it/~luigi/netmap ), i need > to use one of the if_cap{abilities|enable} bits to report > that the interface supports this mode and record whether > the mode is enabled or not. > > Bit 0x100000 is currently the first unused bit so if > there are no objections i will add the following > to sys/net/if.h > > #define IFCAP_NETMAP 0x100000 /* netmap mode supported/enabled */ > > and the following change to sbin/ifconfig/ifconfig.c > > -"\21VLAN_HWFILTER\23VLAN_HWTSO\24LINKSTATE" > +"\21VLAN_HWFILTER\23VLAN_HWTSO\24LINKSTATE\25NETMAP" > > That's all you need, as netmap mode is not supposed to be > set from sbin/ifconfig. speaking of which, it occurs to me that while we have a "CANTCHANGE" category for interface flags, we don't have one for capabilities. Would it be ok to add one ? Looking at the list in if.h, for example, it seems to me that things like IFCAP_LINKSTATE or IFCAP_VLAN_MTU or IFCAP_JUMBO_MTU shouldn't be modifiable through SIOCSIFCAP. Of course if would be best to separate CANTCHANGE bits from those that can be modified through ioctls, but that would apply to interface flags as well, and i don't think it can be done due to API change issues. cheers luigi