Commit 28353e7f authored by Allan Stephens's avatar Allan Stephens Committed by David S. Miller

tipc: Consolidate subscriber & subscriber port references

This patch modifies TIPC's network topology service so that it
only requires a single reference table entry per subscriber
connection, rather than two.  This is achieved by letting the
reference to the server port communicating with the subscriber
act as the reference to the subscriber object itself.  (Since
the subscriber cannot exist without its port, and vice versa,
this dual role for the reference is perfectly natural.)  This
consolidation reduces the size of the reference table by 50%
in the default configuration.
Signed-off-by: default avatarAllan Stephens <allan.stephens@windriver.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent fc5ad582
......@@ -164,8 +164,7 @@ int tipc_core_start(void)
tipc_mode = TIPC_NODE_MODE;
if ((res = tipc_handler_start()) ||
(res = tipc_ref_table_init(tipc_max_ports + tipc_max_subscriptions,
tipc_random)) ||
(res = tipc_ref_table_init(tipc_max_ports, tipc_random)) ||
(res = tipc_reg_start()) ||
(res = tipc_nametbl_init()) ||
(res = tipc_k_signal((Handler)tipc_subscr_start, 0)) ||
......
This diff is collapsed.
......@@ -49,12 +49,12 @@ typedef void (*tipc_subscr_event) (struct subscription *sub,
* @timeout: duration of subscription (in ms)
* @filter: event filtering to be done for subscription
* @event_cb: routine invoked when a subscription event is detected
* @server_ref: object reference of server port associated with subscription
* @swap: indicates if subscriber uses opposite endianness in its messages
* @evt: template for events generated by subscription
* @subscription_list: adjacent subscriptions in subscriber's subscription list
* @nameseq_list: adjacent subscriptions in name sequence's subscription list
* @timer_ref: reference to timer governing subscription duration (may be NULL)
* @owner: pointer to subscriber object associated with this subscription
*/
struct subscription {
......@@ -62,12 +62,12 @@ struct subscription {
u32 timeout;
u32 filter;
tipc_subscr_event event_cb;
u32 server_ref;
int swap;
struct tipc_event evt;
struct list_head subscription_list;
struct list_head nameseq_list;
struct timer_list timer;
struct subscriber *owner;
};
int tipc_subscr_overlap(struct subscription * sub,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment