Re: rt_refcnt and rtentry protection ??

2003-01-08 Thread Vincent Jardin
> > So long as the route is marked RTF_UP, it cannot be deleted. In a > single-threaded kernel, it is not possible for this code to be > preempted, so there is no means by which the route flags could be > changed. (RTF_UP is unset when and only when the route is deleted > from the radix tree.) I

Re: rt_refcnt and rtentry protection ??

2003-01-08 Thread Jeffrey Hsu
if (rt->rt_flags & RTF_GATEWAY) /* XXX How can we be sure that rt won't be freeed by any other kernel thread now ?? XXX */ > Why is rt_refnt decreased so early and not later ? In the non-SMP kernel, the kernel can't be preempted so anothe

Re: rt_refcnt and rtentry protection ??

2003-01-08 Thread Garrett Wollman
< said: > Why is rt_refnt decreased so early and not later ? So long as the route is marked RTF_UP, it cannot be deleted. In a single-threaded kernel, it is not possible for this code to be preempted, so there is no means by which the route flags could be changed. (RTF_UP is unset when and only

Re: rt_refcnt and rtentry protection ??

2003-01-08 Thread Vincent Jardin
> > The roadmap for locking up the IP stack looks like roughly like ifaddr > ref counts, ifnet list, routing radix tree, ARP, ifaddr uses, and rtentry. However, it seems that the rtentries' rt_refcnt are not used like ifaddr, ifnet, ... It looks like something dirty has been done a long time ago

Re: rt_refcnt and rtentry protection ??

2003-01-08 Thread Jeffrey Hsu
rtentry will get its own lock. The roadmap for locking up the IP stack looks like roughly like ifaddr ref counts, ifnet list, routing radix tree, ARP, ifaddr uses, and rtentry. I'm a little over 3/5 of the way done along this path. Jeffrey

rt_refcnt and rtentry protection ??

2003-01-08 Thread Vincent Jardin
/* * Lookup or enter a new address in arptab. */ static struct llinfo_arp * arplookup(addr, create, proxy) u_long addr; int create, proxy; { register struct rtentry *rt; static struct sockaddr_inarp sin = {sizeof(sin), AF_INET }; const char *why = 0;