diff options
Diffstat (limited to 'net/tipc/bcast.c')
-rw-r--r-- | net/tipc/bcast.c | 41 |
1 files changed, 25 insertions, 16 deletions
diff --git a/net/tipc/bcast.c b/net/tipc/bcast.c index a008c6689305..ecfaac10d0b4 100644 --- a/net/tipc/bcast.c +++ b/net/tipc/bcast.c | |||
@@ -143,6 +143,19 @@ static void bcbuf_decr_acks(struct sk_buff *buf) | |||
143 | } | 143 | } |
144 | 144 | ||
145 | 145 | ||
146 | static void bclink_set_last_sent(void) | ||
147 | { | ||
148 | if (bcl->next_out) | ||
149 | bcl->fsm_msg_cnt = mod(buf_seqno(bcl->next_out) - 1); | ||
150 | else | ||
151 | bcl->fsm_msg_cnt = mod(bcl->next_out_no - 1); | ||
152 | } | ||
153 | |||
154 | u32 tipc_bclink_get_last_sent(void) | ||
155 | { | ||
156 | return bcl->fsm_msg_cnt; | ||
157 | } | ||
158 | |||
146 | /** | 159 | /** |
147 | * bclink_set_gap - set gap according to contents of current deferred pkt queue | 160 | * bclink_set_gap - set gap according to contents of current deferred pkt queue |
148 | * | 161 | * |
@@ -171,7 +184,7 @@ static void bclink_set_gap(struct tipc_node *n_ptr) | |||
171 | 184 | ||
172 | static int bclink_ack_allowed(u32 n) | 185 | static int bclink_ack_allowed(u32 n) |
173 | { | 186 | { |
174 | return((n % TIPC_MIN_LINK_WIN) == tipc_own_tag); | 187 | return (n % TIPC_MIN_LINK_WIN) == tipc_own_tag; |
175 | } | 188 | } |
176 | 189 | ||
177 | 190 | ||
@@ -237,8 +250,10 @@ void tipc_bclink_acknowledge(struct tipc_node *n_ptr, u32 acked) | |||
237 | 250 | ||
238 | /* Try resolving broadcast link congestion, if necessary */ | 251 | /* Try resolving broadcast link congestion, if necessary */ |
239 | 252 | ||
240 | if (unlikely(bcl->next_out)) | 253 | if (unlikely(bcl->next_out)) { |
241 | tipc_link_push_queue(bcl); | 254 | tipc_link_push_queue(bcl); |
255 | bclink_set_last_sent(); | ||
256 | } | ||
242 | if (unlikely(released && !list_empty(&bcl->waiting_ports))) | 257 | if (unlikely(released && !list_empty(&bcl->waiting_ports))) |
243 | tipc_link_wakeup_ports(bcl, 0); | 258 | tipc_link_wakeup_ports(bcl, 0); |
244 | spin_unlock_bh(&bc_lock); | 259 | spin_unlock_bh(&bc_lock); |
@@ -395,7 +410,7 @@ int tipc_bclink_send_msg(struct sk_buff *buf) | |||
395 | if (unlikely(res == -ELINKCONG)) | 410 | if (unlikely(res == -ELINKCONG)) |
396 | buf_discard(buf); | 411 | buf_discard(buf); |
397 | else | 412 | else |
398 | bcl->stats.sent_info++; | 413 | bclink_set_last_sent(); |
399 | 414 | ||
400 | if (bcl->out_queue_size > bcl->stats.max_queue_sz) | 415 | if (bcl->out_queue_size > bcl->stats.max_queue_sz) |
401 | bcl->stats.max_queue_sz = bcl->out_queue_size; | 416 | bcl->stats.max_queue_sz = bcl->out_queue_size; |
@@ -529,15 +544,6 @@ receive: | |||
529 | tipc_node_unlock(node); | 544 | tipc_node_unlock(node); |
530 | } | 545 | } |
531 | 546 | ||
532 | u32 tipc_bclink_get_last_sent(void) | ||
533 | { | ||
534 | u32 last_sent = mod(bcl->next_out_no - 1); | ||
535 | |||
536 | if (bcl->next_out) | ||
537 | last_sent = mod(buf_seqno(bcl->next_out) - 1); | ||
538 | return last_sent; | ||
539 | } | ||
540 | |||
541 | u32 tipc_bclink_acks_missing(struct tipc_node *n_ptr) | 547 | u32 tipc_bclink_acks_missing(struct tipc_node *n_ptr) |
542 | { | 548 | { |
543 | return (n_ptr->bclink.supported && | 549 | return (n_ptr->bclink.supported && |
@@ -570,6 +576,7 @@ static int tipc_bcbearer_send(struct sk_buff *buf, | |||
570 | msg = buf_msg(buf); | 576 | msg = buf_msg(buf); |
571 | msg_set_non_seq(msg, 1); | 577 | msg_set_non_seq(msg, 1); |
572 | msg_set_mc_netid(msg, tipc_net_id); | 578 | msg_set_mc_netid(msg, tipc_net_id); |
579 | bcl->stats.sent_info++; | ||
573 | } | 580 | } |
574 | 581 | ||
575 | /* Send buffer over bearers until all targets reached */ | 582 | /* Send buffer over bearers until all targets reached */ |
@@ -609,11 +616,13 @@ static int tipc_bcbearer_send(struct sk_buff *buf, | |||
609 | bcbearer->remains = bcbearer->remains_new; | 616 | bcbearer->remains = bcbearer->remains_new; |
610 | } | 617 | } |
611 | 618 | ||
612 | /* Unable to reach all targets */ | 619 | /* |
620 | * Unable to reach all targets (indicate success, since currently | ||
621 | * there isn't code in place to properly block & unblock the | ||
622 | * pseudo-bearer used by the broadcast link) | ||
623 | */ | ||
613 | 624 | ||
614 | bcbearer->bearer.publ.blocked = 1; | 625 | return TIPC_OK; |
615 | bcl->stats.bearer_congs++; | ||
616 | return 1; | ||
617 | } | 626 | } |
618 | 627 | ||
619 | /** | 628 | /** |