Commit 9aa88c2a authored by Allan Stephens's avatar Allan Stephens Committed by Paul Gortmaker
Browse files

tipc: Enhance sending of bulk name table messages

Modifies the initial transfer of name table entries to a new neighboring
node so that the messages are enqueued as a unit, rather than individually.

The revised algorithm now locates the link carrying the message only once,
and eliminates unnecessary checks for link congestion, message fragmentation,
and message bundling that are not required when sending these messages.
Signed-off-by: default avatarAllan Stephens <>
Signed-off-by: default avatarPaul Gortmaker <>
parent 1c553bb5
......@@ -985,6 +985,51 @@ int tipc_link_send(struct sk_buff *buf, u32 dest, u32 selector)
return res;
* tipc_link_send_names - send name table entries to new neighbor
* Send routine for bulk delivery of name table messages when contact
* with a new neighbor occurs. No link congestion checking is performed
* because name table messages *must* be delivered. The messages must be
* small enough not to require fragmentation.
* Called without any locks held.
void tipc_link_send_names(struct list_head *message_list, u32 dest)
struct tipc_node *n_ptr;
struct link *l_ptr;
struct sk_buff *buf;
struct sk_buff *temp_buf;
if (list_empty(message_list))
n_ptr = tipc_node_find(dest);
if (n_ptr) {
l_ptr = n_ptr->active_links[0];
if (l_ptr) {
/* convert circular list to linear list */
((struct sk_buff *)message_list->prev)->next = NULL;
(struct sk_buff *)message_list->next, 0);
/* discard the messages if they couldn't be sent */
list_for_each_safe(buf, temp_buf, ((struct sk_buff *)message_list)) {
list_del((struct list_head *)buf);
* link_send_buf_fast: Entry for data messages where the
* destination link is known and the header is complete,
......@@ -223,6 +223,7 @@ struct sk_buff *tipc_link_cmd_show_stats(const void *req_tlv_area, int req_tlv_s
struct sk_buff *tipc_link_cmd_reset_stats(const void *req_tlv_area, int req_tlv_space);
void tipc_link_reset(struct link *l_ptr);
int tipc_link_send(struct sk_buff *buf, u32 dest, u32 selector);
void tipc_link_send_names(struct list_head *message_list, u32 dest);
int tipc_link_send_buf(struct link *l_ptr, struct sk_buff *buf);
u32 tipc_link_get_max_pkt(u32 dest, u32 selector);
int tipc_link_send_sections_fast(struct tipc_port *sender,
......@@ -180,6 +180,7 @@ void tipc_named_node_up(unsigned long nodearg)
struct publication *publ;
struct distr_item *item = NULL;
struct sk_buff *buf = NULL;
struct list_head message_list;
u32 node = (u32)nodearg;
u32 left = 0;
u32 rest;
......@@ -201,6 +202,10 @@ void tipc_named_node_up(unsigned long nodearg)
if (!max_item_buf)
/* create list of publication messages, then send them as a unit */
rest = publ_cnt * ITEM_SIZE;
......@@ -219,13 +224,14 @@ void tipc_named_node_up(unsigned long nodearg)
left -= ITEM_SIZE;
if (!left) {
msg_set_link_selector(buf_msg(buf), node);
tipc_link_send(buf, node, node);
list_add_tail((struct list_head *)buf, &message_list);
buf = NULL;
tipc_link_send_names(&message_list, (u32)node);
Supports Markdown
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