diff options
-rw-r--r-- | net/tipc/bcast.c | 4 | ||||
-rw-r--r-- | net/tipc/link.c | 129 | ||||
-rw-r--r-- | net/tipc/link.h | 12 | ||||
-rw-r--r-- | net/tipc/node.c | 9 |
4 files changed, 43 insertions, 111 deletions
diff --git a/net/tipc/bcast.c b/net/tipc/bcast.c index ae558dd7f8ee..c5cbdcb1f0b5 100644 --- a/net/tipc/bcast.c +++ b/net/tipc/bcast.c | |||
@@ -413,7 +413,7 @@ static void bclink_accept_pkt(struct tipc_node *node, u32 seqno) | |||
413 | */ | 413 | */ |
414 | if (((seqno - tn->own_addr) % TIPC_MIN_LINK_WIN) == 0) { | 414 | if (((seqno - tn->own_addr) % TIPC_MIN_LINK_WIN) == 0) { |
415 | tipc_link_proto_xmit(node->active_links[node->addr & 1], | 415 | tipc_link_proto_xmit(node->active_links[node->addr & 1], |
416 | STATE_MSG, 0, 0, 0, 0, 0); | 416 | STATE_MSG, 0, 0, 0, 0); |
417 | tn->bcl->stats.sent_acks++; | 417 | tn->bcl->stats.sent_acks++; |
418 | } | 418 | } |
419 | } | 419 | } |
@@ -899,7 +899,7 @@ int tipc_bclink_init(struct net *net) | |||
899 | skb_queue_head_init(&bclink->inputq); | 899 | skb_queue_head_init(&bclink->inputq); |
900 | bcl->owner = &bclink->node; | 900 | bcl->owner = &bclink->node; |
901 | bcl->owner->net = net; | 901 | bcl->owner->net = net; |
902 | bcl->max_pkt = MAX_PKT_DEFAULT_MCAST; | 902 | bcl->mtu = MAX_PKT_DEFAULT_MCAST; |
903 | tipc_link_set_queue_limits(bcl, BCLINK_WIN_DEFAULT); | 903 | tipc_link_set_queue_limits(bcl, BCLINK_WIN_DEFAULT); |
904 | bcl->bearer_id = MAX_BEARERS; | 904 | bcl->bearer_id = MAX_BEARERS; |
905 | rcu_assign_pointer(tn->bearer_list[MAX_BEARERS], &bcbearer->bearer); | 905 | rcu_assign_pointer(tn->bearer_list[MAX_BEARERS], &bcbearer->bearer); |
diff --git a/net/tipc/link.c b/net/tipc/link.c index b1e17953eeea..a6b30df6ec02 100644 --- a/net/tipc/link.c +++ b/net/tipc/link.c | |||
@@ -136,34 +136,6 @@ static struct tipc_link *tipc_parallel_link(struct tipc_link *l) | |||
136 | return l->owner->active_links[1]; | 136 | return l->owner->active_links[1]; |
137 | } | 137 | } |
138 | 138 | ||
139 | static void link_init_max_pkt(struct tipc_link *l_ptr) | ||
140 | { | ||
141 | struct tipc_node *node = l_ptr->owner; | ||
142 | struct tipc_net *tn = net_generic(node->net, tipc_net_id); | ||
143 | struct tipc_bearer *b_ptr; | ||
144 | u32 max_pkt; | ||
145 | |||
146 | rcu_read_lock(); | ||
147 | b_ptr = rcu_dereference_rtnl(tn->bearer_list[l_ptr->bearer_id]); | ||
148 | if (!b_ptr) { | ||
149 | rcu_read_unlock(); | ||
150 | return; | ||
151 | } | ||
152 | max_pkt = (b_ptr->mtu & ~3); | ||
153 | rcu_read_unlock(); | ||
154 | |||
155 | if (max_pkt > MAX_MSG_SIZE) | ||
156 | max_pkt = MAX_MSG_SIZE; | ||
157 | |||
158 | l_ptr->max_pkt_target = max_pkt; | ||
159 | if (l_ptr->max_pkt_target < MAX_PKT_DEFAULT) | ||
160 | l_ptr->max_pkt = l_ptr->max_pkt_target; | ||
161 | else | ||
162 | l_ptr->max_pkt = MAX_PKT_DEFAULT; | ||
163 | |||
164 | l_ptr->max_pkt_probes = 0; | ||
165 | } | ||
166 | |||
167 | /* | 139 | /* |
168 | * Simple non-static link routines (i.e. referenced outside this file) | 140 | * Simple non-static link routines (i.e. referenced outside this file) |
169 | */ | 141 | */ |
@@ -304,7 +276,8 @@ struct tipc_link *tipc_link_create(struct tipc_node *n_ptr, | |||
304 | msg_set_bearer_id(msg, b_ptr->identity); | 276 | msg_set_bearer_id(msg, b_ptr->identity); |
305 | strcpy((char *)msg_data(msg), if_name); | 277 | strcpy((char *)msg_data(msg), if_name); |
306 | l_ptr->net_plane = b_ptr->net_plane; | 278 | l_ptr->net_plane = b_ptr->net_plane; |
307 | link_init_max_pkt(l_ptr); | 279 | l_ptr->advertised_mtu = b_ptr->mtu; |
280 | l_ptr->mtu = l_ptr->advertised_mtu; | ||
308 | l_ptr->priority = b_ptr->priority; | 281 | l_ptr->priority = b_ptr->priority; |
309 | tipc_link_set_queue_limits(l_ptr, b_ptr->window); | 282 | tipc_link_set_queue_limits(l_ptr, b_ptr->window); |
310 | l_ptr->next_out_no = 1; | 283 | l_ptr->next_out_no = 1; |
@@ -465,8 +438,8 @@ void tipc_link_reset(struct tipc_link *l_ptr) | |||
465 | /* Link is down, accept any session */ | 438 | /* Link is down, accept any session */ |
466 | l_ptr->peer_session = INVALID_SESSION; | 439 | l_ptr->peer_session = INVALID_SESSION; |
467 | 440 | ||
468 | /* Prepare for max packet size negotiation */ | 441 | /* Prepare for renewed mtu size negotiation */ |
469 | link_init_max_pkt(l_ptr); | 442 | l_ptr->mtu = l_ptr->advertised_mtu; |
470 | 443 | ||
471 | l_ptr->state = RESET_UNKNOWN; | 444 | l_ptr->state = RESET_UNKNOWN; |
472 | 445 | ||
@@ -563,11 +536,7 @@ static void link_state_event(struct tipc_link *l_ptr, unsigned int event) | |||
563 | l_ptr->checkpoint = l_ptr->next_in_no; | 536 | l_ptr->checkpoint = l_ptr->next_in_no; |
564 | if (tipc_bclink_acks_missing(l_ptr->owner)) { | 537 | if (tipc_bclink_acks_missing(l_ptr->owner)) { |
565 | tipc_link_proto_xmit(l_ptr, STATE_MSG, | 538 | tipc_link_proto_xmit(l_ptr, STATE_MSG, |
566 | 0, 0, 0, 0, 0); | 539 | 0, 0, 0, 0); |
567 | l_ptr->fsm_msg_cnt++; | ||
568 | } else if (l_ptr->max_pkt < l_ptr->max_pkt_target) { | ||
569 | tipc_link_proto_xmit(l_ptr, STATE_MSG, | ||
570 | 1, 0, 0, 0, 0); | ||
571 | l_ptr->fsm_msg_cnt++; | 540 | l_ptr->fsm_msg_cnt++; |
572 | } | 541 | } |
573 | link_set_timer(l_ptr, cont_intv); | 542 | link_set_timer(l_ptr, cont_intv); |
@@ -575,7 +544,7 @@ static void link_state_event(struct tipc_link *l_ptr, unsigned int event) | |||
575 | } | 544 | } |
576 | l_ptr->state = WORKING_UNKNOWN; | 545 | l_ptr->state = WORKING_UNKNOWN; |
577 | l_ptr->fsm_msg_cnt = 0; | 546 | l_ptr->fsm_msg_cnt = 0; |
578 | tipc_link_proto_xmit(l_ptr, STATE_MSG, 1, 0, 0, 0, 0); | 547 | tipc_link_proto_xmit(l_ptr, STATE_MSG, 1, 0, 0, 0); |
579 | l_ptr->fsm_msg_cnt++; | 548 | l_ptr->fsm_msg_cnt++; |
580 | link_set_timer(l_ptr, cont_intv / 4); | 549 | link_set_timer(l_ptr, cont_intv / 4); |
581 | break; | 550 | break; |
@@ -586,7 +555,7 @@ static void link_state_event(struct tipc_link *l_ptr, unsigned int event) | |||
586 | l_ptr->state = RESET_RESET; | 555 | l_ptr->state = RESET_RESET; |
587 | l_ptr->fsm_msg_cnt = 0; | 556 | l_ptr->fsm_msg_cnt = 0; |
588 | tipc_link_proto_xmit(l_ptr, ACTIVATE_MSG, | 557 | tipc_link_proto_xmit(l_ptr, ACTIVATE_MSG, |
589 | 0, 0, 0, 0, 0); | 558 | 0, 0, 0, 0); |
590 | l_ptr->fsm_msg_cnt++; | 559 | l_ptr->fsm_msg_cnt++; |
591 | link_set_timer(l_ptr, cont_intv); | 560 | link_set_timer(l_ptr, cont_intv); |
592 | break; | 561 | break; |
@@ -609,7 +578,7 @@ static void link_state_event(struct tipc_link *l_ptr, unsigned int event) | |||
609 | l_ptr->state = RESET_RESET; | 578 | l_ptr->state = RESET_RESET; |
610 | l_ptr->fsm_msg_cnt = 0; | 579 | l_ptr->fsm_msg_cnt = 0; |
611 | tipc_link_proto_xmit(l_ptr, ACTIVATE_MSG, | 580 | tipc_link_proto_xmit(l_ptr, ACTIVATE_MSG, |
612 | 0, 0, 0, 0, 0); | 581 | 0, 0, 0, 0); |
613 | l_ptr->fsm_msg_cnt++; | 582 | l_ptr->fsm_msg_cnt++; |
614 | link_set_timer(l_ptr, cont_intv); | 583 | link_set_timer(l_ptr, cont_intv); |
615 | break; | 584 | break; |
@@ -620,13 +589,13 @@ static void link_state_event(struct tipc_link *l_ptr, unsigned int event) | |||
620 | l_ptr->checkpoint = l_ptr->next_in_no; | 589 | l_ptr->checkpoint = l_ptr->next_in_no; |
621 | if (tipc_bclink_acks_missing(l_ptr->owner)) { | 590 | if (tipc_bclink_acks_missing(l_ptr->owner)) { |
622 | tipc_link_proto_xmit(l_ptr, STATE_MSG, | 591 | tipc_link_proto_xmit(l_ptr, STATE_MSG, |
623 | 0, 0, 0, 0, 0); | 592 | 0, 0, 0, 0); |
624 | l_ptr->fsm_msg_cnt++; | 593 | l_ptr->fsm_msg_cnt++; |
625 | } | 594 | } |
626 | link_set_timer(l_ptr, cont_intv); | 595 | link_set_timer(l_ptr, cont_intv); |
627 | } else if (l_ptr->fsm_msg_cnt < l_ptr->abort_limit) { | 596 | } else if (l_ptr->fsm_msg_cnt < l_ptr->abort_limit) { |
628 | tipc_link_proto_xmit(l_ptr, STATE_MSG, | 597 | tipc_link_proto_xmit(l_ptr, STATE_MSG, |
629 | 1, 0, 0, 0, 0); | 598 | 1, 0, 0, 0); |
630 | l_ptr->fsm_msg_cnt++; | 599 | l_ptr->fsm_msg_cnt++; |
631 | link_set_timer(l_ptr, cont_intv / 4); | 600 | link_set_timer(l_ptr, cont_intv / 4); |
632 | } else { /* Link has failed */ | 601 | } else { /* Link has failed */ |
@@ -636,7 +605,7 @@ static void link_state_event(struct tipc_link *l_ptr, unsigned int event) | |||
636 | l_ptr->state = RESET_UNKNOWN; | 605 | l_ptr->state = RESET_UNKNOWN; |
637 | l_ptr->fsm_msg_cnt = 0; | 606 | l_ptr->fsm_msg_cnt = 0; |
638 | tipc_link_proto_xmit(l_ptr, RESET_MSG, | 607 | tipc_link_proto_xmit(l_ptr, RESET_MSG, |
639 | 0, 0, 0, 0, 0); | 608 | 0, 0, 0, 0); |
640 | l_ptr->fsm_msg_cnt++; | 609 | l_ptr->fsm_msg_cnt++; |
641 | link_set_timer(l_ptr, cont_intv); | 610 | link_set_timer(l_ptr, cont_intv); |
642 | } | 611 | } |
@@ -656,7 +625,7 @@ static void link_state_event(struct tipc_link *l_ptr, unsigned int event) | |||
656 | l_ptr->state = WORKING_WORKING; | 625 | l_ptr->state = WORKING_WORKING; |
657 | l_ptr->fsm_msg_cnt = 0; | 626 | l_ptr->fsm_msg_cnt = 0; |
658 | link_activate(l_ptr); | 627 | link_activate(l_ptr); |
659 | tipc_link_proto_xmit(l_ptr, STATE_MSG, 1, 0, 0, 0, 0); | 628 | tipc_link_proto_xmit(l_ptr, STATE_MSG, 1, 0, 0, 0); |
660 | l_ptr->fsm_msg_cnt++; | 629 | l_ptr->fsm_msg_cnt++; |
661 | if (l_ptr->owner->working_links == 1) | 630 | if (l_ptr->owner->working_links == 1) |
662 | tipc_link_sync_xmit(l_ptr); | 631 | tipc_link_sync_xmit(l_ptr); |
@@ -666,7 +635,7 @@ static void link_state_event(struct tipc_link *l_ptr, unsigned int event) | |||
666 | l_ptr->state = RESET_RESET; | 635 | l_ptr->state = RESET_RESET; |
667 | l_ptr->fsm_msg_cnt = 0; | 636 | l_ptr->fsm_msg_cnt = 0; |
668 | tipc_link_proto_xmit(l_ptr, ACTIVATE_MSG, | 637 | tipc_link_proto_xmit(l_ptr, ACTIVATE_MSG, |
669 | 1, 0, 0, 0, 0); | 638 | 1, 0, 0, 0); |
670 | l_ptr->fsm_msg_cnt++; | 639 | l_ptr->fsm_msg_cnt++; |
671 | link_set_timer(l_ptr, cont_intv); | 640 | link_set_timer(l_ptr, cont_intv); |
672 | break; | 641 | break; |
@@ -676,7 +645,7 @@ static void link_state_event(struct tipc_link *l_ptr, unsigned int event) | |||
676 | link_set_timer(l_ptr, cont_intv); | 645 | link_set_timer(l_ptr, cont_intv); |
677 | break; | 646 | break; |
678 | case TIMEOUT_EVT: | 647 | case TIMEOUT_EVT: |
679 | tipc_link_proto_xmit(l_ptr, RESET_MSG, 0, 0, 0, 0, 0); | 648 | tipc_link_proto_xmit(l_ptr, RESET_MSG, 0, 0, 0, 0); |
680 | l_ptr->fsm_msg_cnt++; | 649 | l_ptr->fsm_msg_cnt++; |
681 | link_set_timer(l_ptr, cont_intv); | 650 | link_set_timer(l_ptr, cont_intv); |
682 | break; | 651 | break; |
@@ -694,7 +663,7 @@ static void link_state_event(struct tipc_link *l_ptr, unsigned int event) | |||
694 | l_ptr->state = WORKING_WORKING; | 663 | l_ptr->state = WORKING_WORKING; |
695 | l_ptr->fsm_msg_cnt = 0; | 664 | l_ptr->fsm_msg_cnt = 0; |
696 | link_activate(l_ptr); | 665 | link_activate(l_ptr); |
697 | tipc_link_proto_xmit(l_ptr, STATE_MSG, 1, 0, 0, 0, 0); | 666 | tipc_link_proto_xmit(l_ptr, STATE_MSG, 1, 0, 0, 0); |
698 | l_ptr->fsm_msg_cnt++; | 667 | l_ptr->fsm_msg_cnt++; |
699 | if (l_ptr->owner->working_links == 1) | 668 | if (l_ptr->owner->working_links == 1) |
700 | tipc_link_sync_xmit(l_ptr); | 669 | tipc_link_sync_xmit(l_ptr); |
@@ -704,7 +673,7 @@ static void link_state_event(struct tipc_link *l_ptr, unsigned int event) | |||
704 | break; | 673 | break; |
705 | case TIMEOUT_EVT: | 674 | case TIMEOUT_EVT: |
706 | tipc_link_proto_xmit(l_ptr, ACTIVATE_MSG, | 675 | tipc_link_proto_xmit(l_ptr, ACTIVATE_MSG, |
707 | 0, 0, 0, 0, 0); | 676 | 0, 0, 0, 0); |
708 | l_ptr->fsm_msg_cnt++; | 677 | l_ptr->fsm_msg_cnt++; |
709 | link_set_timer(l_ptr, cont_intv); | 678 | link_set_timer(l_ptr, cont_intv); |
710 | break; | 679 | break; |
@@ -733,7 +702,7 @@ int __tipc_link_xmit(struct net *net, struct tipc_link *link, | |||
733 | struct tipc_msg *msg = buf_msg(skb_peek(list)); | 702 | struct tipc_msg *msg = buf_msg(skb_peek(list)); |
734 | unsigned int maxwin = link->window; | 703 | unsigned int maxwin = link->window; |
735 | unsigned int imp = msg_importance(msg); | 704 | unsigned int imp = msg_importance(msg); |
736 | uint mtu = link->max_pkt; | 705 | uint mtu = link->mtu; |
737 | uint ack = mod(link->next_in_no - 1); | 706 | uint ack = mod(link->next_in_no - 1); |
738 | uint seqno = link->next_out_no; | 707 | uint seqno = link->next_out_no; |
739 | uint bc_last_in = link->owner->bclink.last_in; | 708 | uint bc_last_in = link->owner->bclink.last_in; |
@@ -1187,7 +1156,7 @@ void tipc_rcv(struct net *net, struct sk_buff *skb, struct tipc_bearer *b_ptr) | |||
1187 | link_retrieve_defq(l_ptr, &head); | 1156 | link_retrieve_defq(l_ptr, &head); |
1188 | if (unlikely(++l_ptr->rcv_unacked >= TIPC_MIN_LINK_WIN)) { | 1157 | if (unlikely(++l_ptr->rcv_unacked >= TIPC_MIN_LINK_WIN)) { |
1189 | l_ptr->stats.sent_acks++; | 1158 | l_ptr->stats.sent_acks++; |
1190 | tipc_link_proto_xmit(l_ptr, STATE_MSG, 0, 0, 0, 0, 0); | 1159 | tipc_link_proto_xmit(l_ptr, STATE_MSG, 0, 0, 0, 0); |
1191 | } | 1160 | } |
1192 | tipc_link_input(l_ptr, skb); | 1161 | tipc_link_input(l_ptr, skb); |
1193 | skb = NULL; | 1162 | skb = NULL; |
@@ -1362,7 +1331,7 @@ static void link_handle_out_of_seq_msg(struct tipc_link *l_ptr, | |||
1362 | if (tipc_link_defer_pkt(&l_ptr->deferdq, buf)) { | 1331 | if (tipc_link_defer_pkt(&l_ptr->deferdq, buf)) { |
1363 | l_ptr->stats.deferred_recv++; | 1332 | l_ptr->stats.deferred_recv++; |
1364 | if ((skb_queue_len(&l_ptr->deferdq) % TIPC_MIN_LINK_WIN) == 1) | 1333 | if ((skb_queue_len(&l_ptr->deferdq) % TIPC_MIN_LINK_WIN) == 1) |
1365 | tipc_link_proto_xmit(l_ptr, STATE_MSG, 0, 0, 0, 0, 0); | 1334 | tipc_link_proto_xmit(l_ptr, STATE_MSG, 0, 0, 0, 0); |
1366 | } else { | 1335 | } else { |
1367 | l_ptr->stats.duplicates++; | 1336 | l_ptr->stats.duplicates++; |
1368 | } | 1337 | } |
@@ -1372,7 +1341,7 @@ static void link_handle_out_of_seq_msg(struct tipc_link *l_ptr, | |||
1372 | * Send protocol message to the other endpoint. | 1341 | * Send protocol message to the other endpoint. |
1373 | */ | 1342 | */ |
1374 | void tipc_link_proto_xmit(struct tipc_link *l_ptr, u32 msg_typ, int probe_msg, | 1343 | void tipc_link_proto_xmit(struct tipc_link *l_ptr, u32 msg_typ, int probe_msg, |
1375 | u32 gap, u32 tolerance, u32 priority, u32 ack_mtu) | 1344 | u32 gap, u32 tolerance, u32 priority) |
1376 | { | 1345 | { |
1377 | struct sk_buff *buf = NULL; | 1346 | struct sk_buff *buf = NULL; |
1378 | struct tipc_msg *msg = l_ptr->pmsg; | 1347 | struct tipc_msg *msg = l_ptr->pmsg; |
@@ -1410,26 +1379,11 @@ void tipc_link_proto_xmit(struct tipc_link *l_ptr, u32 msg_typ, int probe_msg, | |||
1410 | l_ptr->stats.sent_nacks++; | 1379 | l_ptr->stats.sent_nacks++; |
1411 | msg_set_link_tolerance(msg, tolerance); | 1380 | msg_set_link_tolerance(msg, tolerance); |
1412 | msg_set_linkprio(msg, priority); | 1381 | msg_set_linkprio(msg, priority); |
1413 | msg_set_max_pkt(msg, ack_mtu); | 1382 | msg_set_max_pkt(msg, l_ptr->mtu); |
1414 | msg_set_ack(msg, mod(l_ptr->next_in_no - 1)); | 1383 | msg_set_ack(msg, mod(l_ptr->next_in_no - 1)); |
1415 | msg_set_probe(msg, probe_msg != 0); | 1384 | msg_set_probe(msg, probe_msg != 0); |
1416 | if (probe_msg) { | 1385 | if (probe_msg) |
1417 | u32 mtu = l_ptr->max_pkt; | ||
1418 | |||
1419 | if ((mtu < l_ptr->max_pkt_target) && | ||
1420 | link_working_working(l_ptr) && | ||
1421 | l_ptr->fsm_msg_cnt) { | ||
1422 | msg_size = (mtu + (l_ptr->max_pkt_target - mtu)/2 + 2) & ~3; | ||
1423 | if (l_ptr->max_pkt_probes == 10) { | ||
1424 | l_ptr->max_pkt_target = (msg_size - 4); | ||
1425 | l_ptr->max_pkt_probes = 0; | ||
1426 | msg_size = (mtu + (l_ptr->max_pkt_target - mtu)/2 + 2) & ~3; | ||
1427 | } | ||
1428 | l_ptr->max_pkt_probes++; | ||
1429 | } | ||
1430 | |||
1431 | l_ptr->stats.sent_probes++; | 1386 | l_ptr->stats.sent_probes++; |
1432 | } | ||
1433 | l_ptr->stats.sent_states++; | 1387 | l_ptr->stats.sent_states++; |
1434 | } else { /* RESET_MSG or ACTIVATE_MSG */ | 1388 | } else { /* RESET_MSG or ACTIVATE_MSG */ |
1435 | msg_set_ack(msg, mod(l_ptr->failover_checkpt - 1)); | 1389 | msg_set_ack(msg, mod(l_ptr->failover_checkpt - 1)); |
@@ -1438,7 +1392,7 @@ void tipc_link_proto_xmit(struct tipc_link *l_ptr, u32 msg_typ, int probe_msg, | |||
1438 | msg_set_probe(msg, 0); | 1392 | msg_set_probe(msg, 0); |
1439 | msg_set_link_tolerance(msg, l_ptr->tolerance); | 1393 | msg_set_link_tolerance(msg, l_ptr->tolerance); |
1440 | msg_set_linkprio(msg, l_ptr->priority); | 1394 | msg_set_linkprio(msg, l_ptr->priority); |
1441 | msg_set_max_pkt(msg, l_ptr->max_pkt_target); | 1395 | msg_set_max_pkt(msg, l_ptr->advertised_mtu); |
1442 | } | 1396 | } |
1443 | 1397 | ||
1444 | r_flag = (l_ptr->owner->working_links > tipc_link_is_up(l_ptr)); | 1398 | r_flag = (l_ptr->owner->working_links > tipc_link_is_up(l_ptr)); |
@@ -1469,8 +1423,6 @@ static void tipc_link_proto_rcv(struct tipc_link *l_ptr, | |||
1469 | struct sk_buff *buf) | 1423 | struct sk_buff *buf) |
1470 | { | 1424 | { |
1471 | u32 rec_gap = 0; | 1425 | u32 rec_gap = 0; |
1472 | u32 max_pkt_info; | ||
1473 | u32 max_pkt_ack; | ||
1474 | u32 msg_tol; | 1426 | u32 msg_tol; |
1475 | struct tipc_msg *msg = buf_msg(buf); | 1427 | struct tipc_msg *msg = buf_msg(buf); |
1476 | 1428 | ||
@@ -1513,15 +1465,8 @@ static void tipc_link_proto_rcv(struct tipc_link *l_ptr, | |||
1513 | if (msg_linkprio(msg) > l_ptr->priority) | 1465 | if (msg_linkprio(msg) > l_ptr->priority) |
1514 | l_ptr->priority = msg_linkprio(msg); | 1466 | l_ptr->priority = msg_linkprio(msg); |
1515 | 1467 | ||
1516 | max_pkt_info = msg_max_pkt(msg); | 1468 | if (l_ptr->mtu > msg_max_pkt(msg)) |
1517 | if (max_pkt_info) { | 1469 | l_ptr->mtu = msg_max_pkt(msg); |
1518 | if (max_pkt_info < l_ptr->max_pkt_target) | ||
1519 | l_ptr->max_pkt_target = max_pkt_info; | ||
1520 | if (l_ptr->max_pkt > l_ptr->max_pkt_target) | ||
1521 | l_ptr->max_pkt = l_ptr->max_pkt_target; | ||
1522 | } else { | ||
1523 | l_ptr->max_pkt = l_ptr->max_pkt_target; | ||
1524 | } | ||
1525 | 1470 | ||
1526 | /* Synchronize broadcast link info, if not done previously */ | 1471 | /* Synchronize broadcast link info, if not done previously */ |
1527 | if (!tipc_node_is_up(l_ptr->owner)) { | 1472 | if (!tipc_node_is_up(l_ptr->owner)) { |
@@ -1566,18 +1511,8 @@ static void tipc_link_proto_rcv(struct tipc_link *l_ptr, | |||
1566 | mod(l_ptr->next_in_no)); | 1511 | mod(l_ptr->next_in_no)); |
1567 | } | 1512 | } |
1568 | 1513 | ||
1569 | max_pkt_ack = msg_max_pkt(msg); | 1514 | if (msg_probe(msg)) |
1570 | if (max_pkt_ack > l_ptr->max_pkt) { | ||
1571 | l_ptr->max_pkt = max_pkt_ack; | ||
1572 | l_ptr->max_pkt_probes = 0; | ||
1573 | } | ||
1574 | |||
1575 | max_pkt_ack = 0; | ||
1576 | if (msg_probe(msg)) { | ||
1577 | l_ptr->stats.recv_probes++; | 1515 | l_ptr->stats.recv_probes++; |
1578 | if (msg_size(msg) > sizeof(l_ptr->proto_msg)) | ||
1579 | max_pkt_ack = msg_size(msg); | ||
1580 | } | ||
1581 | 1516 | ||
1582 | /* Protocol message before retransmits, reduce loss risk */ | 1517 | /* Protocol message before retransmits, reduce loss risk */ |
1583 | if (l_ptr->owner->bclink.recv_permitted) | 1518 | if (l_ptr->owner->bclink.recv_permitted) |
@@ -1585,8 +1520,8 @@ static void tipc_link_proto_rcv(struct tipc_link *l_ptr, | |||
1585 | msg_last_bcast(msg)); | 1520 | msg_last_bcast(msg)); |
1586 | 1521 | ||
1587 | if (rec_gap || (msg_probe(msg))) { | 1522 | if (rec_gap || (msg_probe(msg))) { |
1588 | tipc_link_proto_xmit(l_ptr, STATE_MSG, 0, rec_gap, 0, | 1523 | tipc_link_proto_xmit(l_ptr, STATE_MSG, 0, |
1589 | 0, max_pkt_ack); | 1524 | rec_gap, 0, 0); |
1590 | } | 1525 | } |
1591 | if (msg_seq_gap(msg)) { | 1526 | if (msg_seq_gap(msg)) { |
1592 | l_ptr->stats.recv_nacks++; | 1527 | l_ptr->stats.recv_nacks++; |
@@ -1816,7 +1751,7 @@ static void link_set_supervision_props(struct tipc_link *l_ptr, u32 tol) | |||
1816 | 1751 | ||
1817 | void tipc_link_set_queue_limits(struct tipc_link *l, u32 win) | 1752 | void tipc_link_set_queue_limits(struct tipc_link *l, u32 win) |
1818 | { | 1753 | { |
1819 | int max_bulk = TIPC_MAX_PUBLICATIONS / (l->max_pkt / ITEM_SIZE); | 1754 | int max_bulk = TIPC_MAX_PUBLICATIONS / (l->mtu / ITEM_SIZE); |
1820 | 1755 | ||
1821 | l->window = win; | 1756 | l->window = win; |
1822 | l->backlog[TIPC_LOW_IMPORTANCE].limit = win / 2; | 1757 | l->backlog[TIPC_LOW_IMPORTANCE].limit = win / 2; |
@@ -1988,14 +1923,14 @@ int tipc_nl_link_set(struct sk_buff *skb, struct genl_info *info) | |||
1988 | 1923 | ||
1989 | tol = nla_get_u32(props[TIPC_NLA_PROP_TOL]); | 1924 | tol = nla_get_u32(props[TIPC_NLA_PROP_TOL]); |
1990 | link_set_supervision_props(link, tol); | 1925 | link_set_supervision_props(link, tol); |
1991 | tipc_link_proto_xmit(link, STATE_MSG, 0, 0, tol, 0, 0); | 1926 | tipc_link_proto_xmit(link, STATE_MSG, 0, 0, tol, 0); |
1992 | } | 1927 | } |
1993 | if (props[TIPC_NLA_PROP_PRIO]) { | 1928 | if (props[TIPC_NLA_PROP_PRIO]) { |
1994 | u32 prio; | 1929 | u32 prio; |
1995 | 1930 | ||
1996 | prio = nla_get_u32(props[TIPC_NLA_PROP_PRIO]); | 1931 | prio = nla_get_u32(props[TIPC_NLA_PROP_PRIO]); |
1997 | link->priority = prio; | 1932 | link->priority = prio; |
1998 | tipc_link_proto_xmit(link, STATE_MSG, 0, 0, 0, prio, 0); | 1933 | tipc_link_proto_xmit(link, STATE_MSG, 0, 0, 0, prio); |
1999 | } | 1934 | } |
2000 | if (props[TIPC_NLA_PROP_WIN]) { | 1935 | if (props[TIPC_NLA_PROP_WIN]) { |
2001 | u32 win; | 1936 | u32 win; |
@@ -2100,7 +2035,7 @@ static int __tipc_nl_add_link(struct net *net, struct tipc_nl_msg *msg, | |||
2100 | if (nla_put_u32(msg->skb, TIPC_NLA_LINK_DEST, | 2035 | if (nla_put_u32(msg->skb, TIPC_NLA_LINK_DEST, |
2101 | tipc_cluster_mask(tn->own_addr))) | 2036 | tipc_cluster_mask(tn->own_addr))) |
2102 | goto attr_msg_full; | 2037 | goto attr_msg_full; |
2103 | if (nla_put_u32(msg->skb, TIPC_NLA_LINK_MTU, link->max_pkt)) | 2038 | if (nla_put_u32(msg->skb, TIPC_NLA_LINK_MTU, link->mtu)) |
2104 | goto attr_msg_full; | 2039 | goto attr_msg_full; |
2105 | if (nla_put_u32(msg->skb, TIPC_NLA_LINK_RX, link->next_in_no)) | 2040 | if (nla_put_u32(msg->skb, TIPC_NLA_LINK_RX, link->next_in_no)) |
2106 | goto attr_msg_full; | 2041 | goto attr_msg_full; |
diff --git a/net/tipc/link.h b/net/tipc/link.h index 6e28f03c7905..b5b4e3554d4e 100644 --- a/net/tipc/link.h +++ b/net/tipc/link.h | |||
@@ -123,9 +123,8 @@ struct tipc_stats { | |||
123 | * @backlog_limit: backlog queue congestion thresholds (indexed by importance) | 123 | * @backlog_limit: backlog queue congestion thresholds (indexed by importance) |
124 | * @exp_msg_count: # of tunnelled messages expected during link changeover | 124 | * @exp_msg_count: # of tunnelled messages expected during link changeover |
125 | * @reset_checkpoint: seq # of last acknowledged message at time of link reset | 125 | * @reset_checkpoint: seq # of last acknowledged message at time of link reset |
126 | * @max_pkt: current maximum packet size for this link | 126 | * @mtu: current maximum packet size for this link |
127 | * @max_pkt_target: desired maximum packet size for this link | 127 | * @advertised_mtu: advertised own mtu when link is being established |
128 | * @max_pkt_probes: # of probes based on current (max_pkt, max_pkt_target) | ||
129 | * @transmitq: queue for sent, non-acked messages | 128 | * @transmitq: queue for sent, non-acked messages |
130 | * @backlogq: queue for messages waiting to be sent | 129 | * @backlogq: queue for messages waiting to be sent |
131 | * @next_out_no: next sequence number to use for outbound messages | 130 | * @next_out_no: next sequence number to use for outbound messages |
@@ -176,9 +175,8 @@ struct tipc_link { | |||
176 | struct sk_buff *failover_skb; | 175 | struct sk_buff *failover_skb; |
177 | 176 | ||
178 | /* Max packet negotiation */ | 177 | /* Max packet negotiation */ |
179 | u32 max_pkt; | 178 | u16 mtu; |
180 | u32 max_pkt_target; | 179 | u16 advertised_mtu; |
181 | u32 max_pkt_probes; | ||
182 | 180 | ||
183 | /* Sending */ | 181 | /* Sending */ |
184 | struct sk_buff_head transmq; | 182 | struct sk_buff_head transmq; |
@@ -233,7 +231,7 @@ int tipc_link_xmit(struct net *net, struct sk_buff_head *list, u32 dest, | |||
233 | int __tipc_link_xmit(struct net *net, struct tipc_link *link, | 231 | int __tipc_link_xmit(struct net *net, struct tipc_link *link, |
234 | struct sk_buff_head *list); | 232 | struct sk_buff_head *list); |
235 | void tipc_link_proto_xmit(struct tipc_link *l_ptr, u32 msg_typ, int prob, | 233 | void tipc_link_proto_xmit(struct tipc_link *l_ptr, u32 msg_typ, int prob, |
236 | u32 gap, u32 tolerance, u32 priority, u32 acked_mtu); | 234 | u32 gap, u32 tolerance, u32 priority); |
237 | void tipc_link_push_packets(struct tipc_link *l_ptr); | 235 | void tipc_link_push_packets(struct tipc_link *l_ptr); |
238 | u32 tipc_link_defer_pkt(struct sk_buff_head *list, struct sk_buff *buf); | 236 | u32 tipc_link_defer_pkt(struct sk_buff_head *list, struct sk_buff *buf); |
239 | void tipc_link_set_queue_limits(struct tipc_link *l_ptr, u32 window); | 237 | void tipc_link_set_queue_limits(struct tipc_link *l_ptr, u32 window); |
diff --git a/net/tipc/node.c b/net/tipc/node.c index f3d522c2881a..22c059ad2999 100644 --- a/net/tipc/node.c +++ b/net/tipc/node.c | |||
@@ -254,8 +254,8 @@ void tipc_node_link_up(struct tipc_node *n_ptr, struct tipc_link *l_ptr) | |||
254 | active[0] = active[1] = l_ptr; | 254 | active[0] = active[1] = l_ptr; |
255 | exit: | 255 | exit: |
256 | /* Leave room for changeover header when returning 'mtu' to users: */ | 256 | /* Leave room for changeover header when returning 'mtu' to users: */ |
257 | n_ptr->act_mtus[0] = active[0]->max_pkt - INT_H_SIZE; | 257 | n_ptr->act_mtus[0] = active[0]->mtu - INT_H_SIZE; |
258 | n_ptr->act_mtus[1] = active[1]->max_pkt - INT_H_SIZE; | 258 | n_ptr->act_mtus[1] = active[1]->mtu - INT_H_SIZE; |
259 | } | 259 | } |
260 | 260 | ||
261 | /** | 261 | /** |
@@ -319,11 +319,10 @@ void tipc_node_link_down(struct tipc_node *n_ptr, struct tipc_link *l_ptr) | |||
319 | 319 | ||
320 | /* Leave room for changeover header when returning 'mtu' to users: */ | 320 | /* Leave room for changeover header when returning 'mtu' to users: */ |
321 | if (active[0]) { | 321 | if (active[0]) { |
322 | n_ptr->act_mtus[0] = active[0]->max_pkt - INT_H_SIZE; | 322 | n_ptr->act_mtus[0] = active[0]->mtu - INT_H_SIZE; |
323 | n_ptr->act_mtus[1] = active[1]->max_pkt - INT_H_SIZE; | 323 | n_ptr->act_mtus[1] = active[1]->mtu - INT_H_SIZE; |
324 | return; | 324 | return; |
325 | } | 325 | } |
326 | |||
327 | /* Loopback link went down? No fragmentation needed from now on. */ | 326 | /* Loopback link went down? No fragmentation needed from now on. */ |
328 | if (n_ptr->addr == tn->own_addr) { | 327 | if (n_ptr->addr == tn->own_addr) { |
329 | n_ptr->act_mtus[0] = MAX_MSG_SIZE; | 328 | n_ptr->act_mtus[0] = MAX_MSG_SIZE; |