aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc/link.c
diff options
context:
space:
mode:
authorAllan Stephens <Allan.Stephens@windriver.com>2011-01-18 15:02:50 -0500
committerPaul Gortmaker <paul.gortmaker@windriver.com>2011-02-23 18:05:15 -0500
commit9bd80b60827fe8d84c0e594895acb8a44f2b98b1 (patch)
tree8cb52c2ea3e31bca91da5989159d0dd0da413e86 /net/tipc/link.c
parenttipc: Eliminate unnecessary locking when starting topology service (diff)
downloadlinux-dev-9bd80b60827fe8d84c0e594895acb8a44f2b98b1.tar.xz
linux-dev-9bd80b60827fe8d84c0e594895acb8a44f2b98b1.zip
tipc: Improve accuracy of link transmit queue maximum size statistic
Enhances TIPC's unicast and broadcast link code to update the transmit queue maximum size counter in a single place, namely the routine that adds messages to the queue. This ensures that the maximum size statistic reported for unicast links is completely accurate, rather than being partially based on statistical sampling. The changes to link.h are just documenting the roles of the variables. Signed-off-by: Allan Stephens <Allan.Stephens@windriver.com> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Diffstat (limited to 'net/tipc/link.c')
-rw-r--r--net/tipc/link.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/net/tipc/link.c b/net/tipc/link.c
index 0cb773b7ee21..d1818fbc19a3 100644
--- a/net/tipc/link.c
+++ b/net/tipc/link.c
@@ -246,9 +246,6 @@ static void link_timeout(struct link *l_ptr)
l_ptr->stats.accu_queue_sz += l_ptr->out_queue_size;
l_ptr->stats.queue_sz_counts++;
- if (l_ptr->out_queue_size > l_ptr->stats.max_queue_sz)
- l_ptr->stats.max_queue_sz = l_ptr->out_queue_size;
-
if (l_ptr->first_out) {
struct tipc_msg *msg = buf_msg(l_ptr->first_out);
u32 length = msg_size(msg);
@@ -824,7 +821,10 @@ static void link_add_to_outqueue(struct link *l_ptr,
l_ptr->last_out = buf;
} else
l_ptr->first_out = l_ptr->last_out = buf;
+
l_ptr->out_queue_size++;
+ if (l_ptr->out_queue_size > l_ptr->stats.max_queue_sz)
+ l_ptr->stats.max_queue_sz = l_ptr->out_queue_size;
}
/*
@@ -867,9 +867,6 @@ int tipc_link_send_buf(struct link *l_ptr, struct sk_buff *buf)
/* Packet can be queued or sent: */
- if (queue_size > l_ptr->stats.max_queue_sz)
- l_ptr->stats.max_queue_sz = queue_size;
-
if (likely(!tipc_bearer_congested(l_ptr->b_ptr, l_ptr) &&
!link_congested(l_ptr))) {
link_add_to_outqueue(l_ptr, buf, msg);