Zbr's days.
March
Sun Mon Tue Wed Thu Fri Sat
       
20
2007
Months
Mar

About TODO Blog RSS Old blog Projects Gallery Notes

Tue, 20 Mar 2007

My brain has exploded.


But initial part of the multidimensional trie lookup algorithm has been added into TCP, UDP, RAW and netlink sockets.
They share the same trie with 160 bits search key (128 actual data bits).
Tree does not compile yet, but there are only couple of function missed - raw sockets lookup, time-wait socket insert/delete, and port free function (read: old inet_put_port()). First two tasks (raw socket lookup and timewait sockets) only need to a simple wrappers to create searching key out of appropriate structures, like:

	u32 key[5] = {tw->tw_rcv_saddr, tw->tw_daddr, (tw->sport<<16)|tw->dport, 
		(sk->sk_bound_dev_if & 0x00ffffff) | (IPPROTO_TCP << 24), 0};

	err = mdt_insert(&mdt_root, key, sizeof(key)<<3, sk, GFP_ATOMIC);
	...
	err = mdt_remove(&mdt_root, key, sizeof(key)<<3);
Code has terrible number of the ugliest set of ifdefs, it does not support procfs and netlink statistics (due to absence of the code to get all sockets), btw, the latter traverses over the whole hash table to get socket info, which is way too unoptimal, it is likely too broken, and (as it does not even compile) I have not even booted it, but I think that what has been done is a serious task.

/devel/networking :: Link / Comments (0)

Please solve this captcha to be allowed to post (need to reload in a minute): 72 + 92

Comments are closed for this story.