diff options
Diffstat (limited to 'net/tipc')
| -rw-r--r-- | net/tipc/bcast.c | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/net/tipc/bcast.c b/net/tipc/bcast.c index 42b1737f0dcf..eefdd1a85f4f 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 | * |
| @@ -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); |
| @@ -394,8 +409,10 @@ int tipc_bclink_send_msg(struct sk_buff *buf) | |||
| 394 | res = tipc_link_send_buf(bcl, buf); | 409 | res = tipc_link_send_buf(bcl, 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 | bcl->stats.sent_info++; |
| 414 | bclink_set_last_sent(); | ||
| 415 | } | ||
| 399 | 416 | ||
| 400 | if (bcl->out_queue_size > bcl->stats.max_queue_sz) | 417 | if (bcl->out_queue_size > bcl->stats.max_queue_sz) |
| 401 | bcl->stats.max_queue_sz = bcl->out_queue_size; | 418 | bcl->stats.max_queue_sz = bcl->out_queue_size; |
| @@ -529,15 +546,6 @@ receive: | |||
| 529 | tipc_node_unlock(node); | 546 | tipc_node_unlock(node); |
| 530 | } | 547 | } |
| 531 | 548 | ||
| 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) | 549 | u32 tipc_bclink_acks_missing(struct tipc_node *n_ptr) |
| 542 | { | 550 | { |
| 543 | return (n_ptr->bclink.supported && | 551 | return (n_ptr->bclink.supported && |
