aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorYing Xue <ying.xue@windriver.com>2013-12-10 23:45:44 -0500
committerDavid S. Miller <davem@davemloft.net>2013-12-11 00:17:43 -0500
commit77a7e07a78a44d6c015fa8447ab84bcdb360e35d (patch)
treee260a6a80b68dc854662630fecd3b37ec28a54d7 /net
parente4d050cbf7720d8bcc781f4ef557d37ed148a5c4 (diff)
tipc: remove unused 'blocked' flag from tipc_link struct
In early versions of TIPC it was possible to administratively block individual links through the use of the member flag 'blocked'. This functionality was deemed redundant, and since commit 7368dd ("tipc: clean out all instances of #if 0'd unused code"), this flag has been unused. In the current code, a link only needs to be blocked for sending and reception if it is subject to an ongoing link failover. In that case, it is sufficient to check if the number of expected failover packets is non-zero, something which is done via the funtion 'link_blocked()'. This commit finally removes the redundant 'blocked' flag completely. Signed-off-by: Ying Xue <ying.xue@windriver.com> Reviewed-by: Paul Gortmaker <paul.gortmaker@windriver.com> Signed-off-by: Jon Maloy <jon.maloy@ericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/tipc/link.c11
-rw-r--r--net/tipc/link.h7
2 files changed, 7 insertions, 11 deletions
diff --git a/net/tipc/link.c b/net/tipc/link.c
index ac26f8a657d9..3d73144a1ccc 100644
--- a/net/tipc/link.c
+++ b/net/tipc/link.c
@@ -488,10 +488,11 @@ static void link_state_event(struct tipc_link *l_ptr, unsigned int event)
488 if (!l_ptr->started && (event != STARTING_EVT)) 488 if (!l_ptr->started && (event != STARTING_EVT))
489 return; /* Not yet. */ 489 return; /* Not yet. */
490 490
491 if (link_blocked(l_ptr)) { 491 /* Check whether changeover is going on */
492 if (l_ptr->exp_msg_count) {
492 if (event == TIMEOUT_EVT) 493 if (event == TIMEOUT_EVT)
493 link_set_timer(l_ptr, cont_intv); 494 link_set_timer(l_ptr, cont_intv);
494 return; /* Changeover going on */ 495 return;
495 } 496 }
496 497
497 switch (l_ptr->state) { 498 switch (l_ptr->state) {
@@ -1731,7 +1732,8 @@ void tipc_link_send_proto_msg(struct tipc_link *l_ptr, u32 msg_typ,
1731 l_ptr->proto_msg_queue = NULL; 1732 l_ptr->proto_msg_queue = NULL;
1732 } 1733 }
1733 1734
1734 if (link_blocked(l_ptr)) 1735 /* Don't send protocol message during link changeover */
1736 if (l_ptr->exp_msg_count)
1735 return; 1737 return;
1736 1738
1737 /* Abort non-RESET send if communication with node is prohibited */ 1739 /* Abort non-RESET send if communication with node is prohibited */
@@ -1824,7 +1826,8 @@ static void link_recv_proto_msg(struct tipc_link *l_ptr, struct sk_buff *buf)
1824 u32 msg_tol; 1826 u32 msg_tol;
1825 struct tipc_msg *msg = buf_msg(buf); 1827 struct tipc_msg *msg = buf_msg(buf);
1826 1828
1827 if (link_blocked(l_ptr)) 1829 /* Discard protocol message during link changeover */
1830 if (l_ptr->exp_msg_count)
1828 goto exit; 1831 goto exit;
1829 1832
1830 /* record unnumbered packet arrival (force mismatch on next timeout) */ 1833 /* record unnumbered packet arrival (force mismatch on next timeout) */
diff --git a/net/tipc/link.h b/net/tipc/link.h
index 8a6c1026644d..424b1dfe436b 100644
--- a/net/tipc/link.h
+++ b/net/tipc/link.h
@@ -112,7 +112,6 @@ struct tipc_stats {
112 * @continuity_interval: link continuity testing interval [in ms] 112 * @continuity_interval: link continuity testing interval [in ms]
113 * @abort_limit: # of unacknowledged continuity probes needed to reset link 113 * @abort_limit: # of unacknowledged continuity probes needed to reset link
114 * @state: current state of link FSM 114 * @state: current state of link FSM
115 * @blocked: indicates if link has been administratively blocked
116 * @fsm_msg_cnt: # of protocol messages link FSM has sent in current state 115 * @fsm_msg_cnt: # of protocol messages link FSM has sent in current state
117 * @proto_msg: template for control messages generated by link 116 * @proto_msg: template for control messages generated by link
118 * @pmsg: convenience pointer to "proto_msg" field 117 * @pmsg: convenience pointer to "proto_msg" field
@@ -162,7 +161,6 @@ struct tipc_link {
162 u32 continuity_interval; 161 u32 continuity_interval;
163 u32 abort_limit; 162 u32 abort_limit;
164 int state; 163 int state;
165 int blocked;
166 u32 fsm_msg_cnt; 164 u32 fsm_msg_cnt;
167 struct { 165 struct {
168 unchar hdr[INT_H_SIZE]; 166 unchar hdr[INT_H_SIZE];
@@ -312,11 +310,6 @@ static inline int link_reset_reset(struct tipc_link *l_ptr)
312 return l_ptr->state == RESET_RESET; 310 return l_ptr->state == RESET_RESET;
313} 311}
314 312
315static inline int link_blocked(struct tipc_link *l_ptr)
316{
317 return l_ptr->exp_msg_count || l_ptr->blocked;
318}
319
320static inline int link_congested(struct tipc_link *l_ptr) 313static inline int link_congested(struct tipc_link *l_ptr)
321{ 314{
322 return l_ptr->out_queue_size >= l_ptr->queue_limit[0]; 315 return l_ptr->out_queue_size >= l_ptr->queue_limit[0];