Mercurial > illumos > illumos-gate
changeset 9899:1e97d6212720
6852174 performance counters could show a lesser value for readings within the first second
author | Ramaswamy Tummala <Ramaswamy.Tummala@Sun.COM> |
---|---|
date | Thu, 18 Jun 2009 09:26:55 -0700 |
parents | 30c1d5b38fbf |
children | 1b86d65a4f9e |
files | usr/src/uts/common/io/ib/adapters/hermon/hermon_stats.c |
diffstat | 1 files changed, 17 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/usr/src/uts/common/io/ib/adapters/hermon/hermon_stats.c Thu Jun 18 15:30:30 2009 +0530 +++ b/usr/src/uts/common/io/ib/adapters/hermon/hermon_stats.c Thu Jun 18 09:26:55 2009 -0700 @@ -834,6 +834,21 @@ if (rw == KSTAT_WRITE) { if (data[HERMON_PERFCNTR64_ENABLE_IDX].value.ui32) { if (ksi64->hki64_enabled == 0) { + /* + * Reset the hardware counters to ensure that + * the hardware counter doesn't max out + * (and hence stop counting) before we get + * a chance to reset the counter in + * hermon_kstat_perfcntr64_update_thread. + */ + if (hermon_getperfcntr_cmd_post(state, + ksi64->hki64_port_num, + HERMON_CMD_NOSLEEP_SPIN, NULL, 1) != + HERMON_CMD_SUCCESS) { + mutex_exit(&ksi->hki_perfcntr64_lock); + return (EIO); + } + /* Enable 64 bit software counters */ ksi64->hki64_enabled = 1; for (i = 0; @@ -868,6 +883,8 @@ return (EIO); } + data[HERMON_PERFCNTR64_ENABLE_IDX].value.ui32 = 1; + data[HERMON_PERFCNTR64_XMIT_DATA_IDX].value.ui64 = ksi64->hki64_counters[HERMON_PERFCNTR64_XMIT_DATA_IDX] + ksi64->hki64_last_read[HERMON_PERFCNTR64_XMIT_DATA_IDX];