tipc: Convert node object array to a hash table

Replaces the dynamically allocated array of pointers to the cluster's
node objects with a static hash table. Hash collisions are resolved
using chaining, with a typical hash chain having only a single node,
to avoid degrading performance during processing of incoming packets.
The conversion to a hash table reduces the memory requirements for
TIPC's node table to approximately the same size it had prior to
the previous commit.

In addition to the hash table itself, TIPC now also maintains a
linked list for the node objects, sorted by ascending network address.
This list allows TIPC to continue sending responses to user space
applications that request node and link information in sorted order.
The list also improves performance when name table update messages are
sent by making it easier to identify the nodes that must be notified.

Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
This commit is contained in:
Allan Stephens
2011-02-25 18:42:52 -05:00
committed by Paul Gortmaker
parent f831c963b5
commit 672d99e19a
5 changed files with 70 additions and 55 deletions

View File

@@ -37,10 +37,6 @@
#ifndef _TIPC_NET_H
#define _TIPC_NET_H
struct tipc_node;
extern struct tipc_node **tipc_nodes;
extern u32 tipc_highest_node;
extern atomic_t tipc_num_links;
extern rwlock_t tipc_net_lock;