ipmi: fix statistics counting issues

Previous thread: memcg: use rcu_dereference to access mm->owner by Linux Kernel Mailing List on Tuesday, April 21, 2009 - 3:00 pm. (1 message)

Next thread: MAINTAINERS: add Matt Mackall to embedded maintainers by Linux Kernel Mailing List on Tuesday, April 21, 2009 - 3:00 pm. (1 message)
From: Linux Kernel Mailing List
Date: Tuesday, April 21, 2009 - 3:00 pm

Gitweb:     http://git.kernel.org/linus/25176ed670121e1e0aae5c8161713c332b786538
Commit:     25176ed670121e1e0aae5c8161713c332b786538
Parent:     40112ae7504745799e75ef418057f0d2cb745050
Author:     Corey Minyard <cminyard@mvista.com>
AuthorDate: Tue Apr 21 12:24:04 2009 -0700
Committer:  Linus Torvalds <torvalds@linux-foundation.org>
CommitDate: Tue Apr 21 13:41:48 2009 -0700

    ipmi: fix statistics counting issues
    
    Bela Lubkin noticed that the statistics for send IPMB and LAN commands
    in the IPMI driver could be incremented even if an error occurred.  Move
    the increments to the proper place to avoid this.
    
    Also add some statistics for retransmissions that failed, and some little
    helper functions to neaten up the code a little.
    
    Signed-off-by: Corey Minyard <cminyard@mvista.com>
    Cc: Bela Lubkin <blubkin@vmware.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
---
 drivers/char/ipmi/ipmi_msghandler.c |   73 ++++++++++++++++++++++++----------
 1 files changed, 51 insertions(+), 22 deletions(-)

diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c
index e93fc8d..83c7477 100644
--- a/drivers/char/ipmi/ipmi_msghandler.c
+++ b/drivers/char/ipmi/ipmi_msghandler.c
@@ -285,6 +285,11 @@ enum ipmi_stat_indexes {
 	/* Events that were received with the proper format. */
 	IPMI_STAT_events,
 
+	/* Retransmissions on IPMB that failed. */
+	IPMI_STAT_dropped_rexmit_ipmb_commands,
+
+	/* Retransmissions on LAN that failed. */
+	IPMI_STAT_dropped_rexmit_lan_commands,
 
 	/* This *must* remain last, add new values above this. */
 	IPMI_NUM_STATS
@@ -445,6 +450,20 @@ static DEFINE_MUTEX(smi_watchers_mutex);
 #define ipmi_get_stat(intf, stat) \
 	((unsigned int) atomic_read(&(intf)->stats[IPMI_STAT_ ## stat]))
 
+static int is_lan_addr(struct ipmi_addr *addr)
+{
+	return addr->addr_type == IPMI_LAN_ADDR_TYPE;
+}
+
+static ...
Previous thread: memcg: use rcu_dereference to access mm->owner by Linux Kernel Mailing List on Tuesday, April 21, 2009 - 3:00 pm. (1 message)

Next thread: MAINTAINERS: add Matt Mackall to embedded maintainers by Linux Kernel Mailing List on Tuesday, April 21, 2009 - 3:00 pm. (1 message)