Skip to content

Commit 218527f

Browse files
Jon Maloydavem330
authored andcommitted
tipc: replace name table service range array with rb tree
The current design of the binding table has an unnecessary memory consuming and complex data structure. It aggregates the service range items into an array, which is expanded by a factor two every time it becomes too small to hold a new item. Furthermore, the arrays never shrink when the number of ranges diminishes. We now replace this array with an RB tree that is holding the range items as tree nodes, each range directly holding a list of bindings. This, along with a few name changes, improves both readability and volume of the code, as well as reducing memory consumption and hopefully improving cache hit rate. Signed-off-by: Jon Maloy <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 24197ee commit 218527f

File tree

6 files changed

+477
-568
lines changed

6 files changed

+477
-568
lines changed

net/tipc/core.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
#include <linux/etherdevice.h>
5959
#include <net/netns/generic.h>
6060
#include <linux/rhashtable.h>
61+
#include <net/genetlink.h>
6162

6263
struct tipc_node;
6364
struct tipc_bearer;

net/tipc/link.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1810,7 +1810,7 @@ int tipc_link_bc_nack_rcv(struct tipc_link *l, struct sk_buff *skb,
18101810

18111811
void tipc_link_set_queue_limits(struct tipc_link *l, u32 win)
18121812
{
1813-
int max_bulk = TIPC_MAX_PUBLICATIONS / (l->mtu / ITEM_SIZE);
1813+
int max_bulk = TIPC_MAX_PUBL / (l->mtu / ITEM_SIZE);
18141814

18151815
l->window = win;
18161816
l->backlog[TIPC_LOW_IMPORTANCE].limit = max_t(u16, 50, win);

0 commit comments

Comments
 (0)