diff options
Diffstat (limited to 'net/tipc/link.c')
-rw-r--r-- | net/tipc/link.c | 383 |
1 files changed, 77 insertions, 306 deletions
diff --git a/net/tipc/link.c b/net/tipc/link.c index b31992ccd5d3..18702f58d111 100644 --- a/net/tipc/link.c +++ b/net/tipc/link.c | |||
@@ -35,19 +35,11 @@ | |||
35 | */ | 35 | */ |
36 | 36 | ||
37 | #include "core.h" | 37 | #include "core.h" |
38 | #include "dbg.h" | ||
39 | #include "link.h" | 38 | #include "link.h" |
40 | #include "net.h" | ||
41 | #include "node.h" | ||
42 | #include "port.h" | 39 | #include "port.h" |
43 | #include "addr.h" | ||
44 | #include "node_subscr.h" | ||
45 | #include "name_distr.h" | 40 | #include "name_distr.h" |
46 | #include "bearer.h" | ||
47 | #include "name_table.h" | ||
48 | #include "discover.h" | 41 | #include "discover.h" |
49 | #include "config.h" | 42 | #include "config.h" |
50 | #include "bcast.h" | ||
51 | 43 | ||
52 | 44 | ||
53 | /* | 45 | /* |
@@ -57,12 +49,6 @@ | |||
57 | #define INVALID_SESSION 0x10000 | 49 | #define INVALID_SESSION 0x10000 |
58 | 50 | ||
59 | /* | 51 | /* |
60 | * Limit for deferred reception queue: | ||
61 | */ | ||
62 | |||
63 | #define DEF_QUEUE_LIMIT 256u | ||
64 | |||
65 | /* | ||
66 | * Link state events: | 52 | * Link state events: |
67 | */ | 53 | */ |
68 | 54 | ||
@@ -110,75 +96,10 @@ static int link_send_sections_long(struct port *sender, | |||
110 | static void link_check_defragm_bufs(struct link *l_ptr); | 96 | static void link_check_defragm_bufs(struct link *l_ptr); |
111 | static void link_state_event(struct link *l_ptr, u32 event); | 97 | static void link_state_event(struct link *l_ptr, u32 event); |
112 | static void link_reset_statistics(struct link *l_ptr); | 98 | static void link_reset_statistics(struct link *l_ptr); |
113 | static void link_print(struct link *l_ptr, struct print_buf *buf, | 99 | static void link_print(struct link *l_ptr, const char *str); |
114 | const char *str); | ||
115 | static void link_start(struct link *l_ptr); | 100 | static void link_start(struct link *l_ptr); |
116 | static int link_send_long_buf(struct link *l_ptr, struct sk_buff *buf); | 101 | static int link_send_long_buf(struct link *l_ptr, struct sk_buff *buf); |
117 | 102 | ||
118 | |||
119 | /* | ||
120 | * Debugging code used by link routines only | ||
121 | * | ||
122 | * When debugging link problems on a system that has multiple links, | ||
123 | * the standard TIPC debugging routines may not be useful since they | ||
124 | * allow the output from multiple links to be intermixed. For this reason | ||
125 | * routines of the form "dbg_link_XXX()" have been created that will capture | ||
126 | * debug info into a link's personal print buffer, which can then be dumped | ||
127 | * into the TIPC system log (TIPC_LOG) upon request. | ||
128 | * | ||
129 | * To enable per-link debugging, use LINK_LOG_BUF_SIZE to specify the size | ||
130 | * of the print buffer used by each link. If LINK_LOG_BUF_SIZE is set to 0, | ||
131 | * the dbg_link_XXX() routines simply send their output to the standard | ||
132 | * debug print buffer (DBG_OUTPUT), if it has been defined; this can be useful | ||
133 | * when there is only a single link in the system being debugged. | ||
134 | * | ||
135 | * Notes: | ||
136 | * - When enabled, LINK_LOG_BUF_SIZE should be set to at least TIPC_PB_MIN_SIZE | ||
137 | * - "l_ptr" must be valid when using dbg_link_XXX() macros | ||
138 | */ | ||
139 | |||
140 | #define LINK_LOG_BUF_SIZE 0 | ||
141 | |||
142 | #define dbg_link(fmt, arg...) \ | ||
143 | do { \ | ||
144 | if (LINK_LOG_BUF_SIZE) \ | ||
145 | tipc_printf(&l_ptr->print_buf, fmt, ## arg); \ | ||
146 | } while (0) | ||
147 | #define dbg_link_msg(msg, txt) \ | ||
148 | do { \ | ||
149 | if (LINK_LOG_BUF_SIZE) \ | ||
150 | tipc_msg_dbg(&l_ptr->print_buf, msg, txt); \ | ||
151 | } while (0) | ||
152 | #define dbg_link_state(txt) \ | ||
153 | do { \ | ||
154 | if (LINK_LOG_BUF_SIZE) \ | ||
155 | link_print(l_ptr, &l_ptr->print_buf, txt); \ | ||
156 | } while (0) | ||
157 | #define dbg_link_dump() do { \ | ||
158 | if (LINK_LOG_BUF_SIZE) { \ | ||
159 | tipc_printf(LOG, "\n\nDumping link <%s>:\n", l_ptr->name); \ | ||
160 | tipc_printbuf_move(LOG, &l_ptr->print_buf); \ | ||
161 | } \ | ||
162 | } while (0) | ||
163 | |||
164 | static void dbg_print_link(struct link *l_ptr, const char *str) | ||
165 | { | ||
166 | if (DBG_OUTPUT != TIPC_NULL) | ||
167 | link_print(l_ptr, DBG_OUTPUT, str); | ||
168 | } | ||
169 | |||
170 | static void dbg_print_buf_chain(struct sk_buff *root_buf) | ||
171 | { | ||
172 | if (DBG_OUTPUT != TIPC_NULL) { | ||
173 | struct sk_buff *buf = root_buf; | ||
174 | |||
175 | while (buf) { | ||
176 | msg_dbg(buf_msg(buf), "In chain: "); | ||
177 | buf = buf->next; | ||
178 | } | ||
179 | } | ||
180 | } | ||
181 | |||
182 | /* | 103 | /* |
183 | * Simple link routines | 104 | * Simple link routines |
184 | */ | 105 | */ |
@@ -266,14 +187,17 @@ static int link_name_validate(const char *name, struct link_name *name_parts) | |||
266 | /* ensure all component parts of link name are present */ | 187 | /* ensure all component parts of link name are present */ |
267 | 188 | ||
268 | addr_local = name_copy; | 189 | addr_local = name_copy; |
269 | if ((if_local = strchr(addr_local, ':')) == NULL) | 190 | if_local = strchr(addr_local, ':'); |
191 | if (if_local == NULL) | ||
270 | return 0; | 192 | return 0; |
271 | *(if_local++) = 0; | 193 | *(if_local++) = 0; |
272 | if ((addr_peer = strchr(if_local, '-')) == NULL) | 194 | addr_peer = strchr(if_local, '-'); |
195 | if (addr_peer == NULL) | ||
273 | return 0; | 196 | return 0; |
274 | *(addr_peer++) = 0; | 197 | *(addr_peer++) = 0; |
275 | if_local_len = addr_peer - if_local; | 198 | if_local_len = addr_peer - if_local; |
276 | if ((if_peer = strchr(addr_peer, ':')) == NULL) | 199 | if_peer = strchr(addr_peer, ':'); |
200 | if (if_peer == NULL) | ||
277 | return 0; | 201 | return 0; |
278 | *(if_peer++) = 0; | 202 | *(if_peer++) = 0; |
279 | if_peer_len = strlen(if_peer) + 1; | 203 | if_peer_len = strlen(if_peer) + 1; |
@@ -392,17 +316,6 @@ struct link *tipc_link_create(struct bearer *b_ptr, const u32 peer, | |||
392 | return NULL; | 316 | return NULL; |
393 | } | 317 | } |
394 | 318 | ||
395 | if (LINK_LOG_BUF_SIZE) { | ||
396 | char *pb = kmalloc(LINK_LOG_BUF_SIZE, GFP_ATOMIC); | ||
397 | |||
398 | if (!pb) { | ||
399 | kfree(l_ptr); | ||
400 | warn("Link creation failed, no memory for print buffer\n"); | ||
401 | return NULL; | ||
402 | } | ||
403 | tipc_printbuf_init(&l_ptr->print_buf, pb, LINK_LOG_BUF_SIZE); | ||
404 | } | ||
405 | |||
406 | l_ptr->addr = peer; | 319 | l_ptr->addr = peer; |
407 | if_name = strchr(b_ptr->publ.name, ':') + 1; | 320 | if_name = strchr(b_ptr->publ.name, ':') + 1; |
408 | sprintf(l_ptr->name, "%u.%u.%u:%s-%u.%u.%u:", | 321 | sprintf(l_ptr->name, "%u.%u.%u:%s-%u.%u.%u:", |
@@ -437,8 +350,6 @@ struct link *tipc_link_create(struct bearer *b_ptr, const u32 peer, | |||
437 | 350 | ||
438 | l_ptr->owner = tipc_node_attach_link(l_ptr); | 351 | l_ptr->owner = tipc_node_attach_link(l_ptr); |
439 | if (!l_ptr->owner) { | 352 | if (!l_ptr->owner) { |
440 | if (LINK_LOG_BUF_SIZE) | ||
441 | kfree(l_ptr->print_buf.buf); | ||
442 | kfree(l_ptr); | 353 | kfree(l_ptr); |
443 | return NULL; | 354 | return NULL; |
444 | } | 355 | } |
@@ -447,9 +358,6 @@ struct link *tipc_link_create(struct bearer *b_ptr, const u32 peer, | |||
447 | list_add_tail(&l_ptr->link_list, &b_ptr->links); | 358 | list_add_tail(&l_ptr->link_list, &b_ptr->links); |
448 | tipc_k_signal((Handler)link_start, (unsigned long)l_ptr); | 359 | tipc_k_signal((Handler)link_start, (unsigned long)l_ptr); |
449 | 360 | ||
450 | dbg("tipc_link_create(): tolerance = %u,cont intv = %u, abort_limit = %u\n", | ||
451 | l_ptr->tolerance, l_ptr->continuity_interval, l_ptr->abort_limit); | ||
452 | |||
453 | return l_ptr; | 361 | return l_ptr; |
454 | } | 362 | } |
455 | 363 | ||
@@ -469,8 +377,6 @@ void tipc_link_delete(struct link *l_ptr) | |||
469 | return; | 377 | return; |
470 | } | 378 | } |
471 | 379 | ||
472 | dbg("tipc_link_delete()\n"); | ||
473 | |||
474 | k_cancel_timer(&l_ptr->timer); | 380 | k_cancel_timer(&l_ptr->timer); |
475 | 381 | ||
476 | tipc_node_lock(l_ptr->owner); | 382 | tipc_node_lock(l_ptr->owner); |
@@ -478,8 +384,6 @@ void tipc_link_delete(struct link *l_ptr) | |||
478 | tipc_node_detach_link(l_ptr->owner, l_ptr); | 384 | tipc_node_detach_link(l_ptr->owner, l_ptr); |
479 | tipc_link_stop(l_ptr); | 385 | tipc_link_stop(l_ptr); |
480 | list_del_init(&l_ptr->link_list); | 386 | list_del_init(&l_ptr->link_list); |
481 | if (LINK_LOG_BUF_SIZE) | ||
482 | kfree(l_ptr->print_buf.buf); | ||
483 | tipc_node_unlock(l_ptr->owner); | 387 | tipc_node_unlock(l_ptr->owner); |
484 | k_term_timer(&l_ptr->timer); | 388 | k_term_timer(&l_ptr->timer); |
485 | kfree(l_ptr); | 389 | kfree(l_ptr); |
@@ -487,7 +391,6 @@ void tipc_link_delete(struct link *l_ptr) | |||
487 | 391 | ||
488 | static void link_start(struct link *l_ptr) | 392 | static void link_start(struct link *l_ptr) |
489 | { | 393 | { |
490 | dbg("link_start %x\n", l_ptr); | ||
491 | link_state_event(l_ptr, STARTING_EVT); | 394 | link_state_event(l_ptr, STARTING_EVT); |
492 | } | 395 | } |
493 | 396 | ||
@@ -639,7 +542,6 @@ void tipc_link_reset(struct link *l_ptr) | |||
639 | link_init_max_pkt(l_ptr); | 542 | link_init_max_pkt(l_ptr); |
640 | 543 | ||
641 | l_ptr->state = RESET_UNKNOWN; | 544 | l_ptr->state = RESET_UNKNOWN; |
642 | dbg_link_state("Resetting Link\n"); | ||
643 | 545 | ||
644 | if ((prev_state == RESET_UNKNOWN) || (prev_state == RESET_RESET)) | 546 | if ((prev_state == RESET_UNKNOWN) || (prev_state == RESET_RESET)) |
645 | return; | 547 | return; |
@@ -713,25 +615,18 @@ static void link_state_event(struct link *l_ptr, unsigned event) | |||
713 | return; /* Not yet. */ | 615 | return; /* Not yet. */ |
714 | 616 | ||
715 | if (link_blocked(l_ptr)) { | 617 | if (link_blocked(l_ptr)) { |
716 | if (event == TIMEOUT_EVT) { | 618 | if (event == TIMEOUT_EVT) |
717 | link_set_timer(l_ptr, cont_intv); | 619 | link_set_timer(l_ptr, cont_intv); |
718 | } | ||
719 | return; /* Changeover going on */ | 620 | return; /* Changeover going on */ |
720 | } | 621 | } |
721 | dbg_link("STATE_EV: <%s> ", l_ptr->name); | ||
722 | 622 | ||
723 | switch (l_ptr->state) { | 623 | switch (l_ptr->state) { |
724 | case WORKING_WORKING: | 624 | case WORKING_WORKING: |
725 | dbg_link("WW/"); | ||
726 | switch (event) { | 625 | switch (event) { |
727 | case TRAFFIC_MSG_EVT: | 626 | case TRAFFIC_MSG_EVT: |
728 | dbg_link("TRF-"); | ||
729 | /* fall through */ | ||
730 | case ACTIVATE_MSG: | 627 | case ACTIVATE_MSG: |
731 | dbg_link("ACT\n"); | ||
732 | break; | 628 | break; |
733 | case TIMEOUT_EVT: | 629 | case TIMEOUT_EVT: |
734 | dbg_link("TIM "); | ||
735 | if (l_ptr->next_in_no != l_ptr->checkpoint) { | 630 | if (l_ptr->next_in_no != l_ptr->checkpoint) { |
736 | l_ptr->checkpoint = l_ptr->next_in_no; | 631 | l_ptr->checkpoint = l_ptr->next_in_no; |
737 | if (tipc_bclink_acks_missing(l_ptr->owner)) { | 632 | if (tipc_bclink_acks_missing(l_ptr->owner)) { |
@@ -746,7 +641,6 @@ static void link_state_event(struct link *l_ptr, unsigned event) | |||
746 | link_set_timer(l_ptr, cont_intv); | 641 | link_set_timer(l_ptr, cont_intv); |
747 | break; | 642 | break; |
748 | } | 643 | } |
749 | dbg_link(" -> WU\n"); | ||
750 | l_ptr->state = WORKING_UNKNOWN; | 644 | l_ptr->state = WORKING_UNKNOWN; |
751 | l_ptr->fsm_msg_cnt = 0; | 645 | l_ptr->fsm_msg_cnt = 0; |
752 | tipc_link_send_proto_msg(l_ptr, STATE_MSG, 1, 0, 0, 0, 0); | 646 | tipc_link_send_proto_msg(l_ptr, STATE_MSG, 1, 0, 0, 0, 0); |
@@ -754,7 +648,6 @@ static void link_state_event(struct link *l_ptr, unsigned event) | |||
754 | link_set_timer(l_ptr, cont_intv / 4); | 648 | link_set_timer(l_ptr, cont_intv / 4); |
755 | break; | 649 | break; |
756 | case RESET_MSG: | 650 | case RESET_MSG: |
757 | dbg_link("RES -> RR\n"); | ||
758 | info("Resetting link <%s>, requested by peer\n", | 651 | info("Resetting link <%s>, requested by peer\n", |
759 | l_ptr->name); | 652 | l_ptr->name); |
760 | tipc_link_reset(l_ptr); | 653 | tipc_link_reset(l_ptr); |
@@ -769,18 +662,14 @@ static void link_state_event(struct link *l_ptr, unsigned event) | |||
769 | } | 662 | } |
770 | break; | 663 | break; |
771 | case WORKING_UNKNOWN: | 664 | case WORKING_UNKNOWN: |
772 | dbg_link("WU/"); | ||
773 | switch (event) { | 665 | switch (event) { |
774 | case TRAFFIC_MSG_EVT: | 666 | case TRAFFIC_MSG_EVT: |
775 | dbg_link("TRF-"); | ||
776 | case ACTIVATE_MSG: | 667 | case ACTIVATE_MSG: |
777 | dbg_link("ACT -> WW\n"); | ||
778 | l_ptr->state = WORKING_WORKING; | 668 | l_ptr->state = WORKING_WORKING; |
779 | l_ptr->fsm_msg_cnt = 0; | 669 | l_ptr->fsm_msg_cnt = 0; |
780 | link_set_timer(l_ptr, cont_intv); | 670 | link_set_timer(l_ptr, cont_intv); |
781 | break; | 671 | break; |
782 | case RESET_MSG: | 672 | case RESET_MSG: |
783 | dbg_link("RES -> RR\n"); | ||
784 | info("Resetting link <%s>, requested by peer " | 673 | info("Resetting link <%s>, requested by peer " |
785 | "while probing\n", l_ptr->name); | 674 | "while probing\n", l_ptr->name); |
786 | tipc_link_reset(l_ptr); | 675 | tipc_link_reset(l_ptr); |
@@ -791,9 +680,7 @@ static void link_state_event(struct link *l_ptr, unsigned event) | |||
791 | link_set_timer(l_ptr, cont_intv); | 680 | link_set_timer(l_ptr, cont_intv); |
792 | break; | 681 | break; |
793 | case TIMEOUT_EVT: | 682 | case TIMEOUT_EVT: |
794 | dbg_link("TIM "); | ||
795 | if (l_ptr->next_in_no != l_ptr->checkpoint) { | 683 | if (l_ptr->next_in_no != l_ptr->checkpoint) { |
796 | dbg_link("-> WW\n"); | ||
797 | l_ptr->state = WORKING_WORKING; | 684 | l_ptr->state = WORKING_WORKING; |
798 | l_ptr->fsm_msg_cnt = 0; | 685 | l_ptr->fsm_msg_cnt = 0; |
799 | l_ptr->checkpoint = l_ptr->next_in_no; | 686 | l_ptr->checkpoint = l_ptr->next_in_no; |
@@ -804,16 +691,11 @@ static void link_state_event(struct link *l_ptr, unsigned event) | |||
804 | } | 691 | } |
805 | link_set_timer(l_ptr, cont_intv); | 692 | link_set_timer(l_ptr, cont_intv); |
806 | } else if (l_ptr->fsm_msg_cnt < l_ptr->abort_limit) { | 693 | } else if (l_ptr->fsm_msg_cnt < l_ptr->abort_limit) { |
807 | dbg_link("Probing %u/%u,timer = %u ms)\n", | ||
808 | l_ptr->fsm_msg_cnt, l_ptr->abort_limit, | ||
809 | cont_intv / 4); | ||
810 | tipc_link_send_proto_msg(l_ptr, STATE_MSG, | 694 | tipc_link_send_proto_msg(l_ptr, STATE_MSG, |
811 | 1, 0, 0, 0, 0); | 695 | 1, 0, 0, 0, 0); |
812 | l_ptr->fsm_msg_cnt++; | 696 | l_ptr->fsm_msg_cnt++; |
813 | link_set_timer(l_ptr, cont_intv / 4); | 697 | link_set_timer(l_ptr, cont_intv / 4); |
814 | } else { /* Link has failed */ | 698 | } else { /* Link has failed */ |
815 | dbg_link("-> RU (%u probes unanswered)\n", | ||
816 | l_ptr->fsm_msg_cnt); | ||
817 | warn("Resetting link <%s>, peer not responding\n", | 699 | warn("Resetting link <%s>, peer not responding\n", |
818 | l_ptr->name); | 700 | l_ptr->name); |
819 | tipc_link_reset(l_ptr); | 701 | tipc_link_reset(l_ptr); |
@@ -830,18 +712,13 @@ static void link_state_event(struct link *l_ptr, unsigned event) | |||
830 | } | 712 | } |
831 | break; | 713 | break; |
832 | case RESET_UNKNOWN: | 714 | case RESET_UNKNOWN: |
833 | dbg_link("RU/"); | ||
834 | switch (event) { | 715 | switch (event) { |
835 | case TRAFFIC_MSG_EVT: | 716 | case TRAFFIC_MSG_EVT: |
836 | dbg_link("TRF-\n"); | ||
837 | break; | 717 | break; |
838 | case ACTIVATE_MSG: | 718 | case ACTIVATE_MSG: |
839 | other = l_ptr->owner->active_links[0]; | 719 | other = l_ptr->owner->active_links[0]; |
840 | if (other && link_working_unknown(other)) { | 720 | if (other && link_working_unknown(other)) |
841 | dbg_link("ACT\n"); | ||
842 | break; | 721 | break; |
843 | } | ||
844 | dbg_link("ACT -> WW\n"); | ||
845 | l_ptr->state = WORKING_WORKING; | 722 | l_ptr->state = WORKING_WORKING; |
846 | l_ptr->fsm_msg_cnt = 0; | 723 | l_ptr->fsm_msg_cnt = 0; |
847 | link_activate(l_ptr); | 724 | link_activate(l_ptr); |
@@ -850,8 +727,6 @@ static void link_state_event(struct link *l_ptr, unsigned event) | |||
850 | link_set_timer(l_ptr, cont_intv); | 727 | link_set_timer(l_ptr, cont_intv); |
851 | break; | 728 | break; |
852 | case RESET_MSG: | 729 | case RESET_MSG: |
853 | dbg_link("RES\n"); | ||
854 | dbg_link(" -> RR\n"); | ||
855 | l_ptr->state = RESET_RESET; | 730 | l_ptr->state = RESET_RESET; |
856 | l_ptr->fsm_msg_cnt = 0; | 731 | l_ptr->fsm_msg_cnt = 0; |
857 | tipc_link_send_proto_msg(l_ptr, ACTIVATE_MSG, 1, 0, 0, 0, 0); | 732 | tipc_link_send_proto_msg(l_ptr, ACTIVATE_MSG, 1, 0, 0, 0, 0); |
@@ -859,11 +734,9 @@ static void link_state_event(struct link *l_ptr, unsigned event) | |||
859 | link_set_timer(l_ptr, cont_intv); | 734 | link_set_timer(l_ptr, cont_intv); |
860 | break; | 735 | break; |
861 | case STARTING_EVT: | 736 | case STARTING_EVT: |
862 | dbg_link("START-"); | ||
863 | l_ptr->started = 1; | 737 | l_ptr->started = 1; |
864 | /* fall through */ | 738 | /* fall through */ |
865 | case TIMEOUT_EVT: | 739 | case TIMEOUT_EVT: |
866 | dbg_link("TIM\n"); | ||
867 | tipc_link_send_proto_msg(l_ptr, RESET_MSG, 0, 0, 0, 0, 0); | 740 | tipc_link_send_proto_msg(l_ptr, RESET_MSG, 0, 0, 0, 0, 0); |
868 | l_ptr->fsm_msg_cnt++; | 741 | l_ptr->fsm_msg_cnt++; |
869 | link_set_timer(l_ptr, cont_intv); | 742 | link_set_timer(l_ptr, cont_intv); |
@@ -873,18 +746,12 @@ static void link_state_event(struct link *l_ptr, unsigned event) | |||
873 | } | 746 | } |
874 | break; | 747 | break; |
875 | case RESET_RESET: | 748 | case RESET_RESET: |
876 | dbg_link("RR/ "); | ||
877 | switch (event) { | 749 | switch (event) { |
878 | case TRAFFIC_MSG_EVT: | 750 | case TRAFFIC_MSG_EVT: |
879 | dbg_link("TRF-"); | ||
880 | /* fall through */ | ||
881 | case ACTIVATE_MSG: | 751 | case ACTIVATE_MSG: |
882 | other = l_ptr->owner->active_links[0]; | 752 | other = l_ptr->owner->active_links[0]; |
883 | if (other && link_working_unknown(other)) { | 753 | if (other && link_working_unknown(other)) |
884 | dbg_link("ACT\n"); | ||
885 | break; | 754 | break; |
886 | } | ||
887 | dbg_link("ACT -> WW\n"); | ||
888 | l_ptr->state = WORKING_WORKING; | 755 | l_ptr->state = WORKING_WORKING; |
889 | l_ptr->fsm_msg_cnt = 0; | 756 | l_ptr->fsm_msg_cnt = 0; |
890 | link_activate(l_ptr); | 757 | link_activate(l_ptr); |
@@ -893,14 +760,11 @@ static void link_state_event(struct link *l_ptr, unsigned event) | |||
893 | link_set_timer(l_ptr, cont_intv); | 760 | link_set_timer(l_ptr, cont_intv); |
894 | break; | 761 | break; |
895 | case RESET_MSG: | 762 | case RESET_MSG: |
896 | dbg_link("RES\n"); | ||
897 | break; | 763 | break; |
898 | case TIMEOUT_EVT: | 764 | case TIMEOUT_EVT: |
899 | dbg_link("TIM\n"); | ||
900 | tipc_link_send_proto_msg(l_ptr, ACTIVATE_MSG, 0, 0, 0, 0, 0); | 765 | tipc_link_send_proto_msg(l_ptr, ACTIVATE_MSG, 0, 0, 0, 0, 0); |
901 | l_ptr->fsm_msg_cnt++; | 766 | l_ptr->fsm_msg_cnt++; |
902 | link_set_timer(l_ptr, cont_intv); | 767 | link_set_timer(l_ptr, cont_intv); |
903 | dbg_link("fsm_msg_cnt %u\n", l_ptr->fsm_msg_cnt); | ||
904 | break; | 768 | break; |
905 | default: | 769 | default: |
906 | err("Unknown link event %u in RR state\n", event); | 770 | err("Unknown link event %u in RR state\n", event); |
@@ -940,9 +804,6 @@ static int link_bundle_buf(struct link *l_ptr, | |||
940 | skb_copy_to_linear_data_offset(bundler, to_pos, buf->data, size); | 804 | skb_copy_to_linear_data_offset(bundler, to_pos, buf->data, size); |
941 | msg_set_size(bundler_msg, to_pos + size); | 805 | msg_set_size(bundler_msg, to_pos + size); |
942 | msg_set_msgcnt(bundler_msg, msg_msgcnt(bundler_msg) + 1); | 806 | msg_set_msgcnt(bundler_msg, msg_msgcnt(bundler_msg) + 1); |
943 | dbg("Packed msg # %u(%u octets) into pos %u in buf(#%u)\n", | ||
944 | msg_msgcnt(bundler_msg), size, to_pos, msg_seqno(bundler_msg)); | ||
945 | msg_dbg(msg, "PACKD:"); | ||
946 | buf_discard(buf); | 807 | buf_discard(buf); |
947 | l_ptr->stats.sent_bundled++; | 808 | l_ptr->stats.sent_bundled++; |
948 | return 1; | 809 | return 1; |
@@ -991,7 +852,6 @@ int tipc_link_send_buf(struct link *l_ptr, struct sk_buff *buf) | |||
991 | return link_schedule_port(l_ptr, msg_origport(msg), | 852 | return link_schedule_port(l_ptr, msg_origport(msg), |
992 | size); | 853 | size); |
993 | } | 854 | } |
994 | msg_dbg(msg, "TIPC: Congestion, throwing away\n"); | ||
995 | buf_discard(buf); | 855 | buf_discard(buf); |
996 | if (imp > CONN_MANAGER) { | 856 | if (imp > CONN_MANAGER) { |
997 | warn("Resetting link <%s>, send queue full", l_ptr->name); | 857 | warn("Resetting link <%s>, send queue full", l_ptr->name); |
@@ -1075,22 +935,16 @@ int tipc_link_send(struct sk_buff *buf, u32 dest, u32 selector) | |||
1075 | int res = -ELINKCONG; | 935 | int res = -ELINKCONG; |
1076 | 936 | ||
1077 | read_lock_bh(&tipc_net_lock); | 937 | read_lock_bh(&tipc_net_lock); |
1078 | n_ptr = tipc_node_select(dest, selector); | 938 | n_ptr = tipc_node_find(dest); |
1079 | if (n_ptr) { | 939 | if (n_ptr) { |
1080 | tipc_node_lock(n_ptr); | 940 | tipc_node_lock(n_ptr); |
1081 | l_ptr = n_ptr->active_links[selector & 1]; | 941 | l_ptr = n_ptr->active_links[selector & 1]; |
1082 | if (l_ptr) { | 942 | if (l_ptr) |
1083 | dbg("tipc_link_send: found link %x for dest %x\n", l_ptr, dest); | ||
1084 | res = tipc_link_send_buf(l_ptr, buf); | 943 | res = tipc_link_send_buf(l_ptr, buf); |
1085 | } else { | 944 | else |
1086 | dbg("Attempt to send msg to unreachable node:\n"); | ||
1087 | msg_dbg(buf_msg(buf),">>>"); | ||
1088 | buf_discard(buf); | 945 | buf_discard(buf); |
1089 | } | ||
1090 | tipc_node_unlock(n_ptr); | 946 | tipc_node_unlock(n_ptr); |
1091 | } else { | 947 | } else { |
1092 | dbg("Attempt to send msg to unknown node:\n"); | ||
1093 | msg_dbg(buf_msg(buf),">>>"); | ||
1094 | buf_discard(buf); | 948 | buf_discard(buf); |
1095 | } | 949 | } |
1096 | read_unlock_bh(&tipc_net_lock); | 950 | read_unlock_bh(&tipc_net_lock); |
@@ -1117,17 +971,14 @@ static int link_send_buf_fast(struct link *l_ptr, struct sk_buff *buf, | |||
1117 | if (likely(tipc_bearer_send(l_ptr->b_ptr, buf, | 971 | if (likely(tipc_bearer_send(l_ptr->b_ptr, buf, |
1118 | &l_ptr->media_addr))) { | 972 | &l_ptr->media_addr))) { |
1119 | l_ptr->unacked_window = 0; | 973 | l_ptr->unacked_window = 0; |
1120 | msg_dbg(msg,"SENT_FAST:"); | ||
1121 | return res; | 974 | return res; |
1122 | } | 975 | } |
1123 | dbg("failed sent fast...\n"); | ||
1124 | tipc_bearer_schedule(l_ptr->b_ptr, l_ptr); | 976 | tipc_bearer_schedule(l_ptr->b_ptr, l_ptr); |
1125 | l_ptr->stats.bearer_congs++; | 977 | l_ptr->stats.bearer_congs++; |
1126 | l_ptr->next_out = buf; | 978 | l_ptr->next_out = buf; |
1127 | return res; | 979 | return res; |
1128 | } | 980 | } |
1129 | } | 981 | } else |
1130 | else | ||
1131 | *used_max_pkt = l_ptr->max_pkt; | 982 | *used_max_pkt = l_ptr->max_pkt; |
1132 | } | 983 | } |
1133 | return tipc_link_send_buf(l_ptr, buf); /* All other cases */ | 984 | return tipc_link_send_buf(l_ptr, buf); /* All other cases */ |
@@ -1151,12 +1002,10 @@ int tipc_send_buf_fast(struct sk_buff *buf, u32 destnode) | |||
1151 | return tipc_port_recv_msg(buf); | 1002 | return tipc_port_recv_msg(buf); |
1152 | 1003 | ||
1153 | read_lock_bh(&tipc_net_lock); | 1004 | read_lock_bh(&tipc_net_lock); |
1154 | n_ptr = tipc_node_select(destnode, selector); | 1005 | n_ptr = tipc_node_find(destnode); |
1155 | if (likely(n_ptr)) { | 1006 | if (likely(n_ptr)) { |
1156 | tipc_node_lock(n_ptr); | 1007 | tipc_node_lock(n_ptr); |
1157 | l_ptr = n_ptr->active_links[selector]; | 1008 | l_ptr = n_ptr->active_links[selector]; |
1158 | dbg("send_fast: buf %x selected %x, destnode = %x\n", | ||
1159 | buf, l_ptr, destnode); | ||
1160 | if (likely(l_ptr)) { | 1009 | if (likely(l_ptr)) { |
1161 | res = link_send_buf_fast(l_ptr, buf, &dummy); | 1010 | res = link_send_buf_fast(l_ptr, buf, &dummy); |
1162 | tipc_node_unlock(n_ptr); | 1011 | tipc_node_unlock(n_ptr); |
@@ -1200,7 +1049,7 @@ again: | |||
1200 | !sender->user_port, &buf); | 1049 | !sender->user_port, &buf); |
1201 | 1050 | ||
1202 | read_lock_bh(&tipc_net_lock); | 1051 | read_lock_bh(&tipc_net_lock); |
1203 | node = tipc_node_select(destaddr, selector); | 1052 | node = tipc_node_find(destaddr); |
1204 | if (likely(node)) { | 1053 | if (likely(node)) { |
1205 | tipc_node_lock(node); | 1054 | tipc_node_lock(node); |
1206 | l_ptr = node->active_links[selector]; | 1055 | l_ptr = node->active_links[selector]; |
@@ -1283,10 +1132,10 @@ static int link_send_sections_long(struct port *sender, | |||
1283 | struct tipc_node *node; | 1132 | struct tipc_node *node; |
1284 | struct tipc_msg *hdr = &sender->publ.phdr; | 1133 | struct tipc_msg *hdr = &sender->publ.phdr; |
1285 | u32 dsz = msg_data_sz(hdr); | 1134 | u32 dsz = msg_data_sz(hdr); |
1286 | u32 max_pkt,fragm_sz,rest; | 1135 | u32 max_pkt, fragm_sz, rest; |
1287 | struct tipc_msg fragm_hdr; | 1136 | struct tipc_msg fragm_hdr; |
1288 | struct sk_buff *buf,*buf_chain,*prev; | 1137 | struct sk_buff *buf, *buf_chain, *prev; |
1289 | u32 fragm_crs,fragm_rest,hsz,sect_rest; | 1138 | u32 fragm_crs, fragm_rest, hsz, sect_rest; |
1290 | const unchar *sect_crs; | 1139 | const unchar *sect_crs; |
1291 | int curr_sect; | 1140 | int curr_sect; |
1292 | u32 fragm_no; | 1141 | u32 fragm_no; |
@@ -1306,7 +1155,6 @@ again: | |||
1306 | 1155 | ||
1307 | /* Prepare reusable fragment header: */ | 1156 | /* Prepare reusable fragment header: */ |
1308 | 1157 | ||
1309 | msg_dbg(hdr, ">FRAGMENTING>"); | ||
1310 | tipc_msg_init(&fragm_hdr, MSG_FRAGMENTER, FIRST_FRAGMENT, | 1158 | tipc_msg_init(&fragm_hdr, MSG_FRAGMENTER, FIRST_FRAGMENT, |
1311 | INT_H_SIZE, msg_destnode(hdr)); | 1159 | INT_H_SIZE, msg_destnode(hdr)); |
1312 | msg_set_link_selector(&fragm_hdr, sender->publ.ref); | 1160 | msg_set_link_selector(&fragm_hdr, sender->publ.ref); |
@@ -1322,7 +1170,6 @@ again: | |||
1322 | skb_copy_to_linear_data(buf, &fragm_hdr, INT_H_SIZE); | 1170 | skb_copy_to_linear_data(buf, &fragm_hdr, INT_H_SIZE); |
1323 | hsz = msg_hdr_sz(hdr); | 1171 | hsz = msg_hdr_sz(hdr); |
1324 | skb_copy_to_linear_data_offset(buf, INT_H_SIZE, hdr, hsz); | 1172 | skb_copy_to_linear_data_offset(buf, INT_H_SIZE, hdr, hsz); |
1325 | msg_dbg(buf_msg(buf), ">BUILD>"); | ||
1326 | 1173 | ||
1327 | /* Chop up message: */ | 1174 | /* Chop up message: */ |
1328 | 1175 | ||
@@ -1365,7 +1212,7 @@ error: | |||
1365 | /* Initiate new fragment: */ | 1212 | /* Initiate new fragment: */ |
1366 | if (rest <= fragm_sz) { | 1213 | if (rest <= fragm_sz) { |
1367 | fragm_sz = rest; | 1214 | fragm_sz = rest; |
1368 | msg_set_type(&fragm_hdr,LAST_FRAGMENT); | 1215 | msg_set_type(&fragm_hdr, LAST_FRAGMENT); |
1369 | } else { | 1216 | } else { |
1370 | msg_set_type(&fragm_hdr, FRAGMENT); | 1217 | msg_set_type(&fragm_hdr, FRAGMENT); |
1371 | } | 1218 | } |
@@ -1381,16 +1228,14 @@ error: | |||
1381 | skb_copy_to_linear_data(buf, &fragm_hdr, INT_H_SIZE); | 1228 | skb_copy_to_linear_data(buf, &fragm_hdr, INT_H_SIZE); |
1382 | fragm_crs = INT_H_SIZE; | 1229 | fragm_crs = INT_H_SIZE; |
1383 | fragm_rest = fragm_sz; | 1230 | fragm_rest = fragm_sz; |
1384 | msg_dbg(buf_msg(buf)," >BUILD>"); | ||
1385 | } | 1231 | } |
1386 | } | 1232 | } while (rest > 0); |
1387 | while (rest > 0); | ||
1388 | 1233 | ||
1389 | /* | 1234 | /* |
1390 | * Now we have a buffer chain. Select a link and check | 1235 | * Now we have a buffer chain. Select a link and check |
1391 | * that packet size is still OK | 1236 | * that packet size is still OK |
1392 | */ | 1237 | */ |
1393 | node = tipc_node_select(destaddr, sender->publ.ref & 1); | 1238 | node = tipc_node_find(destaddr); |
1394 | if (likely(node)) { | 1239 | if (likely(node)) { |
1395 | tipc_node_lock(node); | 1240 | tipc_node_lock(node); |
1396 | l_ptr = node->active_links[sender->publ.ref & 1]; | 1241 | l_ptr = node->active_links[sender->publ.ref & 1]; |
@@ -1431,7 +1276,6 @@ reject: | |||
1431 | l_ptr->stats.sent_fragments++; | 1276 | l_ptr->stats.sent_fragments++; |
1432 | msg_set_long_msgno(msg, l_ptr->long_msg_seq_no); | 1277 | msg_set_long_msgno(msg, l_ptr->long_msg_seq_no); |
1433 | link_add_to_outqueue(l_ptr, buf, msg); | 1278 | link_add_to_outqueue(l_ptr, buf, msg); |
1434 | msg_dbg(msg, ">ADD>"); | ||
1435 | buf = next; | 1279 | buf = next; |
1436 | } | 1280 | } |
1437 | 1281 | ||
@@ -1473,14 +1317,12 @@ u32 tipc_link_push_packet(struct link *l_ptr) | |||
1473 | msg_set_ack(buf_msg(buf), mod(l_ptr->next_in_no - 1)); | 1317 | msg_set_ack(buf_msg(buf), mod(l_ptr->next_in_no - 1)); |
1474 | msg_set_bcast_ack(buf_msg(buf), l_ptr->owner->bclink.last_in); | 1318 | msg_set_bcast_ack(buf_msg(buf), l_ptr->owner->bclink.last_in); |
1475 | if (tipc_bearer_send(l_ptr->b_ptr, buf, &l_ptr->media_addr)) { | 1319 | if (tipc_bearer_send(l_ptr->b_ptr, buf, &l_ptr->media_addr)) { |
1476 | msg_dbg(buf_msg(buf), ">DEF-RETR>"); | ||
1477 | l_ptr->retransm_queue_head = mod(++r_q_head); | 1320 | l_ptr->retransm_queue_head = mod(++r_q_head); |
1478 | l_ptr->retransm_queue_size = --r_q_size; | 1321 | l_ptr->retransm_queue_size = --r_q_size; |
1479 | l_ptr->stats.retransmitted++; | 1322 | l_ptr->stats.retransmitted++; |
1480 | return 0; | 1323 | return 0; |
1481 | } else { | 1324 | } else { |
1482 | l_ptr->stats.bearer_congs++; | 1325 | l_ptr->stats.bearer_congs++; |
1483 | msg_dbg(buf_msg(buf), "|>DEF-RETR>"); | ||
1484 | return PUSH_FAILED; | 1326 | return PUSH_FAILED; |
1485 | } | 1327 | } |
1486 | } | 1328 | } |
@@ -1490,15 +1332,13 @@ u32 tipc_link_push_packet(struct link *l_ptr) | |||
1490 | buf = l_ptr->proto_msg_queue; | 1332 | buf = l_ptr->proto_msg_queue; |
1491 | if (buf) { | 1333 | if (buf) { |
1492 | msg_set_ack(buf_msg(buf), mod(l_ptr->next_in_no - 1)); | 1334 | msg_set_ack(buf_msg(buf), mod(l_ptr->next_in_no - 1)); |
1493 | msg_set_bcast_ack(buf_msg(buf),l_ptr->owner->bclink.last_in); | 1335 | msg_set_bcast_ack(buf_msg(buf), l_ptr->owner->bclink.last_in); |
1494 | if (tipc_bearer_send(l_ptr->b_ptr, buf, &l_ptr->media_addr)) { | 1336 | if (tipc_bearer_send(l_ptr->b_ptr, buf, &l_ptr->media_addr)) { |
1495 | msg_dbg(buf_msg(buf), ">DEF-PROT>"); | ||
1496 | l_ptr->unacked_window = 0; | 1337 | l_ptr->unacked_window = 0; |
1497 | buf_discard(buf); | 1338 | buf_discard(buf); |
1498 | l_ptr->proto_msg_queue = NULL; | 1339 | l_ptr->proto_msg_queue = NULL; |
1499 | return 0; | 1340 | return 0; |
1500 | } else { | 1341 | } else { |
1501 | msg_dbg(buf_msg(buf), "|>DEF-PROT>"); | ||
1502 | l_ptr->stats.bearer_congs++; | 1342 | l_ptr->stats.bearer_congs++; |
1503 | return PUSH_FAILED; | 1343 | return PUSH_FAILED; |
1504 | } | 1344 | } |
@@ -1518,11 +1358,9 @@ u32 tipc_link_push_packet(struct link *l_ptr) | |||
1518 | if (tipc_bearer_send(l_ptr->b_ptr, buf, &l_ptr->media_addr)) { | 1358 | if (tipc_bearer_send(l_ptr->b_ptr, buf, &l_ptr->media_addr)) { |
1519 | if (msg_user(msg) == MSG_BUNDLER) | 1359 | if (msg_user(msg) == MSG_BUNDLER) |
1520 | msg_set_type(msg, CLOSED_MSG); | 1360 | msg_set_type(msg, CLOSED_MSG); |
1521 | msg_dbg(msg, ">PUSH-DATA>"); | ||
1522 | l_ptr->next_out = buf->next; | 1361 | l_ptr->next_out = buf->next; |
1523 | return 0; | 1362 | return 0; |
1524 | } else { | 1363 | } else { |
1525 | msg_dbg(msg, "|PUSH-DATA|"); | ||
1526 | l_ptr->stats.bearer_congs++; | 1364 | l_ptr->stats.bearer_congs++; |
1527 | return PUSH_FAILED; | 1365 | return PUSH_FAILED; |
1528 | } | 1366 | } |
@@ -1570,8 +1408,7 @@ static void link_reset_all(unsigned long addr) | |||
1570 | 1408 | ||
1571 | for (i = 0; i < MAX_BEARERS; i++) { | 1409 | for (i = 0; i < MAX_BEARERS; i++) { |
1572 | if (n_ptr->links[i]) { | 1410 | if (n_ptr->links[i]) { |
1573 | link_print(n_ptr->links[i], TIPC_OUTPUT, | 1411 | link_print(n_ptr->links[i], "Resetting link\n"); |
1574 | "Resetting link\n"); | ||
1575 | tipc_link_reset(n_ptr->links[i]); | 1412 | tipc_link_reset(n_ptr->links[i]); |
1576 | } | 1413 | } |
1577 | } | 1414 | } |
@@ -1585,13 +1422,12 @@ static void link_retransmit_failure(struct link *l_ptr, struct sk_buff *buf) | |||
1585 | struct tipc_msg *msg = buf_msg(buf); | 1422 | struct tipc_msg *msg = buf_msg(buf); |
1586 | 1423 | ||
1587 | warn("Retransmission failure on link <%s>\n", l_ptr->name); | 1424 | warn("Retransmission failure on link <%s>\n", l_ptr->name); |
1588 | tipc_msg_dbg(TIPC_OUTPUT, msg, ">RETR-FAIL>"); | ||
1589 | 1425 | ||
1590 | if (l_ptr->addr) { | 1426 | if (l_ptr->addr) { |
1591 | 1427 | ||
1592 | /* Handle failure on standard link */ | 1428 | /* Handle failure on standard link */ |
1593 | 1429 | ||
1594 | link_print(l_ptr, TIPC_OUTPUT, "Resetting link\n"); | 1430 | link_print(l_ptr, "Resetting link\n"); |
1595 | tipc_link_reset(l_ptr); | 1431 | tipc_link_reset(l_ptr); |
1596 | 1432 | ||
1597 | } else { | 1433 | } else { |
@@ -1601,21 +1437,21 @@ static void link_retransmit_failure(struct link *l_ptr, struct sk_buff *buf) | |||
1601 | struct tipc_node *n_ptr; | 1437 | struct tipc_node *n_ptr; |
1602 | char addr_string[16]; | 1438 | char addr_string[16]; |
1603 | 1439 | ||
1604 | tipc_printf(TIPC_OUTPUT, "Msg seq number: %u, ", msg_seqno(msg)); | 1440 | info("Msg seq number: %u, ", msg_seqno(msg)); |
1605 | tipc_printf(TIPC_OUTPUT, "Outstanding acks: %lu\n", | 1441 | info("Outstanding acks: %lu\n", |
1606 | (unsigned long) TIPC_SKB_CB(buf)->handle); | 1442 | (unsigned long) TIPC_SKB_CB(buf)->handle); |
1607 | 1443 | ||
1608 | n_ptr = l_ptr->owner->next; | 1444 | n_ptr = l_ptr->owner->next; |
1609 | tipc_node_lock(n_ptr); | 1445 | tipc_node_lock(n_ptr); |
1610 | 1446 | ||
1611 | tipc_addr_string_fill(addr_string, n_ptr->addr); | 1447 | tipc_addr_string_fill(addr_string, n_ptr->addr); |
1612 | tipc_printf(TIPC_OUTPUT, "Multicast link info for %s\n", addr_string); | 1448 | info("Multicast link info for %s\n", addr_string); |
1613 | tipc_printf(TIPC_OUTPUT, "Supported: %d, ", n_ptr->bclink.supported); | 1449 | info("Supported: %d, ", n_ptr->bclink.supported); |
1614 | tipc_printf(TIPC_OUTPUT, "Acked: %u\n", n_ptr->bclink.acked); | 1450 | info("Acked: %u\n", n_ptr->bclink.acked); |
1615 | tipc_printf(TIPC_OUTPUT, "Last in: %u, ", n_ptr->bclink.last_in); | 1451 | info("Last in: %u, ", n_ptr->bclink.last_in); |
1616 | tipc_printf(TIPC_OUTPUT, "Gap after: %u, ", n_ptr->bclink.gap_after); | 1452 | info("Gap after: %u, ", n_ptr->bclink.gap_after); |
1617 | tipc_printf(TIPC_OUTPUT, "Gap to: %u\n", n_ptr->bclink.gap_to); | 1453 | info("Gap to: %u\n", n_ptr->bclink.gap_to); |
1618 | tipc_printf(TIPC_OUTPUT, "Nack sync: %u\n\n", n_ptr->bclink.nack_sync); | 1454 | info("Nack sync: %u\n\n", n_ptr->bclink.nack_sync); |
1619 | 1455 | ||
1620 | tipc_k_signal((Handler)link_reset_all, (unsigned long)n_ptr->addr); | 1456 | tipc_k_signal((Handler)link_reset_all, (unsigned long)n_ptr->addr); |
1621 | 1457 | ||
@@ -1635,12 +1471,8 @@ void tipc_link_retransmit(struct link *l_ptr, struct sk_buff *buf, | |||
1635 | 1471 | ||
1636 | msg = buf_msg(buf); | 1472 | msg = buf_msg(buf); |
1637 | 1473 | ||
1638 | dbg("Retransmitting %u in link %x\n", retransmits, l_ptr); | ||
1639 | |||
1640 | if (tipc_bearer_congested(l_ptr->b_ptr, l_ptr)) { | 1474 | if (tipc_bearer_congested(l_ptr->b_ptr, l_ptr)) { |
1641 | if (l_ptr->retransm_queue_size == 0) { | 1475 | if (l_ptr->retransm_queue_size == 0) { |
1642 | msg_dbg(msg, ">NO_RETR->BCONG>"); | ||
1643 | dbg_print_link(l_ptr, " "); | ||
1644 | l_ptr->retransm_queue_head = msg_seqno(msg); | 1476 | l_ptr->retransm_queue_head = msg_seqno(msg); |
1645 | l_ptr->retransm_queue_size = retransmits; | 1477 | l_ptr->retransm_queue_size = retransmits; |
1646 | } else { | 1478 | } else { |
@@ -1667,7 +1499,6 @@ void tipc_link_retransmit(struct link *l_ptr, struct sk_buff *buf, | |||
1667 | msg_set_ack(msg, mod(l_ptr->next_in_no - 1)); | 1499 | msg_set_ack(msg, mod(l_ptr->next_in_no - 1)); |
1668 | msg_set_bcast_ack(msg, l_ptr->owner->bclink.last_in); | 1500 | msg_set_bcast_ack(msg, l_ptr->owner->bclink.last_in); |
1669 | if (tipc_bearer_send(l_ptr->b_ptr, buf, &l_ptr->media_addr)) { | 1501 | if (tipc_bearer_send(l_ptr->b_ptr, buf, &l_ptr->media_addr)) { |
1670 | msg_dbg(buf_msg(buf), ">RETR>"); | ||
1671 | buf = buf->next; | 1502 | buf = buf->next; |
1672 | retransmits--; | 1503 | retransmits--; |
1673 | l_ptr->stats.retransmitted++; | 1504 | l_ptr->stats.retransmitted++; |
@@ -1793,9 +1624,8 @@ void tipc_recv_msg(struct sk_buff *head, struct tipc_bearer *tb_ptr) | |||
1793 | 1624 | ||
1794 | /* Ensure message data is a single contiguous unit */ | 1625 | /* Ensure message data is a single contiguous unit */ |
1795 | 1626 | ||
1796 | if (unlikely(buf_linearize(buf))) { | 1627 | if (unlikely(buf_linearize(buf))) |
1797 | goto cont; | 1628 | goto cont; |
1798 | } | ||
1799 | 1629 | ||
1800 | /* Handle arrival of a non-unicast link message */ | 1630 | /* Handle arrival of a non-unicast link message */ |
1801 | 1631 | ||
@@ -1907,7 +1737,7 @@ deliver: | |||
1907 | continue; | 1737 | continue; |
1908 | case ROUTE_DISTRIBUTOR: | 1738 | case ROUTE_DISTRIBUTOR: |
1909 | tipc_node_unlock(n_ptr); | 1739 | tipc_node_unlock(n_ptr); |
1910 | tipc_cltr_recv_routing_table(buf); | 1740 | buf_discard(buf); |
1911 | continue; | 1741 | continue; |
1912 | case NAME_DISTRIBUTOR: | 1742 | case NAME_DISTRIBUTOR: |
1913 | tipc_node_unlock(n_ptr); | 1743 | tipc_node_unlock(n_ptr); |
@@ -1953,12 +1783,10 @@ deliver: | |||
1953 | tipc_node_unlock(n_ptr); | 1783 | tipc_node_unlock(n_ptr); |
1954 | continue; | 1784 | continue; |
1955 | } | 1785 | } |
1956 | msg_dbg(msg,"NSEQ<REC<"); | ||
1957 | link_state_event(l_ptr, TRAFFIC_MSG_EVT); | 1786 | link_state_event(l_ptr, TRAFFIC_MSG_EVT); |
1958 | 1787 | ||
1959 | if (link_working_working(l_ptr)) { | 1788 | if (link_working_working(l_ptr)) { |
1960 | /* Re-insert in front of queue */ | 1789 | /* Re-insert in front of queue */ |
1961 | msg_dbg(msg,"RECV-REINS:"); | ||
1962 | buf->next = head; | 1790 | buf->next = head; |
1963 | head = buf; | 1791 | head = buf; |
1964 | tipc_node_unlock(n_ptr); | 1792 | tipc_node_unlock(n_ptr); |
@@ -2012,13 +1840,11 @@ u32 tipc_link_defer_pkt(struct sk_buff **head, | |||
2012 | *head = buf; | 1840 | *head = buf; |
2013 | return 1; | 1841 | return 1; |
2014 | } | 1842 | } |
2015 | if (seq_no == msg_seqno(msg)) { | 1843 | if (seq_no == msg_seqno(msg)) |
2016 | break; | 1844 | break; |
2017 | } | ||
2018 | prev = crs; | 1845 | prev = crs; |
2019 | crs = crs->next; | 1846 | crs = crs->next; |
2020 | } | 1847 | } while (crs); |
2021 | while (crs); | ||
2022 | 1848 | ||
2023 | /* Message is a duplicate of an existing message */ | 1849 | /* Message is a duplicate of an existing message */ |
2024 | 1850 | ||
@@ -2040,9 +1866,6 @@ static void link_handle_out_of_seq_msg(struct link *l_ptr, | |||
2040 | return; | 1866 | return; |
2041 | } | 1867 | } |
2042 | 1868 | ||
2043 | dbg("rx OOS msg: seq_no %u, expecting %u (%u)\n", | ||
2044 | seq_no, mod(l_ptr->next_in_no), l_ptr->next_in_no); | ||
2045 | |||
2046 | /* Record OOS packet arrival (force mismatch on next timeout) */ | 1869 | /* Record OOS packet arrival (force mismatch on next timeout) */ |
2047 | 1870 | ||
2048 | l_ptr->checkpoint--; | 1871 | l_ptr->checkpoint--; |
@@ -2132,11 +1955,10 @@ void tipc_link_send_proto_msg(struct link *l_ptr, u32 msg_typ, int probe_msg, | |||
2132 | msg_set_max_pkt(msg, l_ptr->max_pkt_target); | 1955 | msg_set_max_pkt(msg, l_ptr->max_pkt_target); |
2133 | } | 1956 | } |
2134 | 1957 | ||
2135 | if (tipc_node_has_redundant_links(l_ptr->owner)) { | 1958 | if (tipc_node_has_redundant_links(l_ptr->owner)) |
2136 | msg_set_redundant_link(msg); | 1959 | msg_set_redundant_link(msg); |
2137 | } else { | 1960 | else |
2138 | msg_clear_redundant_link(msg); | 1961 | msg_clear_redundant_link(msg); |
2139 | } | ||
2140 | msg_set_linkprio(msg, l_ptr->priority); | 1962 | msg_set_linkprio(msg, l_ptr->priority); |
2141 | 1963 | ||
2142 | /* Ensure sequence number will not fit : */ | 1964 | /* Ensure sequence number will not fit : */ |
@@ -2160,8 +1982,6 @@ void tipc_link_send_proto_msg(struct link *l_ptr, u32 msg_typ, int probe_msg, | |||
2160 | 1982 | ||
2161 | /* Message can be sent */ | 1983 | /* Message can be sent */ |
2162 | 1984 | ||
2163 | msg_dbg(msg, ">>"); | ||
2164 | |||
2165 | buf = tipc_buf_acquire(msg_size); | 1985 | buf = tipc_buf_acquire(msg_size); |
2166 | if (!buf) | 1986 | if (!buf) |
2167 | return; | 1987 | return; |
@@ -2195,8 +2015,6 @@ static void link_recv_proto_msg(struct link *l_ptr, struct sk_buff *buf) | |||
2195 | u32 msg_tol; | 2015 | u32 msg_tol; |
2196 | struct tipc_msg *msg = buf_msg(buf); | 2016 | struct tipc_msg *msg = buf_msg(buf); |
2197 | 2017 | ||
2198 | dbg("AT(%u):", jiffies_to_msecs(jiffies)); | ||
2199 | msg_dbg(msg, "<<"); | ||
2200 | if (link_blocked(l_ptr)) | 2018 | if (link_blocked(l_ptr)) |
2201 | goto exit; | 2019 | goto exit; |
2202 | 2020 | ||
@@ -2215,11 +2033,8 @@ static void link_recv_proto_msg(struct link *l_ptr, struct sk_buff *buf) | |||
2215 | case RESET_MSG: | 2033 | case RESET_MSG: |
2216 | if (!link_working_unknown(l_ptr) && | 2034 | if (!link_working_unknown(l_ptr) && |
2217 | (l_ptr->peer_session != INVALID_SESSION)) { | 2035 | (l_ptr->peer_session != INVALID_SESSION)) { |
2218 | if (msg_session(msg) == l_ptr->peer_session) { | 2036 | if (msg_session(msg) == l_ptr->peer_session) |
2219 | dbg("Duplicate RESET: %u<->%u\n", | ||
2220 | msg_session(msg), l_ptr->peer_session); | ||
2221 | break; /* duplicate: ignore */ | 2037 | break; /* duplicate: ignore */ |
2222 | } | ||
2223 | } | 2038 | } |
2224 | /* fall thru' */ | 2039 | /* fall thru' */ |
2225 | case ACTIVATE_MSG: | 2040 | case ACTIVATE_MSG: |
@@ -2227,8 +2042,8 @@ static void link_recv_proto_msg(struct link *l_ptr, struct sk_buff *buf) | |||
2227 | 2042 | ||
2228 | strcpy((strrchr(l_ptr->name, ':') + 1), (char *)msg_data(msg)); | 2043 | strcpy((strrchr(l_ptr->name, ':') + 1), (char *)msg_data(msg)); |
2229 | 2044 | ||
2230 | if ((msg_tol = msg_link_tolerance(msg)) && | 2045 | msg_tol = msg_link_tolerance(msg); |
2231 | (msg_tol > l_ptr->tolerance)) | 2046 | if (msg_tol > l_ptr->tolerance) |
2232 | link_set_supervision_props(l_ptr, msg_tol); | 2047 | link_set_supervision_props(l_ptr, msg_tol); |
2233 | 2048 | ||
2234 | if (msg_linkprio(msg) > l_ptr->priority) | 2049 | if (msg_linkprio(msg) > l_ptr->priority) |
@@ -2251,13 +2066,13 @@ static void link_recv_proto_msg(struct link *l_ptr, struct sk_buff *buf) | |||
2251 | l_ptr->peer_bearer_id = msg_bearer_id(msg); | 2066 | l_ptr->peer_bearer_id = msg_bearer_id(msg); |
2252 | 2067 | ||
2253 | /* Synchronize broadcast sequence numbers */ | 2068 | /* Synchronize broadcast sequence numbers */ |
2254 | if (!tipc_node_has_redundant_links(l_ptr->owner)) { | 2069 | if (!tipc_node_has_redundant_links(l_ptr->owner)) |
2255 | l_ptr->owner->bclink.last_in = mod(msg_last_bcast(msg)); | 2070 | l_ptr->owner->bclink.last_in = mod(msg_last_bcast(msg)); |
2256 | } | ||
2257 | break; | 2071 | break; |
2258 | case STATE_MSG: | 2072 | case STATE_MSG: |
2259 | 2073 | ||
2260 | if ((msg_tol = msg_link_tolerance(msg))) | 2074 | msg_tol = msg_link_tolerance(msg); |
2075 | if (msg_tol) | ||
2261 | link_set_supervision_props(l_ptr, msg_tol); | 2076 | link_set_supervision_props(l_ptr, msg_tol); |
2262 | 2077 | ||
2263 | if (msg_linkprio(msg) && | 2078 | if (msg_linkprio(msg) && |
@@ -2280,8 +2095,6 @@ static void link_recv_proto_msg(struct link *l_ptr, struct sk_buff *buf) | |||
2280 | 2095 | ||
2281 | max_pkt_ack = msg_max_pkt(msg); | 2096 | max_pkt_ack = msg_max_pkt(msg); |
2282 | if (max_pkt_ack > l_ptr->max_pkt) { | 2097 | if (max_pkt_ack > l_ptr->max_pkt) { |
2283 | dbg("Link <%s> updated MTU %u -> %u\n", | ||
2284 | l_ptr->name, l_ptr->max_pkt, max_pkt_ack); | ||
2285 | l_ptr->max_pkt = max_pkt_ack; | 2098 | l_ptr->max_pkt = max_pkt_ack; |
2286 | l_ptr->max_pkt_probes = 0; | 2099 | l_ptr->max_pkt_probes = 0; |
2287 | } | 2100 | } |
@@ -2289,9 +2102,8 @@ static void link_recv_proto_msg(struct link *l_ptr, struct sk_buff *buf) | |||
2289 | max_pkt_ack = 0; | 2102 | max_pkt_ack = 0; |
2290 | if (msg_probe(msg)) { | 2103 | if (msg_probe(msg)) { |
2291 | l_ptr->stats.recv_probes++; | 2104 | l_ptr->stats.recv_probes++; |
2292 | if (msg_size(msg) > sizeof(l_ptr->proto_msg)) { | 2105 | if (msg_size(msg) > sizeof(l_ptr->proto_msg)) |
2293 | max_pkt_ack = msg_size(msg); | 2106 | max_pkt_ack = msg_size(msg); |
2294 | } | ||
2295 | } | 2107 | } |
2296 | 2108 | ||
2297 | /* Protocol message before retransmits, reduce loss risk */ | 2109 | /* Protocol message before retransmits, reduce loss risk */ |
@@ -2303,14 +2115,11 @@ static void link_recv_proto_msg(struct link *l_ptr, struct sk_buff *buf) | |||
2303 | 0, rec_gap, 0, 0, max_pkt_ack); | 2115 | 0, rec_gap, 0, 0, max_pkt_ack); |
2304 | } | 2116 | } |
2305 | if (msg_seq_gap(msg)) { | 2117 | if (msg_seq_gap(msg)) { |
2306 | msg_dbg(msg, "With Gap:"); | ||
2307 | l_ptr->stats.recv_nacks++; | 2118 | l_ptr->stats.recv_nacks++; |
2308 | tipc_link_retransmit(l_ptr, l_ptr->first_out, | 2119 | tipc_link_retransmit(l_ptr, l_ptr->first_out, |
2309 | msg_seq_gap(msg)); | 2120 | msg_seq_gap(msg)); |
2310 | } | 2121 | } |
2311 | break; | 2122 | break; |
2312 | default: | ||
2313 | msg_dbg(buf_msg(buf), "<DISCARDING UNKNOWN<"); | ||
2314 | } | 2123 | } |
2315 | exit: | 2124 | exit: |
2316 | buf_discard(buf); | 2125 | buf_discard(buf); |
@@ -2345,8 +2154,6 @@ static void tipc_link_tunnel(struct link *l_ptr, | |||
2345 | } | 2154 | } |
2346 | skb_copy_to_linear_data(buf, tunnel_hdr, INT_H_SIZE); | 2155 | skb_copy_to_linear_data(buf, tunnel_hdr, INT_H_SIZE); |
2347 | skb_copy_to_linear_data_offset(buf, INT_H_SIZE, msg, length); | 2156 | skb_copy_to_linear_data_offset(buf, INT_H_SIZE, msg, length); |
2348 | dbg("%c->%c:", l_ptr->b_ptr->net_plane, tunnel->b_ptr->net_plane); | ||
2349 | msg_dbg(buf_msg(buf), ">SEND>"); | ||
2350 | tipc_link_send_buf(tunnel, buf); | 2157 | tipc_link_send_buf(tunnel, buf); |
2351 | } | 2158 | } |
2352 | 2159 | ||
@@ -2378,7 +2185,6 @@ void tipc_link_changeover(struct link *l_ptr) | |||
2378 | ORIGINAL_MSG, INT_H_SIZE, l_ptr->addr); | 2185 | ORIGINAL_MSG, INT_H_SIZE, l_ptr->addr); |
2379 | msg_set_bearer_id(&tunnel_hdr, l_ptr->peer_bearer_id); | 2186 | msg_set_bearer_id(&tunnel_hdr, l_ptr->peer_bearer_id); |
2380 | msg_set_msgcnt(&tunnel_hdr, msgcount); | 2187 | msg_set_msgcnt(&tunnel_hdr, msgcount); |
2381 | dbg("Link changeover requires %u tunnel messages\n", msgcount); | ||
2382 | 2188 | ||
2383 | if (!l_ptr->first_out) { | 2189 | if (!l_ptr->first_out) { |
2384 | struct sk_buff *buf; | 2190 | struct sk_buff *buf; |
@@ -2387,9 +2193,6 @@ void tipc_link_changeover(struct link *l_ptr) | |||
2387 | if (buf) { | 2193 | if (buf) { |
2388 | skb_copy_to_linear_data(buf, &tunnel_hdr, INT_H_SIZE); | 2194 | skb_copy_to_linear_data(buf, &tunnel_hdr, INT_H_SIZE); |
2389 | msg_set_size(&tunnel_hdr, INT_H_SIZE); | 2195 | msg_set_size(&tunnel_hdr, INT_H_SIZE); |
2390 | dbg("%c->%c:", l_ptr->b_ptr->net_plane, | ||
2391 | tunnel->b_ptr->net_plane); | ||
2392 | msg_dbg(&tunnel_hdr, "EMPTY>SEND>"); | ||
2393 | tipc_link_send_buf(tunnel, buf); | 2196 | tipc_link_send_buf(tunnel, buf); |
2394 | } else { | 2197 | } else { |
2395 | warn("Link changeover error, " | 2198 | warn("Link changeover error, " |
@@ -2406,11 +2209,11 @@ void tipc_link_changeover(struct link *l_ptr) | |||
2406 | 2209 | ||
2407 | if ((msg_user(msg) == MSG_BUNDLER) && split_bundles) { | 2210 | if ((msg_user(msg) == MSG_BUNDLER) && split_bundles) { |
2408 | struct tipc_msg *m = msg_get_wrapped(msg); | 2211 | struct tipc_msg *m = msg_get_wrapped(msg); |
2409 | unchar* pos = (unchar*)m; | 2212 | unchar *pos = (unchar *)m; |
2410 | 2213 | ||
2411 | msgcount = msg_msgcnt(msg); | 2214 | msgcount = msg_msgcnt(msg); |
2412 | while (msgcount--) { | 2215 | while (msgcount--) { |
2413 | msg_set_seqno(m,msg_seqno(msg)); | 2216 | msg_set_seqno(m, msg_seqno(msg)); |
2414 | tipc_link_tunnel(l_ptr, &tunnel_hdr, m, | 2217 | tipc_link_tunnel(l_ptr, &tunnel_hdr, m, |
2415 | msg_link_selector(m)); | 2218 | msg_link_selector(m)); |
2416 | pos += align(msg_size(m)); | 2219 | pos += align(msg_size(m)); |
@@ -2453,9 +2256,6 @@ void tipc_link_send_duplicate(struct link *l_ptr, struct link *tunnel) | |||
2453 | skb_copy_to_linear_data(outbuf, &tunnel_hdr, INT_H_SIZE); | 2256 | skb_copy_to_linear_data(outbuf, &tunnel_hdr, INT_H_SIZE); |
2454 | skb_copy_to_linear_data_offset(outbuf, INT_H_SIZE, iter->data, | 2257 | skb_copy_to_linear_data_offset(outbuf, INT_H_SIZE, iter->data, |
2455 | length); | 2258 | length); |
2456 | dbg("%c->%c:", l_ptr->b_ptr->net_plane, | ||
2457 | tunnel->b_ptr->net_plane); | ||
2458 | msg_dbg(buf_msg(outbuf), ">SEND>"); | ||
2459 | tipc_link_send_buf(tunnel, outbuf); | 2259 | tipc_link_send_buf(tunnel, outbuf); |
2460 | if (!tipc_link_is_up(l_ptr)) | 2260 | if (!tipc_link_is_up(l_ptr)) |
2461 | return; | 2261 | return; |
@@ -2502,31 +2302,24 @@ static int link_recv_changeover_msg(struct link **l_ptr, | |||
2502 | u32 msg_count = msg_msgcnt(tunnel_msg); | 2302 | u32 msg_count = msg_msgcnt(tunnel_msg); |
2503 | 2303 | ||
2504 | dest_link = (*l_ptr)->owner->links[msg_bearer_id(tunnel_msg)]; | 2304 | dest_link = (*l_ptr)->owner->links[msg_bearer_id(tunnel_msg)]; |
2505 | if (!dest_link) { | 2305 | if (!dest_link) |
2506 | msg_dbg(tunnel_msg, "NOLINK/<REC<"); | ||
2507 | goto exit; | 2306 | goto exit; |
2508 | } | ||
2509 | if (dest_link == *l_ptr) { | 2307 | if (dest_link == *l_ptr) { |
2510 | err("Unexpected changeover message on link <%s>\n", | 2308 | err("Unexpected changeover message on link <%s>\n", |
2511 | (*l_ptr)->name); | 2309 | (*l_ptr)->name); |
2512 | goto exit; | 2310 | goto exit; |
2513 | } | 2311 | } |
2514 | dbg("%c<-%c:", dest_link->b_ptr->net_plane, | ||
2515 | (*l_ptr)->b_ptr->net_plane); | ||
2516 | *l_ptr = dest_link; | 2312 | *l_ptr = dest_link; |
2517 | msg = msg_get_wrapped(tunnel_msg); | 2313 | msg = msg_get_wrapped(tunnel_msg); |
2518 | 2314 | ||
2519 | if (msg_typ == DUPLICATE_MSG) { | 2315 | if (msg_typ == DUPLICATE_MSG) { |
2520 | if (less(msg_seqno(msg), mod(dest_link->next_in_no))) { | 2316 | if (less(msg_seqno(msg), mod(dest_link->next_in_no))) |
2521 | msg_dbg(tunnel_msg, "DROP/<REC<"); | ||
2522 | goto exit; | 2317 | goto exit; |
2523 | } | 2318 | *buf = buf_extract(tunnel_buf, INT_H_SIZE); |
2524 | *buf = buf_extract(tunnel_buf,INT_H_SIZE); | ||
2525 | if (*buf == NULL) { | 2319 | if (*buf == NULL) { |
2526 | warn("Link changeover error, duplicate msg dropped\n"); | 2320 | warn("Link changeover error, duplicate msg dropped\n"); |
2527 | goto exit; | 2321 | goto exit; |
2528 | } | 2322 | } |
2529 | msg_dbg(tunnel_msg, "TNL<REC<"); | ||
2530 | buf_discard(tunnel_buf); | 2323 | buf_discard(tunnel_buf); |
2531 | return 1; | 2324 | return 1; |
2532 | } | 2325 | } |
@@ -2534,18 +2327,14 @@ static int link_recv_changeover_msg(struct link **l_ptr, | |||
2534 | /* First original message ?: */ | 2327 | /* First original message ?: */ |
2535 | 2328 | ||
2536 | if (tipc_link_is_up(dest_link)) { | 2329 | if (tipc_link_is_up(dest_link)) { |
2537 | msg_dbg(tunnel_msg, "UP/FIRST/<REC<"); | ||
2538 | info("Resetting link <%s>, changeover initiated by peer\n", | 2330 | info("Resetting link <%s>, changeover initiated by peer\n", |
2539 | dest_link->name); | 2331 | dest_link->name); |
2540 | tipc_link_reset(dest_link); | 2332 | tipc_link_reset(dest_link); |
2541 | dest_link->exp_msg_count = msg_count; | 2333 | dest_link->exp_msg_count = msg_count; |
2542 | dbg("Expecting %u tunnelled messages\n", msg_count); | ||
2543 | if (!msg_count) | 2334 | if (!msg_count) |
2544 | goto exit; | 2335 | goto exit; |
2545 | } else if (dest_link->exp_msg_count == START_CHANGEOVER) { | 2336 | } else if (dest_link->exp_msg_count == START_CHANGEOVER) { |
2546 | msg_dbg(tunnel_msg, "BLK/FIRST/<REC<"); | ||
2547 | dest_link->exp_msg_count = msg_count; | 2337 | dest_link->exp_msg_count = msg_count; |
2548 | dbg("Expecting %u tunnelled messages\n", msg_count); | ||
2549 | if (!msg_count) | 2338 | if (!msg_count) |
2550 | goto exit; | 2339 | goto exit; |
2551 | } | 2340 | } |
@@ -2555,18 +2344,14 @@ static int link_recv_changeover_msg(struct link **l_ptr, | |||
2555 | if (dest_link->exp_msg_count == 0) { | 2344 | if (dest_link->exp_msg_count == 0) { |
2556 | warn("Link switchover error, " | 2345 | warn("Link switchover error, " |
2557 | "got too many tunnelled messages\n"); | 2346 | "got too many tunnelled messages\n"); |
2558 | msg_dbg(tunnel_msg, "OVERDUE/DROP/<REC<"); | ||
2559 | dbg_print_link(dest_link, "LINK:"); | ||
2560 | goto exit; | 2347 | goto exit; |
2561 | } | 2348 | } |
2562 | dest_link->exp_msg_count--; | 2349 | dest_link->exp_msg_count--; |
2563 | if (less(msg_seqno(msg), dest_link->reset_checkpoint)) { | 2350 | if (less(msg_seqno(msg), dest_link->reset_checkpoint)) { |
2564 | msg_dbg(tunnel_msg, "DROP/DUPL/<REC<"); | ||
2565 | goto exit; | 2351 | goto exit; |
2566 | } else { | 2352 | } else { |
2567 | *buf = buf_extract(tunnel_buf, INT_H_SIZE); | 2353 | *buf = buf_extract(tunnel_buf, INT_H_SIZE); |
2568 | if (*buf != NULL) { | 2354 | if (*buf != NULL) { |
2569 | msg_dbg(tunnel_msg, "TNL<REC<"); | ||
2570 | buf_discard(tunnel_buf); | 2355 | buf_discard(tunnel_buf); |
2571 | return 1; | 2356 | return 1; |
2572 | } else { | 2357 | } else { |
@@ -2588,7 +2373,6 @@ void tipc_link_recv_bundle(struct sk_buff *buf) | |||
2588 | u32 pos = INT_H_SIZE; | 2373 | u32 pos = INT_H_SIZE; |
2589 | struct sk_buff *obuf; | 2374 | struct sk_buff *obuf; |
2590 | 2375 | ||
2591 | msg_dbg(buf_msg(buf), "<BNDL<: "); | ||
2592 | while (msgcount--) { | 2376 | while (msgcount--) { |
2593 | obuf = buf_extract(buf, pos); | 2377 | obuf = buf_extract(buf, pos); |
2594 | if (obuf == NULL) { | 2378 | if (obuf == NULL) { |
@@ -2596,7 +2380,6 @@ void tipc_link_recv_bundle(struct sk_buff *buf) | |||
2596 | break; | 2380 | break; |
2597 | } | 2381 | } |
2598 | pos += align(msg_size(buf_msg(obuf))); | 2382 | pos += align(msg_size(buf_msg(obuf))); |
2599 | msg_dbg(buf_msg(obuf), " /"); | ||
2600 | tipc_net_route_msg(obuf); | 2383 | tipc_net_route_msg(obuf); |
2601 | } | 2384 | } |
2602 | buf_discard(buf); | 2385 | buf_discard(buf); |
@@ -2733,7 +2516,6 @@ int tipc_link_recv_fragment(struct sk_buff **pending, struct sk_buff **fb, | |||
2733 | u32 long_msg_seq_no = msg_long_msgno(fragm); | 2516 | u32 long_msg_seq_no = msg_long_msgno(fragm); |
2734 | 2517 | ||
2735 | *fb = NULL; | 2518 | *fb = NULL; |
2736 | msg_dbg(fragm,"FRG<REC<"); | ||
2737 | 2519 | ||
2738 | /* Is there an incomplete message waiting for this fragment? */ | 2520 | /* Is there an incomplete message waiting for this fragment? */ |
2739 | 2521 | ||
@@ -2752,7 +2534,6 @@ int tipc_link_recv_fragment(struct sk_buff **pending, struct sk_buff **fb, | |||
2752 | if (msg_type(imsg) == TIPC_MCAST_MSG) | 2534 | if (msg_type(imsg) == TIPC_MCAST_MSG) |
2753 | max = TIPC_MAX_USER_MSG_SIZE + MCAST_H_SIZE; | 2535 | max = TIPC_MAX_USER_MSG_SIZE + MCAST_H_SIZE; |
2754 | if (msg_size(imsg) > max) { | 2536 | if (msg_size(imsg) > max) { |
2755 | msg_dbg(fragm,"<REC<Oversized: "); | ||
2756 | buf_discard(fbuf); | 2537 | buf_discard(fbuf); |
2757 | return 0; | 2538 | return 0; |
2758 | } | 2539 | } |
@@ -2765,8 +2546,8 @@ int tipc_link_recv_fragment(struct sk_buff **pending, struct sk_buff **fb, | |||
2765 | /* Prepare buffer for subsequent fragments. */ | 2546 | /* Prepare buffer for subsequent fragments. */ |
2766 | 2547 | ||
2767 | set_long_msg_seqno(pbuf, long_msg_seq_no); | 2548 | set_long_msg_seqno(pbuf, long_msg_seq_no); |
2768 | set_fragm_size(pbuf,fragm_sz); | 2549 | set_fragm_size(pbuf, fragm_sz); |
2769 | set_expected_frags(pbuf,exp_fragm_cnt - 1); | 2550 | set_expected_frags(pbuf, exp_fragm_cnt - 1); |
2770 | } else { | 2551 | } else { |
2771 | warn("Link unable to reassemble fragmented message\n"); | 2552 | warn("Link unable to reassemble fragmented message\n"); |
2772 | } | 2553 | } |
@@ -2793,13 +2574,9 @@ int tipc_link_recv_fragment(struct sk_buff **pending, struct sk_buff **fb, | |||
2793 | *m = buf_msg(pbuf); | 2574 | *m = buf_msg(pbuf); |
2794 | return 1; | 2575 | return 1; |
2795 | } | 2576 | } |
2796 | set_expected_frags(pbuf,exp_frags); | 2577 | set_expected_frags(pbuf, exp_frags); |
2797 | return 0; | 2578 | return 0; |
2798 | } | 2579 | } |
2799 | dbg(" Discarding orphan fragment %x\n",fbuf); | ||
2800 | msg_dbg(fragm,"ORPHAN:"); | ||
2801 | dbg("Pending long buffers:\n"); | ||
2802 | dbg_print_buf_chain(*pending); | ||
2803 | buf_discard(fbuf); | 2580 | buf_discard(fbuf); |
2804 | return 0; | 2581 | return 0; |
2805 | } | 2582 | } |
@@ -2827,11 +2604,6 @@ static void link_check_defragm_bufs(struct link *l_ptr) | |||
2827 | incr_timer_cnt(buf); | 2604 | incr_timer_cnt(buf); |
2828 | prev = buf; | 2605 | prev = buf; |
2829 | } else { | 2606 | } else { |
2830 | dbg(" Discarding incomplete long buffer\n"); | ||
2831 | msg_dbg(buf_msg(buf), "LONG:"); | ||
2832 | dbg_print_link(l_ptr, "curr:"); | ||
2833 | dbg("Pending long buffers:\n"); | ||
2834 | dbg_print_buf_chain(l_ptr->defragm_buf); | ||
2835 | if (prev) | 2607 | if (prev) |
2836 | prev->next = buf->next; | 2608 | prev->next = buf->next; |
2837 | else | 2609 | else |
@@ -2866,7 +2638,6 @@ void tipc_link_set_queue_limits(struct link *l_ptr, u32 window) | |||
2866 | l_ptr->queue_limit[TIPC_HIGH_IMPORTANCE + 4] = 900; | 2638 | l_ptr->queue_limit[TIPC_HIGH_IMPORTANCE + 4] = 900; |
2867 | l_ptr->queue_limit[TIPC_CRITICAL_IMPORTANCE + 4] = 1200; | 2639 | l_ptr->queue_limit[TIPC_CRITICAL_IMPORTANCE + 4] = 1200; |
2868 | l_ptr->queue_limit[CONN_MANAGER] = 1200; | 2640 | l_ptr->queue_limit[CONN_MANAGER] = 1200; |
2869 | l_ptr->queue_limit[ROUTE_DISTRIBUTOR] = 1200; | ||
2870 | l_ptr->queue_limit[CHANGEOVER_PROTOCOL] = 2500; | 2641 | l_ptr->queue_limit[CHANGEOVER_PROTOCOL] = 2500; |
2871 | l_ptr->queue_limit[NAME_DISTRIBUTOR] = 3000; | 2642 | l_ptr->queue_limit[NAME_DISTRIBUTOR] = 3000; |
2872 | /* FRAGMENT and LAST_FRAGMENT packets */ | 2643 | /* FRAGMENT and LAST_FRAGMENT packets */ |
@@ -3168,7 +2939,7 @@ u32 tipc_link_get_max_pkt(u32 dest, u32 selector) | |||
3168 | return MAX_MSG_SIZE; | 2939 | return MAX_MSG_SIZE; |
3169 | 2940 | ||
3170 | read_lock_bh(&tipc_net_lock); | 2941 | read_lock_bh(&tipc_net_lock); |
3171 | n_ptr = tipc_node_select(dest, selector); | 2942 | n_ptr = tipc_node_find(dest); |
3172 | if (n_ptr) { | 2943 | if (n_ptr) { |
3173 | tipc_node_lock(n_ptr); | 2944 | tipc_node_lock(n_ptr); |
3174 | l_ptr = n_ptr->active_links[selector & 1]; | 2945 | l_ptr = n_ptr->active_links[selector & 1]; |
@@ -3180,27 +2951,22 @@ u32 tipc_link_get_max_pkt(u32 dest, u32 selector) | |||
3180 | return res; | 2951 | return res; |
3181 | } | 2952 | } |
3182 | 2953 | ||
3183 | static void link_dump_send_queue(struct link *l_ptr) | 2954 | static void link_print(struct link *l_ptr, const char *str) |
3184 | { | 2955 | { |
3185 | if (l_ptr->next_out) { | 2956 | char print_area[256]; |
3186 | info("\nContents of unsent queue:\n"); | 2957 | struct print_buf pb; |
3187 | dbg_print_buf_chain(l_ptr->next_out); | 2958 | struct print_buf *buf = &pb; |
3188 | } | 2959 | |
3189 | info("\nContents of send queue:\n"); | 2960 | tipc_printbuf_init(buf, print_area, sizeof(print_area)); |
3190 | if (l_ptr->first_out) { | ||
3191 | dbg_print_buf_chain(l_ptr->first_out); | ||
3192 | } | ||
3193 | info("Empty send queue\n"); | ||
3194 | } | ||
3195 | 2961 | ||
3196 | static void link_print(struct link *l_ptr, struct print_buf *buf, | ||
3197 | const char *str) | ||
3198 | { | ||
3199 | tipc_printf(buf, str); | 2962 | tipc_printf(buf, str); |
3200 | if (link_reset_reset(l_ptr) || link_reset_unknown(l_ptr)) | ||
3201 | return; | ||
3202 | tipc_printf(buf, "Link %x<%s>:", | 2963 | tipc_printf(buf, "Link %x<%s>:", |
3203 | l_ptr->addr, l_ptr->b_ptr->publ.name); | 2964 | l_ptr->addr, l_ptr->b_ptr->publ.name); |
2965 | |||
2966 | #ifdef CONFIG_TIPC_DEBUG | ||
2967 | if (link_reset_reset(l_ptr) || link_reset_unknown(l_ptr)) | ||
2968 | goto print_state; | ||
2969 | |||
3204 | tipc_printf(buf, ": NXO(%u):", mod(l_ptr->next_out_no)); | 2970 | tipc_printf(buf, ": NXO(%u):", mod(l_ptr->next_out_no)); |
3205 | tipc_printf(buf, "NXI(%u):", mod(l_ptr->next_in_no)); | 2971 | tipc_printf(buf, "NXI(%u):", mod(l_ptr->next_in_no)); |
3206 | tipc_printf(buf, "SQUE"); | 2972 | tipc_printf(buf, "SQUE"); |
@@ -3218,7 +2984,6 @@ static void link_print(struct link *l_ptr, struct print_buf *buf, | |||
3218 | tipc_printf(buf, "first_out= %x ", l_ptr->first_out); | 2984 | tipc_printf(buf, "first_out= %x ", l_ptr->first_out); |
3219 | tipc_printf(buf, "next_out= %x ", l_ptr->next_out); | 2985 | tipc_printf(buf, "next_out= %x ", l_ptr->next_out); |
3220 | tipc_printf(buf, "last_out= %x ", l_ptr->last_out); | 2986 | tipc_printf(buf, "last_out= %x ", l_ptr->last_out); |
3221 | link_dump_send_queue(l_ptr); | ||
3222 | } | 2987 | } |
3223 | } else | 2988 | } else |
3224 | tipc_printf(buf, "[]"); | 2989 | tipc_printf(buf, "[]"); |
@@ -3232,14 +2997,20 @@ static void link_print(struct link *l_ptr, struct print_buf *buf, | |||
3232 | l_ptr->deferred_inqueue_sz); | 2997 | l_ptr->deferred_inqueue_sz); |
3233 | } | 2998 | } |
3234 | } | 2999 | } |
3000 | print_state: | ||
3001 | #endif | ||
3002 | |||
3235 | if (link_working_unknown(l_ptr)) | 3003 | if (link_working_unknown(l_ptr)) |
3236 | tipc_printf(buf, ":WU"); | 3004 | tipc_printf(buf, ":WU"); |
3237 | if (link_reset_reset(l_ptr)) | 3005 | else if (link_reset_reset(l_ptr)) |
3238 | tipc_printf(buf, ":RR"); | 3006 | tipc_printf(buf, ":RR"); |
3239 | if (link_reset_unknown(l_ptr)) | 3007 | else if (link_reset_unknown(l_ptr)) |
3240 | tipc_printf(buf, ":RU"); | 3008 | tipc_printf(buf, ":RU"); |
3241 | if (link_working_working(l_ptr)) | 3009 | else if (link_working_working(l_ptr)) |
3242 | tipc_printf(buf, ":WW"); | 3010 | tipc_printf(buf, ":WW"); |
3243 | tipc_printf(buf, "\n"); | 3011 | tipc_printf(buf, "\n"); |
3012 | |||
3013 | tipc_printbuf_validate(buf); | ||
3014 | info("%s", print_area); | ||
3244 | } | 3015 | } |
3245 | 3016 | ||