aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc
diff options
context:
space:
mode:
authorAllan Stephens <allan.stephens@windriver.com>2011-05-31 13:38:02 -0400
committerPaul Gortmaker <paul.gortmaker@windriver.com>2011-09-17 22:55:10 -0400
commit9aa88c2a509e11e6efc466c88b386e0e01bef731 (patch)
treef7c42275e74229143ac9badcb78da5f3037fe118 /net/tipc
parent1c553bb52eb4c58333a843c0a5888d2329909f62 (diff)
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: Allan Stephens <allan.stephens@windriver.com> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Diffstat (limited to 'net/tipc')
-rw-r--r--net/tipc/link.c45
-rw-r--r--net/tipc/link.h1
-rw-r--r--net/tipc/name_distr.c10
3 files changed, 54 insertions, 2 deletions
diff --git a/net/tipc/link.c b/net/tipc/link.c
index 74126db45972..2ea3f22b7986 100644
--- a/net/tipc/link.c
+++ b/net/tipc/link.c
@@ -986,6 +986,51 @@ int tipc_link_send(struct sk_buff *buf, u32 dest, u32 selector)
986} 986}
987 987
988/* 988/*
989 * tipc_link_send_names - send name table entries to new neighbor
990 *
991 * Send routine for bulk delivery of name table messages when contact
992 * with a new neighbor occurs. No link congestion checking is performed
993 * because name table messages *must* be delivered. The messages must be
994 * small enough not to require fragmentation.
995 * Called without any locks held.
996 */
997
998void tipc_link_send_names(struct list_head *message_list, u32 dest)
999{
1000 struct tipc_node *n_ptr;
1001 struct link *l_ptr;
1002 struct sk_buff *buf;
1003 struct sk_buff *temp_buf;
1004
1005 if (list_empty(message_list))
1006 return;
1007
1008 read_lock_bh(&tipc_net_lock);
1009 n_ptr = tipc_node_find(dest);
1010 if (n_ptr) {
1011 tipc_node_lock(n_ptr);
1012 l_ptr = n_ptr->active_links[0];
1013 if (l_ptr) {
1014 /* convert circular list to linear list */
1015 ((struct sk_buff *)message_list->prev)->next = NULL;
1016 link_add_chain_to_outqueue(l_ptr,
1017 (struct sk_buff *)message_list->next, 0);
1018 tipc_link_push_queue(l_ptr);
1019 INIT_LIST_HEAD(message_list);
1020 }
1021 tipc_node_unlock(n_ptr);
1022 }
1023 read_unlock_bh(&tipc_net_lock);
1024
1025 /* discard the messages if they couldn't be sent */
1026
1027 list_for_each_safe(buf, temp_buf, ((struct sk_buff *)message_list)) {
1028 list_del((struct list_head *)buf);
1029 buf_discard(buf);
1030 }
1031}
1032
1033/*
989 * link_send_buf_fast: Entry for data messages where the 1034 * link_send_buf_fast: Entry for data messages where the
990 * destination link is known and the header is complete, 1035 * destination link is known and the header is complete,
991 * inclusive total message length. Very time critical. 1036 * inclusive total message length. Very time critical.
diff --git a/net/tipc/link.h b/net/tipc/link.h
index 74fbecab1ea0..e56cb532913e 100644
--- a/net/tipc/link.h
+++ b/net/tipc/link.h
@@ -223,6 +223,7 @@ struct sk_buff *tipc_link_cmd_show_stats(const void *req_tlv_area, int req_tlv_s
223struct sk_buff *tipc_link_cmd_reset_stats(const void *req_tlv_area, int req_tlv_space); 223struct sk_buff *tipc_link_cmd_reset_stats(const void *req_tlv_area, int req_tlv_space);
224void tipc_link_reset(struct link *l_ptr); 224void tipc_link_reset(struct link *l_ptr);
225int tipc_link_send(struct sk_buff *buf, u32 dest, u32 selector); 225int tipc_link_send(struct sk_buff *buf, u32 dest, u32 selector);
226void tipc_link_send_names(struct list_head *message_list, u32 dest);
226int tipc_link_send_buf(struct link *l_ptr, struct sk_buff *buf); 227int tipc_link_send_buf(struct link *l_ptr, struct sk_buff *buf);
227u32 tipc_link_get_max_pkt(u32 dest, u32 selector); 228u32 tipc_link_get_max_pkt(u32 dest, u32 selector);
228int tipc_link_send_sections_fast(struct tipc_port *sender, 229int tipc_link_send_sections_fast(struct tipc_port *sender,
diff --git a/net/tipc/name_distr.c b/net/tipc/name_distr.c
index 97546f07938c..b7ca1bd7b151 100644
--- a/net/tipc/name_distr.c
+++ b/net/tipc/name_distr.c
@@ -180,6 +180,7 @@ void tipc_named_node_up(unsigned long nodearg)
180 struct publication *publ; 180 struct publication *publ;
181 struct distr_item *item = NULL; 181 struct distr_item *item = NULL;
182 struct sk_buff *buf = NULL; 182 struct sk_buff *buf = NULL;
183 struct list_head message_list;
183 u32 node = (u32)nodearg; 184 u32 node = (u32)nodearg;
184 u32 left = 0; 185 u32 left = 0;
185 u32 rest; 186 u32 rest;
@@ -201,6 +202,10 @@ void tipc_named_node_up(unsigned long nodearg)
201 if (!max_item_buf) 202 if (!max_item_buf)
202 return; 203 return;
203 204
205 /* create list of publication messages, then send them as a unit */
206
207 INIT_LIST_HEAD(&message_list);
208
204 read_lock_bh(&tipc_nametbl_lock); 209 read_lock_bh(&tipc_nametbl_lock);
205 rest = publ_cnt * ITEM_SIZE; 210 rest = publ_cnt * ITEM_SIZE;
206 211
@@ -219,13 +224,14 @@ void tipc_named_node_up(unsigned long nodearg)
219 item++; 224 item++;
220 left -= ITEM_SIZE; 225 left -= ITEM_SIZE;
221 if (!left) { 226 if (!left) {
222 msg_set_link_selector(buf_msg(buf), node); 227 list_add_tail((struct list_head *)buf, &message_list);
223 tipc_link_send(buf, node, node);
224 buf = NULL; 228 buf = NULL;
225 } 229 }
226 } 230 }
227exit: 231exit:
228 read_unlock_bh(&tipc_nametbl_lock); 232 read_unlock_bh(&tipc_nametbl_lock);
233
234 tipc_link_send_names(&message_list, (u32)node);
229} 235}
230 236
231/** 237/**