aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc/link.c
diff options
context:
space:
mode:
authorErik Hugne <erik.hugne@ericsson.com>2012-11-07 02:40:07 -0500
committerPaul Gortmaker <paul.gortmaker@windriver.com>2012-12-06 17:20:19 -0500
commitc008413850d1d48cc02c940280bf2dcf76160f4c (patch)
treed24c2056bfe41060d214c0b44344d366b655e9a9 /net/tipc/link.c
parentb93196dc5af7729ff7cc50d3d322ab1a364aa14f (diff)
tipc: remove obsolete flush of stale reassembly buffer
Each link instance has a periodic job checking if there is a stale ongoing message reassembly associated to the link. If no new fragment has been received during the last 4*[link_tolerance] period, it is assumed the missing fragment will never arrive. As a consequence, the reassembly buffer is discarded, and a gap in the message sequence occurs. This assumption is wrong. After we abandoned our ambition to develop packet routing for multi-cluster networks, only single-hop packet transfer remains as an option. For those, all packets are guaranteed to be delivered in sequence to the defragmentation layer. Any failure to achieve sequenced delivery will eventually lead to link reset, and the reassembly buffer will be flushed anyway. So we just remove this periodic check, which is now obsolete. Signed-off-by: Erik Hugne <erik.hugne@ericsson.com> Acked-by: Ying Xue <ying.xue@windriver.com> Signed-off-by: Jon Maloy <jon.maloy@ericsson.com> [PG: also delete get/inc_timer count, since they are now unused] Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Diffstat (limited to 'net/tipc/link.c')
-rw-r--r--net/tipc/link.c44
1 files changed, 0 insertions, 44 deletions
diff --git a/net/tipc/link.c b/net/tipc/link.c
index 87bf5aad704b..daa6080a2a0c 100644
--- a/net/tipc/link.c
+++ b/net/tipc/link.c
@@ -97,7 +97,6 @@ static int link_send_sections_long(struct tipc_port *sender,
97 struct iovec const *msg_sect, 97 struct iovec const *msg_sect,
98 u32 num_sect, unsigned int total_len, 98 u32 num_sect, unsigned int total_len,
99 u32 destnode); 99 u32 destnode);
100static void link_check_defragm_bufs(struct tipc_link *l_ptr);
101static void link_state_event(struct tipc_link *l_ptr, u32 event); 100static void link_state_event(struct tipc_link *l_ptr, u32 event);
102static void link_reset_statistics(struct tipc_link *l_ptr); 101static void link_reset_statistics(struct tipc_link *l_ptr);
103static void link_print(struct tipc_link *l_ptr, const char *str); 102static void link_print(struct tipc_link *l_ptr, const char *str);
@@ -271,7 +270,6 @@ static void link_timeout(struct tipc_link *l_ptr)
271 } 270 }
272 271
273 /* do all other link processing performed on a periodic basis */ 272 /* do all other link processing performed on a periodic basis */
274 link_check_defragm_bufs(l_ptr);
275 273
276 link_state_event(l_ptr, TIMEOUT_EVT); 274 link_state_event(l_ptr, TIMEOUT_EVT);
277 275
@@ -2497,16 +2495,6 @@ static void set_expected_frags(struct sk_buff *buf, u32 exp)
2497 msg_set_bcast_ack(buf_msg(buf), exp); 2495 msg_set_bcast_ack(buf_msg(buf), exp);
2498} 2496}
2499 2497
2500static u32 get_timer_cnt(struct sk_buff *buf)
2501{
2502 return msg_reroute_cnt(buf_msg(buf));
2503}
2504
2505static void incr_timer_cnt(struct sk_buff *buf)
2506{
2507 msg_incr_reroute_cnt(buf_msg(buf));
2508}
2509
2510/* 2498/*
2511 * tipc_link_recv_fragment(): Called with node lock on. Returns 2499 * tipc_link_recv_fragment(): Called with node lock on. Returns
2512 * the reassembled buffer if message is complete. 2500 * the reassembled buffer if message is complete.
@@ -2585,38 +2573,6 @@ int tipc_link_recv_fragment(struct sk_buff **pending, struct sk_buff **fb,
2585 return 0; 2573 return 0;
2586} 2574}
2587 2575
2588/**
2589 * link_check_defragm_bufs - flush stale incoming message fragments
2590 * @l_ptr: pointer to link
2591 */
2592static void link_check_defragm_bufs(struct tipc_link *l_ptr)
2593{
2594 struct sk_buff *prev = NULL;
2595 struct sk_buff *next = NULL;
2596 struct sk_buff *buf = l_ptr->defragm_buf;
2597
2598 if (!buf)
2599 return;
2600 if (!link_working_working(l_ptr))
2601 return;
2602 while (buf) {
2603 u32 cnt = get_timer_cnt(buf);
2604
2605 next = buf->next;
2606 if (cnt < 4) {
2607 incr_timer_cnt(buf);
2608 prev = buf;
2609 } else {
2610 if (prev)
2611 prev->next = buf->next;
2612 else
2613 l_ptr->defragm_buf = buf->next;
2614 kfree_skb(buf);
2615 }
2616 buf = next;
2617 }
2618}
2619
2620static void link_set_supervision_props(struct tipc_link *l_ptr, u32 tolerance) 2576static void link_set_supervision_props(struct tipc_link *l_ptr, u32 tolerance)
2621{ 2577{
2622 if ((tolerance < TIPC_MIN_LINK_TOL) || (tolerance > TIPC_MAX_LINK_TOL)) 2578 if ((tolerance < TIPC_MIN_LINK_TOL) || (tolerance > TIPC_MAX_LINK_TOL))