diff options
| -rw-r--r-- | net/tipc/link.c | 38 |
1 files changed, 22 insertions, 16 deletions
diff --git a/net/tipc/link.c b/net/tipc/link.c index 4bab139d5e74..5ed4b4f7452d 100644 --- a/net/tipc/link.c +++ b/net/tipc/link.c | |||
| @@ -843,6 +843,25 @@ static void link_add_to_outqueue(struct link *l_ptr, | |||
| 843 | l_ptr->stats.max_queue_sz = l_ptr->out_queue_size; | 843 | l_ptr->stats.max_queue_sz = l_ptr->out_queue_size; |
| 844 | } | 844 | } |
| 845 | 845 | ||
| 846 | static void link_add_chain_to_outqueue(struct link *l_ptr, | ||
| 847 | struct sk_buff *buf_chain, | ||
| 848 | u32 long_msgno) | ||
| 849 | { | ||
| 850 | struct sk_buff *buf; | ||
| 851 | struct tipc_msg *msg; | ||
| 852 | |||
| 853 | if (!l_ptr->next_out) | ||
| 854 | l_ptr->next_out = buf_chain; | ||
| 855 | while (buf_chain) { | ||
| 856 | buf = buf_chain; | ||
| 857 | buf_chain = buf_chain->next; | ||
| 858 | |||
| 859 | msg = buf_msg(buf); | ||
| 860 | msg_set_long_msgno(msg, long_msgno); | ||
| 861 | link_add_to_outqueue(l_ptr, buf, msg); | ||
| 862 | } | ||
| 863 | } | ||
| 864 | |||
| 846 | /* | 865 | /* |
| 847 | * tipc_link_send_buf() is the 'full path' for messages, called from | 866 | * tipc_link_send_buf() is the 'full path' for messages, called from |
| 848 | * inside TIPC when the 'fast path' in tipc_send_buf | 867 | * inside TIPC when the 'fast path' in tipc_send_buf |
| @@ -1276,25 +1295,12 @@ reject: | |||
| 1276 | total_len, TIPC_ERR_NO_NODE); | 1295 | total_len, TIPC_ERR_NO_NODE); |
| 1277 | } | 1296 | } |
| 1278 | 1297 | ||
| 1279 | /* Append whole chain to send queue: */ | 1298 | /* Append chain of fragments to send queue & send them */ |
| 1280 | 1299 | ||
| 1281 | buf = buf_chain; | ||
| 1282 | l_ptr->long_msg_seq_no++; | 1300 | l_ptr->long_msg_seq_no++; |
| 1283 | if (!l_ptr->next_out) | 1301 | link_add_chain_to_outqueue(l_ptr, buf_chain, l_ptr->long_msg_seq_no); |
| 1284 | l_ptr->next_out = buf_chain; | 1302 | l_ptr->stats.sent_fragments += fragm_no; |
| 1285 | l_ptr->stats.sent_fragmented++; | 1303 | l_ptr->stats.sent_fragmented++; |
| 1286 | while (buf) { | ||
| 1287 | struct sk_buff *next = buf->next; | ||
| 1288 | struct tipc_msg *msg = buf_msg(buf); | ||
| 1289 | |||
| 1290 | l_ptr->stats.sent_fragments++; | ||
| 1291 | msg_set_long_msgno(msg, l_ptr->long_msg_seq_no); | ||
| 1292 | link_add_to_outqueue(l_ptr, buf, msg); | ||
| 1293 | buf = next; | ||
| 1294 | } | ||
| 1295 | |||
| 1296 | /* Send it, if possible: */ | ||
| 1297 | |||
| 1298 | tipc_link_push_queue(l_ptr); | 1304 | tipc_link_push_queue(l_ptr); |
| 1299 | tipc_node_unlock(node); | 1305 | tipc_node_unlock(node); |
| 1300 | return dsz; | 1306 | return dsz; |
