aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc/bcast.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/tipc/bcast.c')
-rw-r--r--net/tipc/bcast.c75
1 files changed, 35 insertions, 40 deletions
diff --git a/net/tipc/bcast.c b/net/tipc/bcast.c
index 2625f5ebe3e8..e4e6d8cd47e6 100644
--- a/net/tipc/bcast.c
+++ b/net/tipc/bcast.c
@@ -162,7 +162,7 @@ static void bclink_update_last_sent(struct tipc_node *node, u32 seqno)
162} 162}
163 163
164 164
165/* 165/**
166 * tipc_bclink_retransmit_to - get most recent node to request retransmission 166 * tipc_bclink_retransmit_to - get most recent node to request retransmission
167 * 167 *
168 * Called with bc_lock locked 168 * Called with bc_lock locked
@@ -270,7 +270,7 @@ exit:
270 spin_unlock_bh(&bc_lock); 270 spin_unlock_bh(&bc_lock);
271} 271}
272 272
273/* 273/**
274 * tipc_bclink_update_link_state - update broadcast link state 274 * tipc_bclink_update_link_state - update broadcast link state
275 * 275 *
276 * tipc_net_lock and node lock set 276 * tipc_net_lock and node lock set
@@ -330,7 +330,7 @@ void tipc_bclink_update_link_state(struct tipc_node *n_ptr, u32 last_sent)
330 } 330 }
331} 331}
332 332
333/* 333/**
334 * bclink_peek_nack - monitor retransmission requests sent by other nodes 334 * bclink_peek_nack - monitor retransmission requests sent by other nodes
335 * 335 *
336 * Delay any upcoming NACK by this node if another node has already 336 * Delay any upcoming NACK by this node if another node has already
@@ -381,7 +381,7 @@ exit:
381 return res; 381 return res;
382} 382}
383 383
384/* 384/**
385 * bclink_accept_pkt - accept an incoming, in-sequence broadcast packet 385 * bclink_accept_pkt - accept an incoming, in-sequence broadcast packet
386 * 386 *
387 * Called with both sending node's lock and bc_lock taken. 387 * Called with both sending node's lock and bc_lock taken.
@@ -406,7 +406,7 @@ static void bclink_accept_pkt(struct tipc_node *node, u32 seqno)
406 } 406 }
407} 407}
408 408
409/* 409/**
410 * tipc_bclink_recv_pkt - receive a broadcast packet, and deliver upwards 410 * tipc_bclink_recv_pkt - receive a broadcast packet, and deliver upwards
411 * 411 *
412 * tipc_net_lock is read_locked, no other locks set 412 * tipc_net_lock is read_locked, no other locks set
@@ -701,48 +701,43 @@ void tipc_bcbearer_sort(void)
701 701
702int tipc_bclink_stats(char *buf, const u32 buf_size) 702int tipc_bclink_stats(char *buf, const u32 buf_size)
703{ 703{
704 struct print_buf pb; 704 int ret;
705 struct tipc_stats *s;
705 706
706 if (!bcl) 707 if (!bcl)
707 return 0; 708 return 0;
708 709
709 tipc_printbuf_init(&pb, buf, buf_size);
710
711 spin_lock_bh(&bc_lock); 710 spin_lock_bh(&bc_lock);
712 711
713 tipc_printf(&pb, "Link <%s>\n" 712 s = &bcl->stats;
714 " Window:%u packets\n", 713
715 bcl->name, bcl->queue_limit[0]); 714 ret = tipc_snprintf(buf, buf_size, "Link <%s>\n"
716 tipc_printf(&pb, " RX packets:%u fragments:%u/%u bundles:%u/%u\n", 715 " Window:%u packets\n",
717 bcl->stats.recv_info, 716 bcl->name, bcl->queue_limit[0]);
718 bcl->stats.recv_fragments, 717 ret += tipc_snprintf(buf + ret, buf_size - ret,
719 bcl->stats.recv_fragmented, 718 " RX packets:%u fragments:%u/%u bundles:%u/%u\n",
720 bcl->stats.recv_bundles, 719 s->recv_info, s->recv_fragments,
721 bcl->stats.recv_bundled); 720 s->recv_fragmented, s->recv_bundles,
722 tipc_printf(&pb, " TX packets:%u fragments:%u/%u bundles:%u/%u\n", 721 s->recv_bundled);
723 bcl->stats.sent_info, 722 ret += tipc_snprintf(buf + ret, buf_size - ret,
724 bcl->stats.sent_fragments, 723 " TX packets:%u fragments:%u/%u bundles:%u/%u\n",
725 bcl->stats.sent_fragmented, 724 s->sent_info, s->sent_fragments,
726 bcl->stats.sent_bundles, 725 s->sent_fragmented, s->sent_bundles,
727 bcl->stats.sent_bundled); 726 s->sent_bundled);
728 tipc_printf(&pb, " RX naks:%u defs:%u dups:%u\n", 727 ret += tipc_snprintf(buf + ret, buf_size - ret,
729 bcl->stats.recv_nacks, 728 " RX naks:%u defs:%u dups:%u\n",
730 bcl->stats.deferred_recv, 729 s->recv_nacks, s->deferred_recv, s->duplicates);
731 bcl->stats.duplicates); 730 ret += tipc_snprintf(buf + ret, buf_size - ret,
732 tipc_printf(&pb, " TX naks:%u acks:%u dups:%u\n", 731 " TX naks:%u acks:%u dups:%u\n",
733 bcl->stats.sent_nacks, 732 s->sent_nacks, s->sent_acks, s->retransmitted);
734 bcl->stats.sent_acks, 733 ret += tipc_snprintf(buf + ret, buf_size - ret,
735 bcl->stats.retransmitted); 734 " Congestion bearer:%u link:%u Send queue max:%u avg:%u\n",
736 tipc_printf(&pb, " Congestion bearer:%u link:%u Send queue max:%u avg:%u\n", 735 s->bearer_congs, s->link_congs, s->max_queue_sz,
737 bcl->stats.bearer_congs, 736 s->queue_sz_counts ?
738 bcl->stats.link_congs, 737 (s->accu_queue_sz / s->queue_sz_counts) : 0);
739 bcl->stats.max_queue_sz,
740 bcl->stats.queue_sz_counts
741 ? (bcl->stats.accu_queue_sz / bcl->stats.queue_sz_counts)
742 : 0);
743 738
744 spin_unlock_bh(&bc_lock); 739 spin_unlock_bh(&bc_lock);
745 return tipc_printbuf_validate(&pb); 740 return ret;
746} 741}
747 742
748int tipc_bclink_reset_stats(void) 743int tipc_bclink_reset_stats(void)
@@ -880,7 +875,7 @@ void tipc_port_list_add(struct tipc_port_list *pl_ptr, u32 port)
880 if (!item->next) { 875 if (!item->next) {
881 item->next = kmalloc(sizeof(*item), GFP_ATOMIC); 876 item->next = kmalloc(sizeof(*item), GFP_ATOMIC);
882 if (!item->next) { 877 if (!item->next) {
883 warn("Incomplete multicast delivery, no memory\n"); 878 pr_warn("Incomplete multicast delivery, no memory\n");
884 return; 879 return;
885 } 880 }
886 item->next->next = NULL; 881 item->next->next = NULL;