aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc/bcast.c
diff options
context:
space:
mode:
authorRichard Alpe <richard.alpe@ericsson.com>2015-02-09 03:50:06 -0500
committerDavid S. Miller <davem@davemloft.net>2015-02-09 16:20:47 -0500
commitf2b3b2d4ccbf9666f5f42a21347cd1aaa532b2fa (patch)
tree36a8eea16c58cd54f91ced3862da77803b223dcf /net/tipc/bcast.c
parent9ab154658a7ff2c5076607e02f18581c6859fc2a (diff)
tipc: convert legacy nl link stat to nl compat
Add functionality for safely appending string data to a TLV without keeping write count in the caller. Convert TIPC_CMD_SHOW_LINK_STATS to compat dumpit. Signed-off-by: Richard Alpe <richard.alpe@ericsson.com> Reviewed-by: Erik Hugne <erik.hugne@ericsson.com> Reviewed-by: Ying Xue <ying.xue@windriver.com> Reviewed-by: Jon Maloy <jon.maloy@ericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/bcast.c')
-rw-r--r--net/tipc/bcast.c43
1 files changed, 0 insertions, 43 deletions
diff --git a/net/tipc/bcast.c b/net/tipc/bcast.c
index e96fd6a6d5c2..3e41704832de 100644
--- a/net/tipc/bcast.c
+++ b/net/tipc/bcast.c
@@ -860,49 +860,6 @@ msg_full:
860 return -EMSGSIZE; 860 return -EMSGSIZE;
861} 861}
862 862
863int tipc_bclink_stats(struct net *net, char *buf, const u32 buf_size)
864{
865 int ret;
866 struct tipc_stats *s;
867 struct tipc_net *tn = net_generic(net, tipc_net_id);
868 struct tipc_link *bcl = tn->bcl;
869
870 if (!bcl)
871 return 0;
872
873 tipc_bclink_lock(net);
874
875 s = &bcl->stats;
876
877 ret = tipc_snprintf(buf, buf_size, "Link <%s>\n"
878 " Window:%u packets\n",
879 bcl->name, bcl->queue_limit[0]);
880 ret += tipc_snprintf(buf + ret, buf_size - ret,
881 " RX packets:%u fragments:%u/%u bundles:%u/%u\n",
882 s->recv_info, s->recv_fragments,
883 s->recv_fragmented, s->recv_bundles,
884 s->recv_bundled);
885 ret += tipc_snprintf(buf + ret, buf_size - ret,
886 " TX packets:%u fragments:%u/%u bundles:%u/%u\n",
887 s->sent_info, s->sent_fragments,
888 s->sent_fragmented, s->sent_bundles,
889 s->sent_bundled);
890 ret += tipc_snprintf(buf + ret, buf_size - ret,
891 " RX naks:%u defs:%u dups:%u\n",
892 s->recv_nacks, s->deferred_recv, s->duplicates);
893 ret += tipc_snprintf(buf + ret, buf_size - ret,
894 " TX naks:%u acks:%u dups:%u\n",
895 s->sent_nacks, s->sent_acks, s->retransmitted);
896 ret += tipc_snprintf(buf + ret, buf_size - ret,
897 " Congestion link:%u Send queue max:%u avg:%u\n",
898 s->link_congs, s->max_queue_sz,
899 s->queue_sz_counts ?
900 (s->accu_queue_sz / s->queue_sz_counts) : 0);
901
902 tipc_bclink_unlock(net);
903 return ret;
904}
905
906int tipc_bclink_reset_stats(struct net *net) 863int tipc_bclink_reset_stats(struct net *net)
907{ 864{
908 struct tipc_net *tn = net_generic(net, tipc_net_id); 865 struct tipc_net *tn = net_generic(net, tipc_net_id);