Subject: Re: ifnet specific data
To: Matt Thomas <>
From: Bill Studenmund <>
List: tech-net
Date: 09/18/2006 12:36:50
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sat, Sep 16, 2006 at 09:33:52AM -0700, Matt Thomas wrote:
> On Sep 16, 2006, at 6:33 AM, Martin Husemann wrote:
> >On Sat, Sep 16, 2006 at 08:27:44PM +0900, YAMAMOTO Takashi wrote:
> >>	ifnet_specific_key_t ifnet_specific_key_create(void);
> >>	void ifnet_specific_key_destroy(ifnet_specific_key_t);
> >>	void *ifnet_getspecific(struct ifnet *, ifnet_specific_key_t);
> >>	void ifnet_setspecific(struct ifnet *, ifnet_specific_key_t, void =20
> >>*);
> >
> >How about doing something like
> >
> >	prop_dictionary_t dv_properties;/* properties dictionary */
> >
> >in struct device instead? That way we could have an analogon to
> >device_properties(), like ifnet_properties().
> Only if specifickey won't be used in interrupt mode.  and most network
> stuff is in hard or soft interrupt mode.

Yes & no. What we could do is have the dictionary and have shadow=20
variables. Change the dict, and the shadow variables change too. Think of=
these variables as caching the result of key lookups. While we can't look=
in the dictionary in interrupt context, if we do it right, we _can_ look=20
at the shadow variables. Put another way, as long as we don't do it wrong,=
we can read the shadow variables.

This does mean we need to know when the dictionary changes (as long as the=
driver gets called, not hard). Also, it means that the dictionary can't=20
contain state that needs gathering at interrupt context. Though I doubt=20
anyone would use a properties dictionary for that. :-)

Take care,


Content-Type: application/pgp-signature
Content-Disposition: inline

Version: GnuPG v1.4.3 (NetBSD)