diff options
author | gd78059 <none@none> | 2007-04-23 17:22:33 -0700 |
---|---|---|
committer | gd78059 <none@none> | 2007-04-23 17:22:33 -0700 |
commit | 9b14cf1dc76dad8f2d9a74310e0a0200af96d217 (patch) | |
tree | 26f430ef09933a3b85cc8feda220af53103638ee /usr/src | |
parent | adb91f4744062c28f7f3d0e8bf4704d2a8127b89 (diff) | |
download | illumos-gate-9b14cf1dc76dad8f2d9a74310e0a0200af96d217.tar.gz |
PSARC 2007/220 Update Nemo Statistics
6547508 nemo needs to support cap_rem_fault MII statistics
Diffstat (limited to 'usr/src')
-rw-r--r-- | usr/src/uts/common/io/bge/bge_kstats.c | 33 | ||||
-rw-r--r-- | usr/src/uts/common/io/mac/mac_stat.c | 4 | ||||
-rw-r--r-- | usr/src/uts/common/io/mac/plugins/mac_ether.c | 4 | ||||
-rw-r--r-- | usr/src/uts/common/sys/mac.h | 13 | ||||
-rw-r--r-- | usr/src/uts/common/sys/mac_ether.h | 18 |
5 files changed, 65 insertions, 7 deletions
diff --git a/usr/src/uts/common/io/bge/bge_kstats.c b/usr/src/uts/common/io/bge/bge_kstats.c index 0432653fe8..38f712652e 100644 --- a/usr/src/uts/common/io/bge/bge_kstats.c +++ b/usr/src/uts/common/io/bge/bge_kstats.c @@ -1169,6 +1169,13 @@ bge_m_stat(void *arg, uint_t stat, uint64_t *val) *val = pstats->dot3StatsFrameTooLongs; break; + case ETHER_STAT_TOOSHORT_ERRORS: + if (bgep->chipid.statistic_type == BGE_STAT_BLK) + *val = bstp->s.etherStatsUndersizePkts; + else + *val = pstats->etherStatsUndersizePkts; + break; + case ETHER_STAT_XCVR_ADDR: *val = bgep->phy_mii_addr; break; @@ -1225,6 +1232,10 @@ bge_m_stat(void *arg, uint_t stat, uint64_t *val) *val = 1; break; + case ETHER_STAT_CAP_REMFAULT: + *val = 1; + break; + case ETHER_STAT_ADV_CAP_1000FDX: *val = bgep->param_adv_1000fdx; break; @@ -1261,6 +1272,17 @@ bge_m_stat(void *arg, uint_t stat, uint64_t *val) *val = bgep->param_adv_autoneg; break; + case ETHER_STAT_ADV_REMFAULT: + mutex_enter(bgep->genlock); + *val = bge_mii_get16(bgep, MII_AN_ADVERT) & + MII_AN_ADVERT_REMFAULT ? 1 : 0; + if (bge_check_acc_handle(bgep, bgep->io_handle) != DDI_FM_OK) { + ddi_fm_service_impact(bgep->devinfo, + DDI_SERVICE_UNAFFECTED); + } + mutex_exit(bgep->genlock); + break; + case ETHER_STAT_LP_CAP_1000FDX: *val = bgep->param_lp_1000fdx; break; @@ -1297,6 +1319,17 @@ bge_m_stat(void *arg, uint_t stat, uint64_t *val) *val = bgep->param_lp_autoneg; break; + case ETHER_STAT_LP_REMFAULT: + mutex_enter(bgep->genlock); + *val = bge_mii_get16(bgep, MII_AN_LPABLE) & + MII_AN_ADVERT_REMFAULT ? 1 : 0; + if (bge_check_acc_handle(bgep, bgep->io_handle) != DDI_FM_OK) { + ddi_fm_service_impact(bgep->devinfo, + DDI_SERVICE_UNAFFECTED); + } + mutex_exit(bgep->genlock); + break; + case ETHER_STAT_LINK_ASMPAUSE: *val = bgep->param_adv_asym_pause && bgep->param_lp_asym_pause && diff --git a/usr/src/uts/common/io/mac/mac_stat.c b/usr/src/uts/common/io/mac/mac_stat.c index 26032342ff..f25afd3f1f 100644 --- a/usr/src/uts/common/io/mac/mac_stat.c +++ b/usr/src/uts/common/io/mac/mac_stat.c @@ -19,7 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -51,6 +51,8 @@ static mac_stat_info_t i_mac_si[] = { { MAC_STAT_NOXMTBUF, "noxmtbuf", KSTAT_DATA_UINT32, 0 }, { MAC_STAT_OERRORS, "oerrors", KSTAT_DATA_UINT32, 0 }, { MAC_STAT_COLLISIONS, "collisions", KSTAT_DATA_UINT32, 0 }, + { MAC_STAT_UNDERFLOWS, "uflo", KSTAT_DATA_UINT32, 0 }, + { MAC_STAT_OVERFLOWS, "oflo", KSTAT_DATA_UINT32, 0 }, { MAC_STAT_RBYTES, "rbytes", KSTAT_DATA_UINT32, 0 }, { MAC_STAT_IPACKETS, "ipackets", KSTAT_DATA_UINT32, 0 }, { MAC_STAT_OBYTES, "obytes", KSTAT_DATA_UINT32, 0 }, diff --git a/usr/src/uts/common/io/mac/plugins/mac_ether.c b/usr/src/uts/common/io/mac/plugins/mac_ether.c index 819b5939a6..e6f76243a0 100644 --- a/usr/src/uts/common/io/mac/plugins/mac_ether.c +++ b/usr/src/uts/common/io/mac/plugins/mac_ether.c @@ -59,6 +59,7 @@ static mac_stat_info_t ether_stats[] = { { ETHER_STAT_CARRIER_ERRORS, "carrier_errors", KSTAT_DATA_UINT32, 0 }, { ETHER_STAT_TOOLONG_ERRORS, "toolong_errors", KSTAT_DATA_UINT32, 0 }, { ETHER_STAT_MACRCV_ERRORS, "macrcv_errors", KSTAT_DATA_UINT32, 0 }, + { ETHER_STAT_TOOSHORT_ERRORS, "runt_errors", KSTAT_DATA_UINT32, 0 }, /* Statistics described in the ieee802.3(5) man page */ { ETHER_STAT_XCVR_ADDR, "xcvr_addr", KSTAT_DATA_UINT32, 0 }, @@ -73,6 +74,7 @@ static mac_stat_info_t ether_stats[] = { { ETHER_STAT_CAP_ASMPAUSE, "cap_asmpause", KSTAT_DATA_UINT32, 0 }, { ETHER_STAT_CAP_PAUSE, "cap_pause", KSTAT_DATA_UINT32, 0 }, { ETHER_STAT_CAP_AUTONEG, "cap_autoneg", KSTAT_DATA_UINT32, 0 }, + { ETHER_STAT_CAP_REMFAULT, "cap_rem_fault", KSTAT_DATA_UINT32, 0 }, { ETHER_STAT_ADV_CAP_1000FDX, "adv_cap_1000fdx", KSTAT_DATA_UINT32, 0 }, { ETHER_STAT_ADV_CAP_1000HDX, "adv_cap_1000hdx", KSTAT_DATA_UINT32, 0 }, { ETHER_STAT_ADV_CAP_100FDX, "adv_cap_100fdx", KSTAT_DATA_UINT32, 0}, @@ -83,6 +85,7 @@ static mac_stat_info_t ether_stats[] = { 0 }, { ETHER_STAT_ADV_CAP_PAUSE, "adv_cap_pause", KSTAT_DATA_UINT32, 0 }, { ETHER_STAT_ADV_CAP_AUTONEG, "adv_cap_autoneg", KSTAT_DATA_UINT32, 0 }, + { ETHER_STAT_ADV_REMFAULT, "adv_rem_fault", KSTAT_DATA_UINT32, 0 }, { ETHER_STAT_LP_CAP_1000FDX, "lp_cap_1000fdx", KSTAT_DATA_UINT32, 0 }, { ETHER_STAT_LP_CAP_1000HDX, "lp_cap_1000hdx", KSTAT_DATA_UINT32, 0 }, { ETHER_STAT_LP_CAP_100FDX, "lp_cap_100fdx", KSTAT_DATA_UINT32, 0 }, @@ -92,6 +95,7 @@ static mac_stat_info_t ether_stats[] = { { ETHER_STAT_LP_CAP_ASMPAUSE, "lp_cap_asmpause", KSTAT_DATA_UINT32, 0 }, { ETHER_STAT_LP_CAP_PAUSE, "lp_cap_pause", KSTAT_DATA_UINT32, 0 }, { ETHER_STAT_LP_CAP_AUTONEG, "lp_cap_autoneg", KSTAT_DATA_UINT32, 0 }, + { ETHER_STAT_LP_REMFAULT, "lp_rem_fault", KSTAT_DATA_UINT32, 0 }, { ETHER_STAT_LINK_ASMPAUSE, "link_asmpause", KSTAT_DATA_UINT32, 0 }, { ETHER_STAT_LINK_PAUSE, "link_pause", KSTAT_DATA_UINT32, 0 }, { ETHER_STAT_LINK_AUTONEG, "link_autoneg", KSTAT_DATA_UINT32, 0 }, diff --git a/usr/src/uts/common/sys/mac.h b/usr/src/uts/common/sys/mac.h index c3b9b8fa1e..6b05c8f94d 100644 --- a/usr/src/uts/common/sys/mac.h +++ b/usr/src/uts/common/sys/mac.h @@ -107,6 +107,9 @@ typedef struct mac_stat_info_s { (stat >= MAC_STAT_MIN && stat < MACTYPE_STAT_MIN) #define IS_MACTYPE_STAT(stat) (stat >= MACTYPE_STAT_MIN) +/* + * Do not reorder, and add only to the end of this list. + */ enum mac_driver_stat { /* MIB-II stats (RFC 1213 and RFC 1573) */ MAC_STAT_IFSPEED = MAC_STAT_MIN, @@ -123,10 +126,12 @@ enum mac_driver_stat { MAC_STAT_RBYTES, MAC_STAT_IPACKETS, MAC_STAT_OBYTES, - MAC_STAT_OPACKETS + MAC_STAT_OPACKETS, + MAC_STAT_UNDERFLOWS, + MAC_STAT_OVERFLOWS }; -#define MAC_NSTAT (MAC_STAT_OPACKETS - MAC_STAT_IFSPEED + 1) +#define MAC_NSTAT (MAC_STAT_OVERFLOWS - MAC_STAT_IFSPEED + 1) #define MAC_STAT_ISACOUNTER(_stat) ( \ (_stat) == MAC_STAT_MULTIRCV || \ @@ -142,7 +147,9 @@ enum mac_driver_stat { (_stat) == MAC_STAT_RBYTES || \ (_stat) == MAC_STAT_IPACKETS || \ (_stat) == MAC_STAT_OBYTES || \ - (_stat) == MAC_STAT_OPACKETS) + (_stat) == MAC_STAT_OPACKETS || \ + (_stat) == MAC_STAT_UNDERFLOWS || \ + (_stat) == MAC_STAT_OVERFLOWS) /* * Maximum MAC address length diff --git a/usr/src/uts/common/sys/mac_ether.h b/usr/src/uts/common/sys/mac_ether.h index dbb5053306..5033f1338e 100644 --- a/usr/src/uts/common/sys/mac_ether.h +++ b/usr/src/uts/common/sys/mac_ether.h @@ -19,7 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -40,6 +40,9 @@ extern "C" { #define MAC_PLUGIN_IDENT_ETHER "mac_ether" +/* + * Do not reorder, and add only to the end of this list. + */ enum ether_stat { /* RFC 1643 stats */ ETHER_STAT_ALIGN_ERRORS = MACTYPE_STAT_MIN, @@ -89,10 +92,15 @@ enum ether_stat { ETHER_STAT_LINK_ASMPAUSE, ETHER_STAT_LINK_PAUSE, ETHER_STAT_LINK_AUTONEG, - ETHER_STAT_LINK_DUPLEX + ETHER_STAT_LINK_DUPLEX, + + ETHER_STAT_TOOSHORT_ERRORS, + ETHER_STAT_CAP_REMFAULT, + ETHER_STAT_ADV_REMFAULT, + ETHER_STAT_LP_REMFAULT }; -#define ETHER_NSTAT (ETHER_STAT_LINK_DUPLEX - ETHER_STAT_ALIGN_ERRORS + 1) +#define ETHER_NSTAT (ETHER_STAT_LP_REMFAULT - ETHER_STAT_ALIGN_ERRORS + 1) #define ETHER_STAT_ISACOUNTER(_ether_stat) \ ((_ether_stat) == ETHER_STAT_ALIGN_ERRORS || \ @@ -106,6 +114,7 @@ enum ether_stat { (_ether_stat) == ETHER_STAT_MACXMT_ERRORS || \ (_ether_stat) == ETHER_STAT_CARRIER_ERRORS || \ (_ether_stat) == ETHER_STAT_TOOLONG_ERRORS || \ + (_ether_stat) == ETHER_STAT_TOOSHORT_ERRORS || \ (_ether_stat) == ETHER_STAT_MACRCV_ERRORS) /* @@ -125,6 +134,7 @@ enum ether_stat { (_ether_stat) == ETHER_STAT_CAP_ASMPAUSE || \ (_ether_stat) == ETHER_STAT_CAP_PAUSE || \ (_ether_stat) == ETHER_STAT_CAP_AUTONEG || \ + (_ether_stat) == ETHER_STAT_CAP_REMFAULT || \ (_ether_stat) == ETHER_STAT_ADV_CAP_1000FDX || \ (_ether_stat) == ETHER_STAT_ADV_CAP_1000HDX || \ (_ether_stat) == ETHER_STAT_ADV_CAP_100FDX || \ @@ -134,6 +144,7 @@ enum ether_stat { (_ether_stat) == ETHER_STAT_ADV_CAP_ASMPAUSE || \ (_ether_stat) == ETHER_STAT_ADV_CAP_PAUSE || \ (_ether_stat) == ETHER_STAT_ADV_CAP_AUTONEG || \ + (_ether_stat) == ETHER_STAT_ADV_REMFAULT || \ (_ether_stat) == ETHER_STAT_LP_CAP_1000FDX || \ (_ether_stat) == ETHER_STAT_LP_CAP_1000HDX || \ (_ether_stat) == ETHER_STAT_LP_CAP_100FDX || \ @@ -143,6 +154,7 @@ enum ether_stat { (_ether_stat) == ETHER_STAT_LP_CAP_ASMPAUSE || \ (_ether_stat) == ETHER_STAT_LP_CAP_PAUSE || \ (_ether_stat) == ETHER_STAT_LP_CAP_AUTONEG || \ + (_ether_stat) == ETHER_STAT_LP_REMFAULT || \ (_ether_stat) == ETHER_STAT_LINK_ASMPAUSE || \ (_ether_stat) == ETHER_STAT_LINK_PAUSE || \ (_ether_stat) == ETHER_STAT_LINK_AUTONEG || \ |