removal of unused and redundant fields in 'struct ifnet'

Luigi Rizzo rizzo at icir.org
Sat Apr 3 13:39:15 PST 2004


Hi,
in -current, I am about to remove the following unused fields from
'struct ifnet', hope there are no objections:

-       int     (*if_done)              /* output complete routine */
-               (struct ifnet *);       /* (XXX not used; fake prototype) */
-       int     (*if_poll_recv)         /* polled receive routine */
-               (struct ifnet *, int *);
-       int     (*if_poll_xmit)         /* polled transmit routine */
-               (struct ifnet *, int *);
-       void    (*if_poll_intren)       /* polled interrupt reenable routine */
-               (struct ifnet *);
-       void    (*if_poll_slowinput)    /* input routine for slow devices */
-               (struct ifnet *, struct mbuf *);
-       struct  ifqueue *if_poll_slowq; /* input queue for slow devices */

On passing, i also note that the following fields are only used by IPv6,
and they seem quite redundant (and space-consuming! AF_MAX is 36)

        struct  ifprefixhead if_prefixhead; /* list of prefixes per if */
        void    *if_afdata[AF_MAX];
        int     if_afdata_initialized;
        struct  mtx if_afdata_mtx;

I suppose all of this could go into a 'struct inet6_data *', using
the lock on the struct ifnet for the initial creation,
and an additional lock inside the struct for specific ops.
While this is not a change i plan to make soon, at some point in
the future I would like to fix this too.

comments ?

	cheers
	luigi


More information about the freebsd-net mailing list