diff options
Diffstat (limited to 'net/tipc/link.c')
-rw-r--r-- | net/tipc/link.c | 119 |
1 files changed, 3 insertions, 116 deletions
diff --git a/net/tipc/link.c b/net/tipc/link.c index 671ffd3c0e53..cb10d20caef3 100644 --- a/net/tipc/link.c +++ b/net/tipc/link.c | |||
@@ -153,18 +153,6 @@ static void dbg_print_link(struct link *l_ptr, const char *str) | |||
153 | link_print(l_ptr, DBG_OUTPUT, str); | 153 | link_print(l_ptr, DBG_OUTPUT, str); |
154 | } | 154 | } |
155 | 155 | ||
156 | static void dbg_print_buf_chain(struct sk_buff *root_buf) | ||
157 | { | ||
158 | if (DBG_OUTPUT != TIPC_NULL) { | ||
159 | struct sk_buff *buf = root_buf; | ||
160 | |||
161 | while (buf) { | ||
162 | msg_dbg(buf_msg(buf), "In chain: "); | ||
163 | buf = buf->next; | ||
164 | } | ||
165 | } | ||
166 | } | ||
167 | |||
168 | /* | 156 | /* |
169 | * Simple link routines | 157 | * Simple link routines |
170 | */ | 158 | */ |
@@ -433,9 +421,6 @@ struct link *tipc_link_create(struct bearer *b_ptr, const u32 peer, | |||
433 | list_add_tail(&l_ptr->link_list, &b_ptr->links); | 421 | list_add_tail(&l_ptr->link_list, &b_ptr->links); |
434 | tipc_k_signal((Handler)link_start, (unsigned long)l_ptr); | 422 | tipc_k_signal((Handler)link_start, (unsigned long)l_ptr); |
435 | 423 | ||
436 | dbg("tipc_link_create(): tolerance = %u,cont intv = %u, abort_limit = %u\n", | ||
437 | l_ptr->tolerance, l_ptr->continuity_interval, l_ptr->abort_limit); | ||
438 | |||
439 | return l_ptr; | 424 | return l_ptr; |
440 | } | 425 | } |
441 | 426 | ||
@@ -455,8 +440,6 @@ void tipc_link_delete(struct link *l_ptr) | |||
455 | return; | 440 | return; |
456 | } | 441 | } |
457 | 442 | ||
458 | dbg("tipc_link_delete()\n"); | ||
459 | |||
460 | k_cancel_timer(&l_ptr->timer); | 443 | k_cancel_timer(&l_ptr->timer); |
461 | 444 | ||
462 | tipc_node_lock(l_ptr->owner); | 445 | tipc_node_lock(l_ptr->owner); |
@@ -473,7 +456,6 @@ void tipc_link_delete(struct link *l_ptr) | |||
473 | 456 | ||
474 | static void link_start(struct link *l_ptr) | 457 | static void link_start(struct link *l_ptr) |
475 | { | 458 | { |
476 | dbg("link_start %x\n", l_ptr); | ||
477 | link_state_event(l_ptr, STARTING_EVT); | 459 | link_state_event(l_ptr, STARTING_EVT); |
478 | } | 460 | } |
479 | 461 | ||
@@ -926,9 +908,6 @@ static int link_bundle_buf(struct link *l_ptr, | |||
926 | skb_copy_to_linear_data_offset(bundler, to_pos, buf->data, size); | 908 | skb_copy_to_linear_data_offset(bundler, to_pos, buf->data, size); |
927 | msg_set_size(bundler_msg, to_pos + size); | 909 | msg_set_size(bundler_msg, to_pos + size); |
928 | msg_set_msgcnt(bundler_msg, msg_msgcnt(bundler_msg) + 1); | 910 | msg_set_msgcnt(bundler_msg, msg_msgcnt(bundler_msg) + 1); |
929 | dbg("Packed msg # %u(%u octets) into pos %u in buf(#%u)\n", | ||
930 | msg_msgcnt(bundler_msg), size, to_pos, msg_seqno(bundler_msg)); | ||
931 | msg_dbg(msg, "PACKD:"); | ||
932 | buf_discard(buf); | 911 | buf_discard(buf); |
933 | l_ptr->stats.sent_bundled++; | 912 | l_ptr->stats.sent_bundled++; |
934 | return 1; | 913 | return 1; |
@@ -977,7 +956,6 @@ int tipc_link_send_buf(struct link *l_ptr, struct sk_buff *buf) | |||
977 | return link_schedule_port(l_ptr, msg_origport(msg), | 956 | return link_schedule_port(l_ptr, msg_origport(msg), |
978 | size); | 957 | size); |
979 | } | 958 | } |
980 | msg_dbg(msg, "TIPC: Congestion, throwing away\n"); | ||
981 | buf_discard(buf); | 959 | buf_discard(buf); |
982 | if (imp > CONN_MANAGER) { | 960 | if (imp > CONN_MANAGER) { |
983 | warn("Resetting link <%s>, send queue full", l_ptr->name); | 961 | warn("Resetting link <%s>, send queue full", l_ptr->name); |
@@ -1066,17 +1044,12 @@ int tipc_link_send(struct sk_buff *buf, u32 dest, u32 selector) | |||
1066 | tipc_node_lock(n_ptr); | 1044 | tipc_node_lock(n_ptr); |
1067 | l_ptr = n_ptr->active_links[selector & 1]; | 1045 | l_ptr = n_ptr->active_links[selector & 1]; |
1068 | if (l_ptr) { | 1046 | if (l_ptr) { |
1069 | dbg("tipc_link_send: found link %x for dest %x\n", l_ptr, dest); | ||
1070 | res = tipc_link_send_buf(l_ptr, buf); | 1047 | res = tipc_link_send_buf(l_ptr, buf); |
1071 | } else { | 1048 | } else { |
1072 | dbg("Attempt to send msg to unreachable node:\n"); | ||
1073 | msg_dbg(buf_msg(buf),">>>"); | ||
1074 | buf_discard(buf); | 1049 | buf_discard(buf); |
1075 | } | 1050 | } |
1076 | tipc_node_unlock(n_ptr); | 1051 | tipc_node_unlock(n_ptr); |
1077 | } else { | 1052 | } else { |
1078 | dbg("Attempt to send msg to unknown node:\n"); | ||
1079 | msg_dbg(buf_msg(buf),">>>"); | ||
1080 | buf_discard(buf); | 1053 | buf_discard(buf); |
1081 | } | 1054 | } |
1082 | read_unlock_bh(&tipc_net_lock); | 1055 | read_unlock_bh(&tipc_net_lock); |
@@ -1103,10 +1076,8 @@ static int link_send_buf_fast(struct link *l_ptr, struct sk_buff *buf, | |||
1103 | if (likely(tipc_bearer_send(l_ptr->b_ptr, buf, | 1076 | if (likely(tipc_bearer_send(l_ptr->b_ptr, buf, |
1104 | &l_ptr->media_addr))) { | 1077 | &l_ptr->media_addr))) { |
1105 | l_ptr->unacked_window = 0; | 1078 | l_ptr->unacked_window = 0; |
1106 | msg_dbg(msg,"SENT_FAST:"); | ||
1107 | return res; | 1079 | return res; |
1108 | } | 1080 | } |
1109 | dbg("failed sent fast...\n"); | ||
1110 | tipc_bearer_schedule(l_ptr->b_ptr, l_ptr); | 1081 | tipc_bearer_schedule(l_ptr->b_ptr, l_ptr); |
1111 | l_ptr->stats.bearer_congs++; | 1082 | l_ptr->stats.bearer_congs++; |
1112 | l_ptr->next_out = buf; | 1083 | l_ptr->next_out = buf; |
@@ -1141,8 +1112,6 @@ int tipc_send_buf_fast(struct sk_buff *buf, u32 destnode) | |||
1141 | if (likely(n_ptr)) { | 1112 | if (likely(n_ptr)) { |
1142 | tipc_node_lock(n_ptr); | 1113 | tipc_node_lock(n_ptr); |
1143 | l_ptr = n_ptr->active_links[selector]; | 1114 | l_ptr = n_ptr->active_links[selector]; |
1144 | dbg("send_fast: buf %x selected %x, destnode = %x\n", | ||
1145 | buf, l_ptr, destnode); | ||
1146 | if (likely(l_ptr)) { | 1115 | if (likely(l_ptr)) { |
1147 | res = link_send_buf_fast(l_ptr, buf, &dummy); | 1116 | res = link_send_buf_fast(l_ptr, buf, &dummy); |
1148 | tipc_node_unlock(n_ptr); | 1117 | tipc_node_unlock(n_ptr); |
@@ -1292,7 +1261,6 @@ again: | |||
1292 | 1261 | ||
1293 | /* Prepare reusable fragment header: */ | 1262 | /* Prepare reusable fragment header: */ |
1294 | 1263 | ||
1295 | msg_dbg(hdr, ">FRAGMENTING>"); | ||
1296 | tipc_msg_init(&fragm_hdr, MSG_FRAGMENTER, FIRST_FRAGMENT, | 1264 | tipc_msg_init(&fragm_hdr, MSG_FRAGMENTER, FIRST_FRAGMENT, |
1297 | INT_H_SIZE, msg_destnode(hdr)); | 1265 | INT_H_SIZE, msg_destnode(hdr)); |
1298 | msg_set_link_selector(&fragm_hdr, sender->publ.ref); | 1266 | msg_set_link_selector(&fragm_hdr, sender->publ.ref); |
@@ -1308,7 +1276,6 @@ again: | |||
1308 | skb_copy_to_linear_data(buf, &fragm_hdr, INT_H_SIZE); | 1276 | skb_copy_to_linear_data(buf, &fragm_hdr, INT_H_SIZE); |
1309 | hsz = msg_hdr_sz(hdr); | 1277 | hsz = msg_hdr_sz(hdr); |
1310 | skb_copy_to_linear_data_offset(buf, INT_H_SIZE, hdr, hsz); | 1278 | skb_copy_to_linear_data_offset(buf, INT_H_SIZE, hdr, hsz); |
1311 | msg_dbg(buf_msg(buf), ">BUILD>"); | ||
1312 | 1279 | ||
1313 | /* Chop up message: */ | 1280 | /* Chop up message: */ |
1314 | 1281 | ||
@@ -1367,7 +1334,6 @@ error: | |||
1367 | skb_copy_to_linear_data(buf, &fragm_hdr, INT_H_SIZE); | 1334 | skb_copy_to_linear_data(buf, &fragm_hdr, INT_H_SIZE); |
1368 | fragm_crs = INT_H_SIZE; | 1335 | fragm_crs = INT_H_SIZE; |
1369 | fragm_rest = fragm_sz; | 1336 | fragm_rest = fragm_sz; |
1370 | msg_dbg(buf_msg(buf)," >BUILD>"); | ||
1371 | } | 1337 | } |
1372 | } | 1338 | } |
1373 | while (rest > 0); | 1339 | while (rest > 0); |
@@ -1417,7 +1383,6 @@ reject: | |||
1417 | l_ptr->stats.sent_fragments++; | 1383 | l_ptr->stats.sent_fragments++; |
1418 | msg_set_long_msgno(msg, l_ptr->long_msg_seq_no); | 1384 | msg_set_long_msgno(msg, l_ptr->long_msg_seq_no); |
1419 | link_add_to_outqueue(l_ptr, buf, msg); | 1385 | link_add_to_outqueue(l_ptr, buf, msg); |
1420 | msg_dbg(msg, ">ADD>"); | ||
1421 | buf = next; | 1386 | buf = next; |
1422 | } | 1387 | } |
1423 | 1388 | ||
@@ -1459,14 +1424,12 @@ u32 tipc_link_push_packet(struct link *l_ptr) | |||
1459 | msg_set_ack(buf_msg(buf), mod(l_ptr->next_in_no - 1)); | 1424 | msg_set_ack(buf_msg(buf), mod(l_ptr->next_in_no - 1)); |
1460 | msg_set_bcast_ack(buf_msg(buf), l_ptr->owner->bclink.last_in); | 1425 | msg_set_bcast_ack(buf_msg(buf), l_ptr->owner->bclink.last_in); |
1461 | if (tipc_bearer_send(l_ptr->b_ptr, buf, &l_ptr->media_addr)) { | 1426 | if (tipc_bearer_send(l_ptr->b_ptr, buf, &l_ptr->media_addr)) { |
1462 | msg_dbg(buf_msg(buf), ">DEF-RETR>"); | ||
1463 | l_ptr->retransm_queue_head = mod(++r_q_head); | 1427 | l_ptr->retransm_queue_head = mod(++r_q_head); |
1464 | l_ptr->retransm_queue_size = --r_q_size; | 1428 | l_ptr->retransm_queue_size = --r_q_size; |
1465 | l_ptr->stats.retransmitted++; | 1429 | l_ptr->stats.retransmitted++; |
1466 | return 0; | 1430 | return 0; |
1467 | } else { | 1431 | } else { |
1468 | l_ptr->stats.bearer_congs++; | 1432 | l_ptr->stats.bearer_congs++; |
1469 | msg_dbg(buf_msg(buf), "|>DEF-RETR>"); | ||
1470 | return PUSH_FAILED; | 1433 | return PUSH_FAILED; |
1471 | } | 1434 | } |
1472 | } | 1435 | } |
@@ -1478,13 +1441,11 @@ u32 tipc_link_push_packet(struct link *l_ptr) | |||
1478 | msg_set_ack(buf_msg(buf), mod(l_ptr->next_in_no - 1)); | 1441 | msg_set_ack(buf_msg(buf), mod(l_ptr->next_in_no - 1)); |
1479 | msg_set_bcast_ack(buf_msg(buf),l_ptr->owner->bclink.last_in); | 1442 | msg_set_bcast_ack(buf_msg(buf),l_ptr->owner->bclink.last_in); |
1480 | if (tipc_bearer_send(l_ptr->b_ptr, buf, &l_ptr->media_addr)) { | 1443 | if (tipc_bearer_send(l_ptr->b_ptr, buf, &l_ptr->media_addr)) { |
1481 | msg_dbg(buf_msg(buf), ">DEF-PROT>"); | ||
1482 | l_ptr->unacked_window = 0; | 1444 | l_ptr->unacked_window = 0; |
1483 | buf_discard(buf); | 1445 | buf_discard(buf); |
1484 | l_ptr->proto_msg_queue = NULL; | 1446 | l_ptr->proto_msg_queue = NULL; |
1485 | return 0; | 1447 | return 0; |
1486 | } else { | 1448 | } else { |
1487 | msg_dbg(buf_msg(buf), "|>DEF-PROT>"); | ||
1488 | l_ptr->stats.bearer_congs++; | 1449 | l_ptr->stats.bearer_congs++; |
1489 | return PUSH_FAILED; | 1450 | return PUSH_FAILED; |
1490 | } | 1451 | } |
@@ -1504,11 +1465,9 @@ u32 tipc_link_push_packet(struct link *l_ptr) | |||
1504 | if (tipc_bearer_send(l_ptr->b_ptr, buf, &l_ptr->media_addr)) { | 1465 | if (tipc_bearer_send(l_ptr->b_ptr, buf, &l_ptr->media_addr)) { |
1505 | if (msg_user(msg) == MSG_BUNDLER) | 1466 | if (msg_user(msg) == MSG_BUNDLER) |
1506 | msg_set_type(msg, CLOSED_MSG); | 1467 | msg_set_type(msg, CLOSED_MSG); |
1507 | msg_dbg(msg, ">PUSH-DATA>"); | ||
1508 | l_ptr->next_out = buf->next; | 1468 | l_ptr->next_out = buf->next; |
1509 | return 0; | 1469 | return 0; |
1510 | } else { | 1470 | } else { |
1511 | msg_dbg(msg, "|PUSH-DATA|"); | ||
1512 | l_ptr->stats.bearer_congs++; | 1471 | l_ptr->stats.bearer_congs++; |
1513 | return PUSH_FAILED; | 1472 | return PUSH_FAILED; |
1514 | } | 1473 | } |
@@ -1571,7 +1530,6 @@ static void link_retransmit_failure(struct link *l_ptr, struct sk_buff *buf) | |||
1571 | struct tipc_msg *msg = buf_msg(buf); | 1530 | struct tipc_msg *msg = buf_msg(buf); |
1572 | 1531 | ||
1573 | warn("Retransmission failure on link <%s>\n", l_ptr->name); | 1532 | warn("Retransmission failure on link <%s>\n", l_ptr->name); |
1574 | tipc_msg_dbg(TIPC_OUTPUT, msg, ">RETR-FAIL>"); | ||
1575 | 1533 | ||
1576 | if (l_ptr->addr) { | 1534 | if (l_ptr->addr) { |
1577 | 1535 | ||
@@ -1621,11 +1579,8 @@ void tipc_link_retransmit(struct link *l_ptr, struct sk_buff *buf, | |||
1621 | 1579 | ||
1622 | msg = buf_msg(buf); | 1580 | msg = buf_msg(buf); |
1623 | 1581 | ||
1624 | dbg("Retransmitting %u in link %x\n", retransmits, l_ptr); | ||
1625 | |||
1626 | if (tipc_bearer_congested(l_ptr->b_ptr, l_ptr)) { | 1582 | if (tipc_bearer_congested(l_ptr->b_ptr, l_ptr)) { |
1627 | if (l_ptr->retransm_queue_size == 0) { | 1583 | if (l_ptr->retransm_queue_size == 0) { |
1628 | msg_dbg(msg, ">NO_RETR->BCONG>"); | ||
1629 | dbg_print_link(l_ptr, " "); | 1584 | dbg_print_link(l_ptr, " "); |
1630 | l_ptr->retransm_queue_head = msg_seqno(msg); | 1585 | l_ptr->retransm_queue_head = msg_seqno(msg); |
1631 | l_ptr->retransm_queue_size = retransmits; | 1586 | l_ptr->retransm_queue_size = retransmits; |
@@ -1653,7 +1608,6 @@ void tipc_link_retransmit(struct link *l_ptr, struct sk_buff *buf, | |||
1653 | msg_set_ack(msg, mod(l_ptr->next_in_no - 1)); | 1608 | msg_set_ack(msg, mod(l_ptr->next_in_no - 1)); |
1654 | msg_set_bcast_ack(msg, l_ptr->owner->bclink.last_in); | 1609 | msg_set_bcast_ack(msg, l_ptr->owner->bclink.last_in); |
1655 | if (tipc_bearer_send(l_ptr->b_ptr, buf, &l_ptr->media_addr)) { | 1610 | if (tipc_bearer_send(l_ptr->b_ptr, buf, &l_ptr->media_addr)) { |
1656 | msg_dbg(buf_msg(buf), ">RETR>"); | ||
1657 | buf = buf->next; | 1611 | buf = buf->next; |
1658 | retransmits--; | 1612 | retransmits--; |
1659 | l_ptr->stats.retransmitted++; | 1613 | l_ptr->stats.retransmitted++; |
@@ -1939,12 +1893,10 @@ deliver: | |||
1939 | tipc_node_unlock(n_ptr); | 1893 | tipc_node_unlock(n_ptr); |
1940 | continue; | 1894 | continue; |
1941 | } | 1895 | } |
1942 | msg_dbg(msg,"NSEQ<REC<"); | ||
1943 | link_state_event(l_ptr, TRAFFIC_MSG_EVT); | 1896 | link_state_event(l_ptr, TRAFFIC_MSG_EVT); |
1944 | 1897 | ||
1945 | if (link_working_working(l_ptr)) { | 1898 | if (link_working_working(l_ptr)) { |
1946 | /* Re-insert in front of queue */ | 1899 | /* Re-insert in front of queue */ |
1947 | msg_dbg(msg,"RECV-REINS:"); | ||
1948 | buf->next = head; | 1900 | buf->next = head; |
1949 | head = buf; | 1901 | head = buf; |
1950 | tipc_node_unlock(n_ptr); | 1902 | tipc_node_unlock(n_ptr); |
@@ -2026,9 +1978,6 @@ static void link_handle_out_of_seq_msg(struct link *l_ptr, | |||
2026 | return; | 1978 | return; |
2027 | } | 1979 | } |
2028 | 1980 | ||
2029 | dbg("rx OOS msg: seq_no %u, expecting %u (%u)\n", | ||
2030 | seq_no, mod(l_ptr->next_in_no), l_ptr->next_in_no); | ||
2031 | |||
2032 | /* Record OOS packet arrival (force mismatch on next timeout) */ | 1981 | /* Record OOS packet arrival (force mismatch on next timeout) */ |
2033 | 1982 | ||
2034 | l_ptr->checkpoint--; | 1983 | l_ptr->checkpoint--; |
@@ -2146,8 +2095,6 @@ void tipc_link_send_proto_msg(struct link *l_ptr, u32 msg_typ, int probe_msg, | |||
2146 | 2095 | ||
2147 | /* Message can be sent */ | 2096 | /* Message can be sent */ |
2148 | 2097 | ||
2149 | msg_dbg(msg, ">>"); | ||
2150 | |||
2151 | buf = tipc_buf_acquire(msg_size); | 2098 | buf = tipc_buf_acquire(msg_size); |
2152 | if (!buf) | 2099 | if (!buf) |
2153 | return; | 2100 | return; |
@@ -2181,8 +2128,6 @@ static void link_recv_proto_msg(struct link *l_ptr, struct sk_buff *buf) | |||
2181 | u32 msg_tol; | 2128 | u32 msg_tol; |
2182 | struct tipc_msg *msg = buf_msg(buf); | 2129 | struct tipc_msg *msg = buf_msg(buf); |
2183 | 2130 | ||
2184 | dbg("AT(%u):", jiffies_to_msecs(jiffies)); | ||
2185 | msg_dbg(msg, "<<"); | ||
2186 | if (link_blocked(l_ptr)) | 2131 | if (link_blocked(l_ptr)) |
2187 | goto exit; | 2132 | goto exit; |
2188 | 2133 | ||
@@ -2201,11 +2146,8 @@ static void link_recv_proto_msg(struct link *l_ptr, struct sk_buff *buf) | |||
2201 | case RESET_MSG: | 2146 | case RESET_MSG: |
2202 | if (!link_working_unknown(l_ptr) && | 2147 | if (!link_working_unknown(l_ptr) && |
2203 | (l_ptr->peer_session != INVALID_SESSION)) { | 2148 | (l_ptr->peer_session != INVALID_SESSION)) { |
2204 | if (msg_session(msg) == l_ptr->peer_session) { | 2149 | if (msg_session(msg) == l_ptr->peer_session) |
2205 | dbg("Duplicate RESET: %u<->%u\n", | ||
2206 | msg_session(msg), l_ptr->peer_session); | ||
2207 | break; /* duplicate: ignore */ | 2150 | break; /* duplicate: ignore */ |
2208 | } | ||
2209 | } | 2151 | } |
2210 | /* fall thru' */ | 2152 | /* fall thru' */ |
2211 | case ACTIVATE_MSG: | 2153 | case ACTIVATE_MSG: |
@@ -2266,8 +2208,6 @@ static void link_recv_proto_msg(struct link *l_ptr, struct sk_buff *buf) | |||
2266 | 2208 | ||
2267 | max_pkt_ack = msg_max_pkt(msg); | 2209 | max_pkt_ack = msg_max_pkt(msg); |
2268 | if (max_pkt_ack > l_ptr->max_pkt) { | 2210 | if (max_pkt_ack > l_ptr->max_pkt) { |
2269 | dbg("Link <%s> updated MTU %u -> %u\n", | ||
2270 | l_ptr->name, l_ptr->max_pkt, max_pkt_ack); | ||
2271 | l_ptr->max_pkt = max_pkt_ack; | 2211 | l_ptr->max_pkt = max_pkt_ack; |
2272 | l_ptr->max_pkt_probes = 0; | 2212 | l_ptr->max_pkt_probes = 0; |
2273 | } | 2213 | } |
@@ -2289,14 +2229,11 @@ static void link_recv_proto_msg(struct link *l_ptr, struct sk_buff *buf) | |||
2289 | 0, rec_gap, 0, 0, max_pkt_ack); | 2229 | 0, rec_gap, 0, 0, max_pkt_ack); |
2290 | } | 2230 | } |
2291 | if (msg_seq_gap(msg)) { | 2231 | if (msg_seq_gap(msg)) { |
2292 | msg_dbg(msg, "With Gap:"); | ||
2293 | l_ptr->stats.recv_nacks++; | 2232 | l_ptr->stats.recv_nacks++; |
2294 | tipc_link_retransmit(l_ptr, l_ptr->first_out, | 2233 | tipc_link_retransmit(l_ptr, l_ptr->first_out, |
2295 | msg_seq_gap(msg)); | 2234 | msg_seq_gap(msg)); |
2296 | } | 2235 | } |
2297 | break; | 2236 | break; |
2298 | default: | ||
2299 | msg_dbg(buf_msg(buf), "<DISCARDING UNKNOWN<"); | ||
2300 | } | 2237 | } |
2301 | exit: | 2238 | exit: |
2302 | buf_discard(buf); | 2239 | buf_discard(buf); |
@@ -2331,8 +2268,6 @@ static void tipc_link_tunnel(struct link *l_ptr, | |||
2331 | } | 2268 | } |
2332 | skb_copy_to_linear_data(buf, tunnel_hdr, INT_H_SIZE); | 2269 | skb_copy_to_linear_data(buf, tunnel_hdr, INT_H_SIZE); |
2333 | skb_copy_to_linear_data_offset(buf, INT_H_SIZE, msg, length); | 2270 | skb_copy_to_linear_data_offset(buf, INT_H_SIZE, msg, length); |
2334 | dbg("%c->%c:", l_ptr->b_ptr->net_plane, tunnel->b_ptr->net_plane); | ||
2335 | msg_dbg(buf_msg(buf), ">SEND>"); | ||
2336 | tipc_link_send_buf(tunnel, buf); | 2271 | tipc_link_send_buf(tunnel, buf); |
2337 | } | 2272 | } |
2338 | 2273 | ||
@@ -2364,7 +2299,6 @@ void tipc_link_changeover(struct link *l_ptr) | |||
2364 | ORIGINAL_MSG, INT_H_SIZE, l_ptr->addr); | 2299 | ORIGINAL_MSG, INT_H_SIZE, l_ptr->addr); |
2365 | msg_set_bearer_id(&tunnel_hdr, l_ptr->peer_bearer_id); | 2300 | msg_set_bearer_id(&tunnel_hdr, l_ptr->peer_bearer_id); |
2366 | msg_set_msgcnt(&tunnel_hdr, msgcount); | 2301 | msg_set_msgcnt(&tunnel_hdr, msgcount); |
2367 | dbg("Link changeover requires %u tunnel messages\n", msgcount); | ||
2368 | 2302 | ||
2369 | if (!l_ptr->first_out) { | 2303 | if (!l_ptr->first_out) { |
2370 | struct sk_buff *buf; | 2304 | struct sk_buff *buf; |
@@ -2373,9 +2307,6 @@ void tipc_link_changeover(struct link *l_ptr) | |||
2373 | if (buf) { | 2307 | if (buf) { |
2374 | skb_copy_to_linear_data(buf, &tunnel_hdr, INT_H_SIZE); | 2308 | skb_copy_to_linear_data(buf, &tunnel_hdr, INT_H_SIZE); |
2375 | msg_set_size(&tunnel_hdr, INT_H_SIZE); | 2309 | msg_set_size(&tunnel_hdr, INT_H_SIZE); |
2376 | dbg("%c->%c:", l_ptr->b_ptr->net_plane, | ||
2377 | tunnel->b_ptr->net_plane); | ||
2378 | msg_dbg(&tunnel_hdr, "EMPTY>SEND>"); | ||
2379 | tipc_link_send_buf(tunnel, buf); | 2310 | tipc_link_send_buf(tunnel, buf); |
2380 | } else { | 2311 | } else { |
2381 | warn("Link changeover error, " | 2312 | warn("Link changeover error, " |
@@ -2439,9 +2370,6 @@ void tipc_link_send_duplicate(struct link *l_ptr, struct link *tunnel) | |||
2439 | skb_copy_to_linear_data(outbuf, &tunnel_hdr, INT_H_SIZE); | 2370 | skb_copy_to_linear_data(outbuf, &tunnel_hdr, INT_H_SIZE); |
2440 | skb_copy_to_linear_data_offset(outbuf, INT_H_SIZE, iter->data, | 2371 | skb_copy_to_linear_data_offset(outbuf, INT_H_SIZE, iter->data, |
2441 | length); | 2372 | length); |
2442 | dbg("%c->%c:", l_ptr->b_ptr->net_plane, | ||
2443 | tunnel->b_ptr->net_plane); | ||
2444 | msg_dbg(buf_msg(outbuf), ">SEND>"); | ||
2445 | tipc_link_send_buf(tunnel, outbuf); | 2373 | tipc_link_send_buf(tunnel, outbuf); |
2446 | if (!tipc_link_is_up(l_ptr)) | 2374 | if (!tipc_link_is_up(l_ptr)) |
2447 | return; | 2375 | return; |
@@ -2488,31 +2416,24 @@ static int link_recv_changeover_msg(struct link **l_ptr, | |||
2488 | u32 msg_count = msg_msgcnt(tunnel_msg); | 2416 | u32 msg_count = msg_msgcnt(tunnel_msg); |
2489 | 2417 | ||
2490 | dest_link = (*l_ptr)->owner->links[msg_bearer_id(tunnel_msg)]; | 2418 | dest_link = (*l_ptr)->owner->links[msg_bearer_id(tunnel_msg)]; |
2491 | if (!dest_link) { | 2419 | if (!dest_link) |
2492 | msg_dbg(tunnel_msg, "NOLINK/<REC<"); | ||
2493 | goto exit; | 2420 | goto exit; |
2494 | } | ||
2495 | if (dest_link == *l_ptr) { | 2421 | if (dest_link == *l_ptr) { |
2496 | err("Unexpected changeover message on link <%s>\n", | 2422 | err("Unexpected changeover message on link <%s>\n", |
2497 | (*l_ptr)->name); | 2423 | (*l_ptr)->name); |
2498 | goto exit; | 2424 | goto exit; |
2499 | } | 2425 | } |
2500 | dbg("%c<-%c:", dest_link->b_ptr->net_plane, | ||
2501 | (*l_ptr)->b_ptr->net_plane); | ||
2502 | *l_ptr = dest_link; | 2426 | *l_ptr = dest_link; |
2503 | msg = msg_get_wrapped(tunnel_msg); | 2427 | msg = msg_get_wrapped(tunnel_msg); |
2504 | 2428 | ||
2505 | if (msg_typ == DUPLICATE_MSG) { | 2429 | if (msg_typ == DUPLICATE_MSG) { |
2506 | if (less(msg_seqno(msg), mod(dest_link->next_in_no))) { | 2430 | if (less(msg_seqno(msg), mod(dest_link->next_in_no))) |
2507 | msg_dbg(tunnel_msg, "DROP/<REC<"); | ||
2508 | goto exit; | 2431 | goto exit; |
2509 | } | ||
2510 | *buf = buf_extract(tunnel_buf,INT_H_SIZE); | 2432 | *buf = buf_extract(tunnel_buf,INT_H_SIZE); |
2511 | if (*buf == NULL) { | 2433 | if (*buf == NULL) { |
2512 | warn("Link changeover error, duplicate msg dropped\n"); | 2434 | warn("Link changeover error, duplicate msg dropped\n"); |
2513 | goto exit; | 2435 | goto exit; |
2514 | } | 2436 | } |
2515 | msg_dbg(tunnel_msg, "TNL<REC<"); | ||
2516 | buf_discard(tunnel_buf); | 2437 | buf_discard(tunnel_buf); |
2517 | return 1; | 2438 | return 1; |
2518 | } | 2439 | } |
@@ -2520,18 +2441,14 @@ static int link_recv_changeover_msg(struct link **l_ptr, | |||
2520 | /* First original message ?: */ | 2441 | /* First original message ?: */ |
2521 | 2442 | ||
2522 | if (tipc_link_is_up(dest_link)) { | 2443 | if (tipc_link_is_up(dest_link)) { |
2523 | msg_dbg(tunnel_msg, "UP/FIRST/<REC<"); | ||
2524 | info("Resetting link <%s>, changeover initiated by peer\n", | 2444 | info("Resetting link <%s>, changeover initiated by peer\n", |
2525 | dest_link->name); | 2445 | dest_link->name); |
2526 | tipc_link_reset(dest_link); | 2446 | tipc_link_reset(dest_link); |
2527 | dest_link->exp_msg_count = msg_count; | 2447 | dest_link->exp_msg_count = msg_count; |
2528 | dbg("Expecting %u tunnelled messages\n", msg_count); | ||
2529 | if (!msg_count) | 2448 | if (!msg_count) |
2530 | goto exit; | 2449 | goto exit; |
2531 | } else if (dest_link->exp_msg_count == START_CHANGEOVER) { | 2450 | } else if (dest_link->exp_msg_count == START_CHANGEOVER) { |
2532 | msg_dbg(tunnel_msg, "BLK/FIRST/<REC<"); | ||
2533 | dest_link->exp_msg_count = msg_count; | 2451 | dest_link->exp_msg_count = msg_count; |
2534 | dbg("Expecting %u tunnelled messages\n", msg_count); | ||
2535 | if (!msg_count) | 2452 | if (!msg_count) |
2536 | goto exit; | 2453 | goto exit; |
2537 | } | 2454 | } |
@@ -2541,18 +2458,15 @@ static int link_recv_changeover_msg(struct link **l_ptr, | |||
2541 | if (dest_link->exp_msg_count == 0) { | 2458 | if (dest_link->exp_msg_count == 0) { |
2542 | warn("Link switchover error, " | 2459 | warn("Link switchover error, " |
2543 | "got too many tunnelled messages\n"); | 2460 | "got too many tunnelled messages\n"); |
2544 | msg_dbg(tunnel_msg, "OVERDUE/DROP/<REC<"); | ||
2545 | dbg_print_link(dest_link, "LINK:"); | 2461 | dbg_print_link(dest_link, "LINK:"); |
2546 | goto exit; | 2462 | goto exit; |
2547 | } | 2463 | } |
2548 | dest_link->exp_msg_count--; | 2464 | dest_link->exp_msg_count--; |
2549 | if (less(msg_seqno(msg), dest_link->reset_checkpoint)) { | 2465 | if (less(msg_seqno(msg), dest_link->reset_checkpoint)) { |
2550 | msg_dbg(tunnel_msg, "DROP/DUPL/<REC<"); | ||
2551 | goto exit; | 2466 | goto exit; |
2552 | } else { | 2467 | } else { |
2553 | *buf = buf_extract(tunnel_buf, INT_H_SIZE); | 2468 | *buf = buf_extract(tunnel_buf, INT_H_SIZE); |
2554 | if (*buf != NULL) { | 2469 | if (*buf != NULL) { |
2555 | msg_dbg(tunnel_msg, "TNL<REC<"); | ||
2556 | buf_discard(tunnel_buf); | 2470 | buf_discard(tunnel_buf); |
2557 | return 1; | 2471 | return 1; |
2558 | } else { | 2472 | } else { |
@@ -2574,7 +2488,6 @@ void tipc_link_recv_bundle(struct sk_buff *buf) | |||
2574 | u32 pos = INT_H_SIZE; | 2488 | u32 pos = INT_H_SIZE; |
2575 | struct sk_buff *obuf; | 2489 | struct sk_buff *obuf; |
2576 | 2490 | ||
2577 | msg_dbg(buf_msg(buf), "<BNDL<: "); | ||
2578 | while (msgcount--) { | 2491 | while (msgcount--) { |
2579 | obuf = buf_extract(buf, pos); | 2492 | obuf = buf_extract(buf, pos); |
2580 | if (obuf == NULL) { | 2493 | if (obuf == NULL) { |
@@ -2582,7 +2495,6 @@ void tipc_link_recv_bundle(struct sk_buff *buf) | |||
2582 | break; | 2495 | break; |
2583 | } | 2496 | } |
2584 | pos += align(msg_size(buf_msg(obuf))); | 2497 | pos += align(msg_size(buf_msg(obuf))); |
2585 | msg_dbg(buf_msg(obuf), " /"); | ||
2586 | tipc_net_route_msg(obuf); | 2498 | tipc_net_route_msg(obuf); |
2587 | } | 2499 | } |
2588 | buf_discard(buf); | 2500 | buf_discard(buf); |
@@ -2719,7 +2631,6 @@ int tipc_link_recv_fragment(struct sk_buff **pending, struct sk_buff **fb, | |||
2719 | u32 long_msg_seq_no = msg_long_msgno(fragm); | 2631 | u32 long_msg_seq_no = msg_long_msgno(fragm); |
2720 | 2632 | ||
2721 | *fb = NULL; | 2633 | *fb = NULL; |
2722 | msg_dbg(fragm,"FRG<REC<"); | ||
2723 | 2634 | ||
2724 | /* Is there an incomplete message waiting for this fragment? */ | 2635 | /* Is there an incomplete message waiting for this fragment? */ |
2725 | 2636 | ||
@@ -2738,7 +2649,6 @@ int tipc_link_recv_fragment(struct sk_buff **pending, struct sk_buff **fb, | |||
2738 | if (msg_type(imsg) == TIPC_MCAST_MSG) | 2649 | if (msg_type(imsg) == TIPC_MCAST_MSG) |
2739 | max = TIPC_MAX_USER_MSG_SIZE + MCAST_H_SIZE; | 2650 | max = TIPC_MAX_USER_MSG_SIZE + MCAST_H_SIZE; |
2740 | if (msg_size(imsg) > max) { | 2651 | if (msg_size(imsg) > max) { |
2741 | msg_dbg(fragm,"<REC<Oversized: "); | ||
2742 | buf_discard(fbuf); | 2652 | buf_discard(fbuf); |
2743 | return 0; | 2653 | return 0; |
2744 | } | 2654 | } |
@@ -2782,10 +2692,6 @@ int tipc_link_recv_fragment(struct sk_buff **pending, struct sk_buff **fb, | |||
2782 | set_expected_frags(pbuf,exp_frags); | 2692 | set_expected_frags(pbuf,exp_frags); |
2783 | return 0; | 2693 | return 0; |
2784 | } | 2694 | } |
2785 | dbg(" Discarding orphan fragment %x\n",fbuf); | ||
2786 | msg_dbg(fragm,"ORPHAN:"); | ||
2787 | dbg("Pending long buffers:\n"); | ||
2788 | dbg_print_buf_chain(*pending); | ||
2789 | buf_discard(fbuf); | 2695 | buf_discard(fbuf); |
2790 | return 0; | 2696 | return 0; |
2791 | } | 2697 | } |
@@ -2813,11 +2719,6 @@ static void link_check_defragm_bufs(struct link *l_ptr) | |||
2813 | incr_timer_cnt(buf); | 2719 | incr_timer_cnt(buf); |
2814 | prev = buf; | 2720 | prev = buf; |
2815 | } else { | 2721 | } else { |
2816 | dbg(" Discarding incomplete long buffer\n"); | ||
2817 | msg_dbg(buf_msg(buf), "LONG:"); | ||
2818 | dbg_print_link(l_ptr, "curr:"); | ||
2819 | dbg("Pending long buffers:\n"); | ||
2820 | dbg_print_buf_chain(l_ptr->defragm_buf); | ||
2821 | if (prev) | 2722 | if (prev) |
2822 | prev->next = buf->next; | 2723 | prev->next = buf->next; |
2823 | else | 2724 | else |
@@ -3165,19 +3066,6 @@ u32 tipc_link_get_max_pkt(u32 dest, u32 selector) | |||
3165 | return res; | 3066 | return res; |
3166 | } | 3067 | } |
3167 | 3068 | ||
3168 | static void link_dump_send_queue(struct link *l_ptr) | ||
3169 | { | ||
3170 | if (l_ptr->next_out) { | ||
3171 | info("\nContents of unsent queue:\n"); | ||
3172 | dbg_print_buf_chain(l_ptr->next_out); | ||
3173 | } | ||
3174 | info("\nContents of send queue:\n"); | ||
3175 | if (l_ptr->first_out) { | ||
3176 | dbg_print_buf_chain(l_ptr->first_out); | ||
3177 | } | ||
3178 | info("Empty send queue\n"); | ||
3179 | } | ||
3180 | |||
3181 | static void link_print(struct link *l_ptr, struct print_buf *buf, | 3069 | static void link_print(struct link *l_ptr, struct print_buf *buf, |
3182 | const char *str) | 3070 | const char *str) |
3183 | { | 3071 | { |
@@ -3203,7 +3091,6 @@ static void link_print(struct link *l_ptr, struct print_buf *buf, | |||
3203 | tipc_printf(buf, "first_out= %x ", l_ptr->first_out); | 3091 | tipc_printf(buf, "first_out= %x ", l_ptr->first_out); |
3204 | tipc_printf(buf, "next_out= %x ", l_ptr->next_out); | 3092 | tipc_printf(buf, "next_out= %x ", l_ptr->next_out); |
3205 | tipc_printf(buf, "last_out= %x ", l_ptr->last_out); | 3093 | tipc_printf(buf, "last_out= %x ", l_ptr->last_out); |
3206 | link_dump_send_queue(l_ptr); | ||
3207 | } | 3094 | } |
3208 | } else | 3095 | } else |
3209 | tipc_printf(buf, "[]"); | 3096 | tipc_printf(buf, "[]"); |