Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

need clarifications on net/radix.c usage

0 views
Skip to first unread message

Luigi Rizzo

unread,
Dec 14, 2009, 2:50:58 AM12/14/09
to cur...@freebsd.org
Hi,
i am revising the code in net/radix.c and there are a few
things that are not completely clear to me and I would like
to understand and possibly fix.

I know that this code has been untouched in 15 years so it
probably reflects old requirements or design ideas that have
changed since then.

Initial list of things:

- struct radix_node_head has a number of fields that are never used
(rnh_addpkt and friends, rnh_addrsize, rnh_pktsize)
Unless there are objections I'd like to remove the unused fields.

- there are some static variables in radix.c (max_keylen, mask_rnhead,
the freelist, the allzero and allone masks, 'last_zeroed' in a function)
which would probably deserve becoming members of radix_node_head,
last not least for correctness of operation -- some of those fields
are read-write, but there are now multiple instances of radix_node_head
running under different locks.
Again, if there are no objections, I'd like to move those variables
into radix_node_head.

cheers
luigi

_______________________________________________
freebsd...@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-curre...@freebsd.org"

Bjoern A. Zeeb

unread,
Dec 15, 2009, 4:56:39 AM12/15/09
to Luigi Rizzo, FreeBSD current mailing list
On Mon, 14 Dec 2009, Luigi Rizzo wrote:

Hi Luigi,

> Hi,
> i am revising the code in net/radix.c and there are a few
> things that are not completely clear to me and I would like
> to understand and possibly fix.
>
> I know that this code has been untouched in 15 years so it
> probably reflects old requirements or design ideas that have
> changed since then.
>
> Initial list of things:
>
> - struct radix_node_head has a number of fields that are never used
> (rnh_addpkt and friends, rnh_addrsize, rnh_pktsize)
> Unless there are objections I'd like to remove the unused fields.
>
> - there are some static variables in radix.c (max_keylen, mask_rnhead,
> the freelist, the allzero and allone masks, 'last_zeroed' in a function)
> which would probably deserve becoming members of radix_node_head,
> last not least for correctness of operation -- some of those fields
> are read-write, but there are now multiple instances of radix_node_head
> running under different locks.
> Again, if there are no objections, I'd like to move those variables
> into radix_node_head.

I think the chances to get feedback on this might be better on net@.

/bz

--
Bjoern A. Zeeb It will not break if you know what you are doing.

0 new messages